A friend of mine recently introduced me to the Sonoff switches – affordable, easy to use AND RE-programmable ! [Thanks Cliff ;-)]
I got the Sonoff Dual switch, which allows you to switch 2 separate appliances/devices from 1 Wifi switch.
Anyways, to get going I decided to flash it with the Sonoff-Tasmota firmware (as I wanted to be able to pull it into my Home Assistant setup easily)
The instructions on the Tasmota-Sonoff Wiki is fairly easy to follow and although they suggest you use a wired 3.3V FTDI USB-to-Serial Converter/Programmer (or a Raspberry Pi) – I also noticed you can use Wifi to update the firmware Over-The-Air !
There are a couple of ways to get SonOTA working:
- Using the Windows pre-built .EXE (you can find it here)
- I used this as a 1st pass for the 1st Sonoff Dual switch I flashed with the firmware
- This is a quick & dirty way – but it CAN work & there’s nothing wrong with this 🙂
- Installing the SonOTA software on your machine & customising it as you need (this involves installing Python 3, etc. on your local machine)
- Here you can customise some of the setting beforehand
- I left all vanilla & it still worked fine 🙂
Once you have SonOTA on your machine, you can run it and follow the instructions on-screen.
The process involves:
- Running SonOTA (./sonota.py)
- Confirming the configuration of you local machine to ensure you have all the required bits in place
- Putting your Sonoff in Access Point (AP) mode [holding the button in for more than 7 seconds] and then connecting to the ITEAD-* wifi network
- Installing a small base firmware uploader
- The Sonoff will then connect to you local machine to get the actual firmware installed
- Just be patient and things will happen 🙂
- Once installed, you will go into “FinalStage” mode
- Here you connect to the Sonoff [wifi now called FinalStage] and configure it to be able to connect to your wifi network
- Once configured, it will reboot and join your wifi
- Then you have to check your router /DHCP server to make sure your Sonoff’s IP address gets reserved (to make sure it doesn’t change on power loss / reboot)
Upgrading your Sonoff to the latest Tasmota Firmware
The SonOTA tool flashes a version of Tasmota which may be outdated (you CAN update the config manually, but why worry ? :-))
So once you have your Sonoff on your wifi network, you can connect directly to it and select the “Firmware Upgrade” option
Get the latest Sonoff-Tasmota firmware release here [select the .bin version which is applicable to you, normally just sonoff.bin]
Upload it and wait for the Sonoff to reboot with the latest version.
Great – Now you’re SET !
- Connect your Sonoff to the device / devices you want to control & get going !
- Integrate into Home Assitant
Have fun !