I recently went to visit my parents who have one of my old Pi 3’s running OMV 5 for a local Plex server to allow them to stream music around the house. I thought this would be a good opportunity to entice them into the world of home automation.
This is by no means a comprehensive guide but it aims to outline the process for getting up and running (potentially on existing hardware). If possible, rather run Home Assistant (I think it was called Hass.io).
Part 1: Setting up Home Assistant Core and ESPHome in docker
- Assuming that Docker is installed. SSH into the Raspberry Pi and run the following command to pull and run the latest container, the only thing you need to change is the path to your config directory.
docker run --init -d --name="home-assistant" -e "TZ=Africa/Johannesburg" -v /PATH_TO_YOUR_CONFIG:/config --net=host homeassistant/raspberrypi3-homeassistant:stable
-
Head over to a web browser on your local machine and enter <your Pi’s IP>:8123 to setup Home Assistant.
-
I couldn’t find documentation on which version of ESPHome to run on a Pi without using the Python installer but this one worked for me. Follow the same approach as step 1:
docker run --init -d --name="ESPHome" -e "TZ= Africa/Johannesburg" -v /PATH_TO_YOUR_CONFIG:config --net=host esphome/esphome-armv7:latest
-
As you did in step 2, head over to <your Pi’s IP>:6052 in your web browser to setup and configure devices in ESPHome. NOTE: You do not need to setup the ESPHome integration in Home Assistant, devices will pop up in HA auto-magically - thanks HA team
-
Setup your device in ESPHome and download the .bin file. Save this for later.
Part 2: Time for the hardware, I bought a Sonoff R3 to give the DIY mode a try
-
Download and install the eWeLink app on your phone/tablet. I used a 10 minute mail account to sign up and login - them Chinese don’t need any more of my info.
-
Connect the Sonoff to AC power and add it to your eWeLink app
-
In the eWeLink app, go to Device Settings and update the Sonoff’s to the latest firmware (this should be v3.5). My Sonoff came with firmware v3.0.0 which resulted me pulling my hair our for about an hour. Please learn from my mistakes
-
Delete/reset the Sonoff from the eWeLink app
-
Disconnect the Sonoff from AC power (once again, learn from my mistakes), pop the cover off and connect the supplied jumper onto the J1 header, labelled “OTA_SW”.
Disclaimer: not my image. Thanks Tasmota team. -
Put the case back onto the Sonoff and connect it to AC power. Once it has booted, press and hold the button on the Sonoff until the blue light starts to blink rapidly
-
Connect to the Sonoff’s Access Point (named ITEAD-XXXXXXXX) with the password 12345678`
-
In your browser, go to http://10.10.7.1/ to enter your 2.4ghz WiFi network name and password. Your Sonoff will reboot and connect to your AP once this is complete.
-
Time to boot into Windows . Download the tool for flashing custom firmware from Sonoff’s github repo – https://github.com/itead/Sonoff_Devices_DIY_Tools/tree/master/tool. The tool is tool_01DIY85(3.3.0).exe which implies that it works with Sonoff firmware v3.3 but I had no problems getting it to work on v3.5.
-
Run the flashing tool, it should find your Sonoff. Click on the “Firmware Flash” button and select the .bin file that you created in ESPHome earlier. Select your Sonoff device, click “Flash Device List” and then hit “OK”. This will upload the firmware onto your Sonoff and reboot it once complete.
-
Head over to Home-Assistant where you should see you a notification for your new device. Follow the prompts to setup the device and you’re good to go!