YAML for Sonoff POWR2

Hi all,

I am habitually lazy, and couldn’t find an example YAML for the Sonoff POWR2. So for anyone who is also habitually lazy, here is my YAML.


esphome:
  name: son033-dishwasher
  platform: ESP8266
  board: esp01_1m

# Enable logging
logger:
  baud_rate: 0

# Enable Home Assistant API
api:

ota:
  password: "(autogenerated)"

wifi:
  ssid: "Your_WiFi"
  password: "Your_password"

  manual_ip:
    static_ip: 192.168.1.XXX
    gateway: 192.168.1.1
    subnet: 255.255.255.0

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Son033-Dishwasher"
    password: "(autogenerated)"

captive_portal:

uart:
  rx_pin: RX
  baud_rate: 4800

sensor:
  - platform: cse7766
    current:
      name: "Dishwasher Current"
    voltage:
      name: "Dishwasher Voltage"
    power:
      name: "Dishwasher Power"
      
binary_sensor:
  - platform: gpio
    id: bttn
    pin:
      number: GPIO0
      mode: INPUT_PULLUP
      inverted: True
    on_press:
      - switch.toggle: relay

switch:
  - platform: gpio
    name: "Dishwasher"
    pin: GPIO12
    id: relay

3 Likes

Well, basic example is HERE, you just need to add switch definition. It’s pretty much what you have, though…