ESPHome - Configuration JetHub E1-PD76-R5-[AC/DC] (v3)
Controller configuration JetHub E1-PD76-R5-AC (v3) and JetHub E1-PD76-R5-DC (v3) for ESPHome.
Note
To build firmware for JetHub E1-PD76-R5-[AC/DC] (v3) controllers, you must use versions of ESPHome 2023.11.0 or newer that have included support for PCA9535 and similar port expanders.
Configuration
- This configuration implements:
Setting up Ethernet with automatic IP address detection.
Integration with Home Assistant.
Setting the LEDs
STAT
(red and green).Relay setting.
Event detection from the
FN
button .Detection of events from all discrete inputs.
1-wire bus.
Note
Once the controller is loaded and the IP address is obtained, the controller will automatically be available on the Home Assistant running on the same network.
1esphome:
2 name: e1-pd76-r5-v3
3 platform: ESP32
4 board: nodemcu-32s
5 name_add_mac_suffix: true # This option adds MAC address to the end of the device name
6
7## WARNING: Disable WiFi and captive_portal if Ethernet enabled
8#wifi:
9# ssid: "***"
10# password: "***"
11#
12# # Enable fallback hotspot (captive portal) in case wifi connection fails
13# ap:
14# ssid: "JetHub E1 Fallback Hotspot"
15# password: "***"
16#
17#captive_portal:
18
19# Enable Ethernet
20ethernet:
21 type: LAN8720
22 mdc_pin: GPIO23
23 mdio_pin: GPIO18
24 clk_mode: GPIO17_OUT
25 phy_addr: 1
26
27# Enable logging
28logger:
29
30# Enable Home Assistant API
31api:
32
33# Enable OTA firmware update
34ota:
35
36# Enable internal WEB server
37web_server:
38 port: 80
39
40# Enable I2C bus
41i2c:
42 sda: 5
43 scl: 4
44 frequency: 400kHz
45 scan: true
46 id: i2c1
47
48# Enable UART1
49uart:
50 - tx_pin: 33
51 rx_pin: 34
52 baud_rate: 115200
53 id: uart_1
54
55# Enable I2C GPIO expanders
56pca9554:
57 - id: cpu_gpio_exp
58 pin_count: 16
59 address: 0x20
60 - id: mb_gpio_exp
61 pin_count: 16
62 address: 0x22
63
64# Enable digital outputs: LEDs and relays
65switch:
66 - platform: gpio
67 name: "Red LED"
68 id: red_led
69 pin:
70 pca9554: cpu_gpio_exp
71 number: 0
72 mode: OUTPUT
73 inverted: false
74 - platform: gpio
75 name: "Green LED"
76 id: green_led
77 pin:
78 pca9554: cpu_gpio_exp
79 number: 1
80 mode: OUTPUT
81 inverted: false
82 - platform: gpio
83 name: "Relay 1"
84 id: relay_1
85 pin:
86 pca9554: mb_gpio_exp
87 number: 8
88 mode: OUTPUT
89 inverted: false
90 - platform: gpio
91 name: "Relay 2"
92 id: relay_2
93 pin:
94 pca9554: mb_gpio_exp
95 number: 9
96 mode: OUTPUT
97 inverted: false
98 - platform: gpio
99 name: "Relay 3"
100 id: relay_3
101 pin:
102 pca9554: mb_gpio_exp
103 number: 10
104 mode: OUTPUT
105 inverted: false
106 - platform: gpio
107 name: "Relay 4"
108 id: relay_4
109 pin:
110 pca9554: mb_gpio_exp
111 number: 11
112 mode: OUTPUT
113 inverted: false
114 - platform: gpio
115 name: "Relay 5"
116 id: relay_5
117 pin:
118 pca9554: mb_gpio_exp
119 number: 12
120 mode: OUTPUT
121 inverted: false
122
123# Enable inputs: button and discrete inputs
124binary_sensor:
125 - platform: gpio
126 name: "FN button"
127 pin:
128 number: 0
129 inverted: true
130 - platform: gpio
131 name: "Input 1"
132 pin:
133 pca9554: mb_gpio_exp
134 number: 0
135 inverted: false
136 - platform: gpio
137 name: "Input 2"
138 pin:
139 pca9554: mb_gpio_exp
140 number: 1
141 inverted: false
142 - platform: gpio
143 name: "Input 3"
144 pin:
145 pca9554: mb_gpio_exp
146 number: 2
147 inverted: false
148 - platform: gpio
149 name: "Input 4"
150 pin:
151 pca9554: mb_gpio_exp
152 number: 3
153 inverted: false
154 - platform: gpio
155 name: "Input 5"
156 pin:
157 pca9554: mb_gpio_exp
158 number: 4
159 inverted: false
160 - platform: gpio
161 name: "Input 6"
162 pin:
163 pca9554: mb_gpio_exp
164 number: 5
165 inverted: false
166
167# Enable 1-Wire bus on external connector
168one_wire:
169 - platform: gpio
170 pin: GPIO16
171
172## Configure individual sensors
173#sensor:
174# - platform: dallas_temp
175# address: 0x1c0000031edd2a28
176# name: "Livingroom Temperature"
Explanations
Note
This section describes explanations only for options that differ from the standard for the E1-CPU processor module.
Port expander
The JetHub E1-PD76-R5-[AC/DC] (v3) controller uses PCA9535 port expander chips. You can use the driver pca9554
:
# Enable I2C GPIO expanders
pca9554:
- id: cpu_gpio_exp
pin_count: 16
address: 0x20
- id: mb_gpio_exp
pin_count: 16
address: 0x22
Relay
The relays are connected to the port expander on the peripheral board.
Direct logic is used to control the relay:
# Enable digital outputs: LEDs and relays
switch:
- platform: gpio
name: "Relay 1"
id: relay_1
pin:
pca9554: mb_gpio_exp
number: 8
mode: OUTPUT
inverted: false
- platform: gpio
name: "Relay 2"
id: relay_2
pin:
pca9554: mb_gpio_exp
number: 9
mode: OUTPUT
inverted: false
- platform: gpio
name: "Relay 3"
id: relay_3
pin:
pca9554: mb_gpio_exp
number: 10
mode: OUTPUT
inverted: false
- platform: gpio
name: "Relay 4"
id: relay_4
pin:
pca9554: mb_gpio_exp
number: 11
mode: OUTPUT
inverted: false
- platform: gpio
name: "Relay 5"
id: relay_5
pin:
pca9554: mb_gpio_exp
number: 12
mode: OUTPUT
inverted: false
Note
When you change the state of the outputs, after some time (~40 sec) ESPHome automatically saves their state by default and after reboot restores the state of the outputs to the previously saved.
If this functionality is not needed, you must change this function by setting the output state at startup with the option restore_mode
, for example:
switch:
- platform: gpio
...
restore_mode: ALWAYS_OFF
...
Discrete inputs
The digital inputs are connected to the port expander on the peripheral board.
Example of a digital input configuration:
# Enable inputs: button and discrete inputs
binary_sensor:
- platform: gpio
name: "Input 1"
pin:
pca9554: mb_gpio_exp
number: 0
inverted: false
- platform: gpio
name: "Input 2"
pin:
pca9554: mb_gpio_exp
number: 1
inverted: false
- platform: gpio
name: "Input 3"
pin:
pca9554: mb_gpio_exp
number: 2
inverted: false
- platform: gpio
name: "Input 4"
pin:
pca9554: mb_gpio_exp
number: 3
inverted: false
- platform: gpio
name: "Input 5"
pin:
pca9554: mb_gpio_exp
number: 4
inverted: false
- platform: gpio
name: "Input 6"
pin:
pca9554: mb_gpio_exp
number: 5
inverted: false
1-Wire
The 1-Wire bus is connected to pin GPIO16
of the microcontroller.
Enable 1-Wire bus in the configuration file:
# Enable 1-Wire bus on external connector
one_wire:
- platform: gpio
Note
For each temperature sensor connected to the bus, you must add to the configuration file:
sensor:
- platform: onewire
address: 0x28XXXXXXXXXXXXXX
name: "Livingroom Temperature"
where 0x28XXXXXXXXXXXXXX
is the address of the temperature sensor.