devices.esphome.io

Shelly Pro 2

Shelly Pro 2

Device Type: relay
Electrical Standard: euuk
Board: esp32

Information about the pinout and internals of the Shelly Pro 2.

It's the same board as the Shelly Pro 1. The only difference is the addition of a second relay.

Shelly Pro 2

Pinout

ESP32 DOWDQ6SN74HC595BLAN8720AComponent
GPIO 4RCLK
GPIO 13SER
GPIO 14SRCLK
GPIO 17CLKIN
GPIO 18MDIO
GPIO 19TXD0
GPIO 21TXEN
GPIO 22TXD1
GPIO 23MDC
GPIO 25RXD0
GPIO 26RXD1
GPIO 27CRS_DV
GPIO 35Reset Button
GPIO 36ADC Temperature
GPIO 38Switch input 1
GPIO 39Switch input 2

Shift register

A shift register is controlling the WIFI RGB LEDs and the 2 relays.

Shift Register

SN74HC595BComponent
QARelay 1 + Out 1 LED
QBRelay 2 + Out 2 LED
QCWIFI RGB LED (Blue)
QDWIFI RGB LED (Green)
QEWIFI RGB LED (Red)
QFNC
QGNC
QHNC

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. Turning on the relay turns the corresponding LED on.

The WIFI LED is an RGB LED. By turning each component on or off, you have access to 8 configurations:

RGBColor
000OFF
001Blue
010Green
011Cyan
100Red
101Magenta
110Yellow
111White

Programming Pinout

Shelly Pro pinout

Note that the pin pitch is 1.27mm, so standard 2.54mm Dupont cables won't work.

Basic Configuration

esphome:
name: shelly-pro-2
esp32:
board: esp32dev
framework:
type: arduino
logger:
api:
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: "Shelly-Pro-2"
password: "BzwFc7HsRihG"
# ethernet:
# type: LAN8720
# mdc_pin: GPIO23
# mdio_pin: GPIO18
# clk_mode: GPIO17_OUT
captive_portal:
button:
- platform: restart
id: restart_1
binary_sensor:
- platform: gpio
id: reset_button
pin:
number: 35
inverted: true
on_click:
min_length: 200ms
max_length: 1000ms
then:
button.press: restart_1
- platform: gpio
id: input1
pin:
number: 38
on_press:
then:
switch.toggle: relay1
- platform: gpio
id: input2
pin:
number: 39
on_press:
then:
switch.toggle: relay2
sensor:
- platform: adc
id: temp_voltage
pin: GPIO36
attenuation: auto
- platform: resistance
id: temp_resistance
sensor: temp_voltage
configuration: DOWNSTREAM
resistor: 10kOhm
- platform: ntc
sensor: temp_resistance
name: Temperature
unit_of_measurement: "°C"
accuracy_decimals: 1
icon: "mdi:thermometer"
calibration:
b_constant: 3350
reference_resistance: 10kOhm
reference_temperature: 298.15K
on_value_range:
- above: 90
then:
- switch.turn_off: relay1
- switch.turn_off: relay2
sn74hc595:
- id: 'sn74hc595_hub'
data_pin: GPIO13
clock_pin: GPIO14
latch_pin: GPIO4
sr_count: 1
switch:
- platform: gpio
name: "Relay 1"
id: relay1
pin:
sn74hc595: sn74hc595_hub
number: 0
inverted: false
- platform: gpio
name: "Relay 2"
id: relay2
pin:
sn74hc595: sn74hc595_hub
number: 1
inverted: false
- platform: gpio
id: wifi_led_blue
pin:
sn74hc595: sn74hc595_hub
number: 2
inverted: true
- platform: gpio
id: wifi_led_green
pin:
sn74hc595: sn74hc595_hub
number: 3
inverted: true
- platform: gpio
id: wifi_led_red
pin:
sn74hc595: sn74hc595_hub
number: 4
inverted: true
Edit this page on GitHub