How-To Guides

How to setup Sonoff Pow R1 for ESPHome

I have some old Sonoff Pow (version 1) smart DIY switches in my home that I wish to repurpose them using ESPHome. Here is the guide on how I flash ESPHome firmware into my Sonoff Pow smart switches.

Here are the stuffs I used in this guide...

  • Sonoff POW R1 switches
  • ESPHome Dashboard. Mine is running on Docker in Synology NAS.
  • FTDI Friend from Adafruit to connect Sonoff POW to my PC via USB.
  • Windows PC

  1. First, go to ESPHome Dashboard in your Windows PC browser.

2. Click "+ NEW DEVICE" button at the bottom right corner.


4. Enter a unique name and click Next

5. Select ESP8266 and click Next

6. Click SKIP

7. Click the EDIT button

8. Copy and paste this into the editor…

  name: sonoffpowbedroomtv # <= Change this

  board: esp01_1m

# Enable logging

# Enable Home Assistant API
  password: !secret api_password

  password: !secret ota_password

  ssid: !secret wifi_ssid
  password: !secret wifi_password
  fast_connect: true # Required for hidden SSID

  # Enable fallback hotspot (captive portal) in case wifi connection fails
    ssid: "Sonoffpowbedroomtv" # <= Change this
    password: "xxxxxxx"


  - platform: gpio
      number: GPIO0
        input: true
        pullup: true
      inverted: true
    name: "Sonoff Pow Bedroom TV Button" # <= Change this
  - platform: status
    name: "Sonoff Pow Bedroom TV Status" # <= Change this

  - platform: gpio
    name: "Sonoff Pow Bedroom TV Relay" # <= Change this
    pin: GPIO12

  # Register the blue LED as a dimmable output ....
  - platform: esp8266_pwm
    id: blue_led
    pin: GPIO15
    inverted: false

  # ... and then make a light out of it.
  - platform: monochromatic
    name: "Sonoff Pow Bedroom TV Blue LED" # <= Change this
    output: blue_led

  - platform: hlw8012
    sel_pin: 5
    cf_pin: 14
    cf1_pin: 13
      name: "Sonoff Pow Bedroom TV Current" # <= Change this
      name: "Sonoff Pow Bedroom TV Voltage" # <= Change this
      name: "Sonoff Pow Bedroom TV Power" # <= Change this
      name: "Sonoff Pow Bedroom TV Energy" # <= Change this
    update_interval: 10s

9. Click Install

10. Select "Plug into this computer"

11. Wait for "preparing download" to complete.

12. Click the "Download project" link and save the generated ".bin" file to your computer.

13. Connect 3.3V FTDI module to Sonoff Pow R1 like this

14. Press and hold the switch button and plug in the FTDI to your computer USB port. Release button after plug in.

15. Go to using Microsoft Edge browser.

16. Press CONNECT and select the correct USB port.

17. Click INSTALL button

18. Choose the ".bin" file from step 12 and click INSTALL.

19. Wait for the installation to finish.

20. Installation done.

21. Unplug everything and reconnect the power cables and then power up the Sonoff POW. It should connect to the WiFi and status becomes ONLINE in the dashboard.

22. Next, go to your Home Assistant. You should see a notification in there. Click Check it out.

23. Click Configure

24. Click Submit

25. Enter the API password set in ESPHome and click Submit

26. Select the area for this device and click Finish.

It's done. You should see 8 new entities created in your Home Assistant.