@@ -8,52 +8,57 @@ board: esp32
8
8
9
9
Information about the pinout and internals of the Shelly Pro 2.
10
10
11
- It's the same board as the Shelly Pro 1. The only difference is the addition of a second relay.
11
+ It's the same board as the [ Shelly Pro 1] ( Shelly-Pro-1 ) . The only
12
+ difference is the addition of a second relay.
12
13
13
14
![ Shelly Pro 2] ( shelly-pro-2.jpg )
14
15
15
16
## Pinout
16
17
17
- ESP32 DOWDQ6| SN74HC595B | LAN8720A | Component
18
- ------------|------------|----------|----------
19
- GPIO 4 |RCLK | |
20
- GPIO 13 |SER | |
21
- GPIO 14 |SRCLK | |
22
- GPIO 17 | |CLKIN |
23
- GPIO 18 | |MDIO |
24
- GPIO 19 | |TXD0 |
25
- GPIO 21 | |TXEN |
26
- GPIO 22 | |TXD1 |
27
- GPIO 23 | |MDC |
28
- GPIO 25 | |RXD0 |
29
- GPIO 26 | |RXD1 |
30
- GPIO 27 | |CRS_DV |
31
- GPIO 35 | | |Reset Button
32
- GPIO 36 | | |ADC Temperature
33
- GPIO 38 | | |Switch input 1
34
- GPIO 39 | | |Switch input 2
18
+ ESP32 DOWDQ6 | Component
19
+ -------------|-----------
20
+ GPIO 4 |SN74HC595B SPI CS
21
+ GPIO 12 |SPI MISO
22
+ GPIO 13 |SPI MOSI
23
+ GPIO 14 |SPI CLK
24
+ GPIO 17 |LAN8720A CLKIN
25
+ GPIO 18 |LAN8720A MDIO
26
+ GPIO 19 |LAN8720A TXD0
27
+ GPIO 21 |LAN8720A TXEN
28
+ GPIO 22 |LAN8720A TXD1
29
+ GPIO 23 |LAN8720A MDC
30
+ GPIO 25 |LAN8720A RXD0
31
+ GPIO 26 |LAN8720A RXD1
32
+ GPIO 27 |LAN8720A CRS_DV
33
+ GPIO 35 |Reset Button
34
+ GPIO 36 |ADC Temperature 1
35
+ GPIO 37 |ADC Temperature 2
36
+ GPIO 38 |Switch input 1
37
+ GPIO 39 |Switch input 2
35
38
36
39
## Shift register
37
40
38
41
A shift register is controlling the WIFI RGB LEDs and the 2 relays.
39
42
40
43
![ Shift Register] ( shift-register.jpg )
41
44
42
- SN74HC595B| Component
43
- ----------|----------
44
- QA |Relay 1 + Out 1 LED
45
- QB |Relay 2 + Out 2 LED
46
- QC |WIFI RGB LED (Blue)
47
- QD |WIFI RGB LED (Green)
48
- QE |WIFI RGB LED (Red)
49
- QF |NC
50
- QG |NC
51
- QH |NC
45
+ SN74HC595B | Component
46
+ ----------- |----------
47
+ QA |Relay 1 + Out 1 LED
48
+ QB |Relay 2 + Out 2 LED
49
+ QC |WIFI RGB LED (Blue)
50
+ QD |WIFI RGB LED (Green)
51
+ QE |WIFI RGB LED (Red)
52
+ QF |NC
53
+ QG |NC
54
+ QH |NC
52
55
53
- The Out 1 status LED and the relay 1 are on the same output. The same is true for the Out 2 status LED and the relay 2.
54
- Turning on the relay turns the corresponding LED on.
56
+ The Out 1 status LED and the relay 1 are on the same output. The same is true
57
+ for the Out 2 status LED and the relay 2. Turning on the relay turns the
58
+ corresponding LED on.
55
59
56
- The WIFI LED is an RGB LED. By turning each component on or off, you have access to 8 configurations:
60
+ The WIFI LED is an RGB LED. By turning each component on or off, you have
61
+ access to 8 configurations:
57
62
58
63
R|G|B| Color
59
64
-|-|-|-------
@@ -75,7 +80,6 @@ Note that the pin pitch is 1.27mm, so standard 2.54mm Dupont cables won't work.
75
80
## Basic Configuration
76
81
77
82
``` yaml
78
-
79
83
esphome :
80
84
name : shelly-pro-2
81
85
@@ -90,7 +94,7 @@ logger:
90
94
api :
91
95
92
96
ota :
93
-
97
+ platform : esphome
94
98
95
99
wifi :
96
100
ssid : !secret wifi_ssid
@@ -108,21 +112,29 @@ wifi:
108
112
109
113
captive_portal :
110
114
115
+ spi :
116
+ clk_pin : GPIO14
117
+ mosi_pin : GPIO13
118
+ miso_pin :
119
+ number : GPIO12
120
+ ignore_strapping_warning : true
121
+
111
122
button :
123
+ - platform : shutdown
124
+ id : do_shutdown
112
125
- platform : restart
113
- id : restart_1
126
+ name : " Restart"
127
+ id : do_restart
114
128
115
129
binary_sensor :
116
130
- platform : gpio
117
131
id : reset_button
118
132
pin :
119
133
number : 35
120
134
inverted : true
121
- on_click :
122
- min_length : 200ms
123
- max_length : 1000ms
135
+ on_release :
124
136
then :
125
- button.press : restart_1
137
+ button.press : do_restart
126
138
127
139
- platform : gpio
128
140
id : input1
@@ -142,17 +154,43 @@ binary_sensor:
142
154
143
155
sensor :
144
156
- platform : adc
145
- id : temp_voltage
157
+ id : temp_voltage1
146
158
pin : GPIO36
147
159
attenuation : auto
148
160
- platform : resistance
149
- id : temp_resistance
150
- sensor : temp_voltage
161
+ id : temp_resistance1
162
+ sensor : temp_voltage1
163
+ configuration : DOWNSTREAM
164
+ resistor : 10kOhm
165
+ - platform : ntc
166
+ sensor : temp_resistance1
167
+ name : Temperature 1
168
+ unit_of_measurement : " °C"
169
+ accuracy_decimals : 1
170
+ icon : " mdi:thermometer"
171
+ calibration :
172
+ b_constant : 3350
173
+ reference_resistance : 10kOhm
174
+ reference_temperature : 298.15K
175
+ on_value_range :
176
+ - above : 90
177
+ then :
178
+ - switch.turn_off : relay1
179
+ - switch.turn_off : relay2
180
+ - button.press : do_shutdown
181
+
182
+ - platform : adc
183
+ id : temp_voltage2
184
+ pin : GPIO37
185
+ attenuation : auto
186
+ - platform : resistance
187
+ id : temp_resistance2
188
+ sensor : temp_voltage2
151
189
configuration : DOWNSTREAM
152
190
resistor : 10kOhm
153
191
- platform : ntc
154
- sensor : temp_resistance
155
- name : Temperature
192
+ sensor : temp_resistance2
193
+ name : Temperature 2
156
194
unit_of_measurement : " °C"
157
195
accuracy_decimals : 1
158
196
icon : " mdi:thermometer"
@@ -165,11 +203,11 @@ sensor:
165
203
then :
166
204
- switch.turn_off : relay1
167
205
- switch.turn_off : relay2
206
+ - button.press : do_shutdown
168
207
169
208
sn74hc595 :
170
209
- id : ' sn74hc595_hub'
171
- data_pin : GPIO13
172
- clock_pin : GPIO14
210
+ type : spi
173
211
latch_pin : GPIO4
174
212
sr_count : 1
175
213
0 commit comments