Sonoff and Home Assistant (Best $5 light automation)
Sonoff in itself is a great outlet and can be use independently with the useful app. But to unlock its true potential, you can flash custom firmware and connect it to your Home Assistant configuration.
1. Install and configure Arduino IDE
- Arduino IDE is a tool that will allow you to modify and upload firmware to Sonoff
b) Go to Arduino IDE folder and create “portable” folder
2. Download and customise Sonoff Firmware
- This is how your Sonoff will communicate with Home Assistant. If you don’t have this installed (it takes 5 min) follow this guide from Ben
- In the same “user_config.h” file enter the IP address, port, username and password for MQTT server
2. Time to flash!
Disconnect from Mains!
- See picture on the right of how to find the hole in Sonoff and connection with FTDI
- On FTDI the correct holes will be annotated
- Notice that you need to cross connect TX and RX cables
3. Customise Shit out of it!
- If you entered your correct Wifi SSID and Password your sonoff will connect automatically
- Alternatively, you can use WPS to connect to wifi. To do it, press “WPS” on your router and press the button on outlet 5 times after you plugged it in. That is it.
- This is only needed if you want to change any config for your Sonoff
- Go to your router admin panel (usually 192.168.1.1) and go to attached devices or something similar.
- You will see one of the new devices which will have sonoff in its description
- Alternatively you can use any of the ip scanners in your phone.
- Go to your favourite browser and enter the IP address you just identified
- You will see the web interface where you can change settings including MQTT server details
- Go to your configuration.yaml file and enter the following code:
switch: - platform: mqtt name: "OneExtra" icon: mdi:camera command_topic: "cmnd/sonoff8/power" state_topic: "stat/sonoff8/POWER" qos: 1 payload_on: "ON" payload_off: "OFF" retain: trueextra
Was it helpful?
Please add your comments below so we can help you further or improve the content.