Skip to main content
Device Type:relay
Electrical Standard:global
Board:esp8266
Difficulty:Disassembly required (3/5)

Sonoff POWR2

Product Images

A picture of the PCB inside of the Sonoff POWR2

GPIO Pinout

PinFunction
GPIO0Push Button (HIGH = off, LOW = on)
GPIO12Relay and its status LED
GPIO13Blue LED (HIGH = off, LOW = on)
GPIO1RX pin (for serial programming)
GPIO3TX pin (for serial programming)

Basic Configuration

As the only controllable LED is the Blue LED, it is configured here to use the status_led light component, which will take over the LED in the event of a error/warning state, such as when WiFi is disrupted.

# Basic Config
substitutions:
update_interval: 60s
name: "sonoff-pow-r2"
ota_password: "your_ota_password_here"

esphome:
name: "${name}"

esp8266:
board: esp01_1m

logger:
baud_rate: 0

# Enable Home Assistant API
api:

ota:
- platform: esphome
password: "${ota_password}"

wifi:
networks:
- ssid: !secret wifi_ssid
password: !secret wifi_password

uart:
rx_pin: RX
baud_rate: 4800
parity: EVEN

binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: Sonoff POW Button
on_press:
- switch.toggle: dummybutton

sensor:
- platform: cse7766
current:
name: "Sonoff Pow R2 Current"
filters:
- throttle_average: ${update_interval}
voltage:
name: "Sonoff Pow R2 Voltage"
filters:
- throttle_average: ${update_interval}
power:
name: "Sonoff Pow R2 Power"
filters:
- throttle_average: ${update_interval}
energy:
name: "Sonoff Pow R2 Energy"
filters:
- throttle: ${update_interval}
apparent_power:
name: "Sonoff Pow R2 Apparent Power"
filters:
- throttle_average: ${update_interval}
power_factor:
name: "Sonoff Pow R2 Power Factor"
filters:
- throttle_average: ${update_interval}

switch:
- platform: template
name: Sonoff POW Relay
optimistic: true
id: dummybutton
turn_on_action:
- switch.turn_on: relay
turn_off_action:
- switch.turn_off: relay
- platform: gpio
id: relay
pin: GPIO12

light:
- platform: status_led
name: Sonoff POW Blue LED
id: pow_blue_led
pin:
number: GPIO13
inverted: True