How to setup Sonoff Pow R1 for ESPHome
![](https://blog.smarterhome.my/media/posts/23/sonoff-pow-esphome.jpg)
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
- First, go to ESPHome Dashboard in your Windows PC browser.
![](https://blog.smarterhome.my/media/posts/23/2022-02-25_190624.png)
![](https://blog.smarterhome.my/media/posts/23/2022-02-23_124845.png)
![](https://blog.smarterhome.my/media/posts/23/2022-02-23_124936.png)
![](https://blog.smarterhome.my/media/posts/23/2022-02-23_125011.png)
![](https://blog.smarterhome.my/media/posts/23/2022-02-23_125108.png)
![](https://blog.smarterhome.my/media/posts/23/2022-02-23_131206.png)
8. Copy and paste this into the editor…
esphome:
name: sonoffpowbedroomtv # <= Change this
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
password: !secret api_password
ota:
password: !secret ota_password
wifi:
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
ap:
ssid: "Sonoffpowbedroomtv" # <= Change this
password: "xxxxxxx"
captive_portal:
binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode:
input: true
pullup: true
inverted: true
name: "Sonoff Pow Bedroom TV Button" # <= Change this
- platform: status
name: "Sonoff Pow Bedroom TV Status" # <= Change this
switch:
- platform: gpio
name: "Sonoff Pow Bedroom TV Relay" # <= Change this
pin: GPIO12
output:
# Register the blue LED as a dimmable output ....
- platform: esp8266_pwm
id: blue_led
pin: GPIO15
inverted: false
light:
# ... and then make a light out of it.
- platform: monochromatic
name: "Sonoff Pow Bedroom TV Blue LED" # <= Change this
output: blue_led
sensor:
- platform: hlw8012
sel_pin: 5
cf_pin: 14
cf1_pin: 13
current:
name: "Sonoff Pow Bedroom TV Current" # <= Change this
voltage:
name: "Sonoff Pow Bedroom TV Voltage" # <= Change this
power:
name: "Sonoff Pow Bedroom TV Power" # <= Change this
energy:
name: "Sonoff Pow Bedroom TV Energy" # <= Change this
update_interval: 10s
![](https://blog.smarterhome.my/media/posts/23/2022-02-23_132221.png)
![](https://blog.smarterhome.my/media/posts/23/2022-02-23_125144.png)
![](https://blog.smarterhome.my/media/posts/23/2022-02-23_125233.png)
![](https://blog.smarterhome.my/media/posts/23/2022-02-23_125440.png)
![](https://blog.smarterhome.my/media/posts/23/photo6100541671902130081-1024x576.jpg)
![](https://blog.smarterhome.my/media/posts/23/photo6100541671902130082-576x1024.jpg)
14. Press and hold the switch button and plug in the FTDI to your computer USB port. Release button after plug in.
![](https://blog.smarterhome.my/media/posts/23/2022-02-23_130008.png)
![](https://blog.smarterhome.my/media/posts/23/2022-02-23_130220.png)
![](https://blog.smarterhome.my/media/posts/23/2022-02-23_130346.png)
![](https://blog.smarterhome.my/media/posts/23/2022-02-23_130432.png)
![](https://blog.smarterhome.my/media/posts/23/2022-02-23_130600.png)
![](https://blog.smarterhome.my/media/posts/23/2022-02-23_130648-1.png)
![](https://blog.smarterhome.my/media/posts/23/2022-02-23_133715.png)
![](https://blog.smarterhome.my/media/posts/23/2022-02-23_133908.png)
![](https://blog.smarterhome.my/media/posts/23/2022-02-23_133959.png)
![](https://blog.smarterhome.my/media/posts/23/2022-02-23_134038.png)
![](https://blog.smarterhome.my/media/posts/23/2022-02-23_134134.png)
![](https://blog.smarterhome.my/media/posts/23/2022-02-23_134226.png)
It's done. You should see 8 new entities created in your Home Assistant.
Comments