Welcome to our Knowledge Base
Sonoff Switch – Tasmota Conversion
Prepare Software Environment
- Download latest tasmota software
- Copy Sonoff.bin to local directory of choosing
- Download ESP Easy Tools
- Download ESP easy mega zip
- Copy these to files to same directory as sonoff.bin
- FlashESP8266.exe
- ESPTool.exe
- Download Termite terminal Software
Flash the sonoff hardware
Sonoff Basic, POW and TH Hardware Prep
- https://github.com/arendst/Sonoff-Tasmota/wiki/Hardware-Preparation
- Hold the reset button while plugging in the device on USB
- Look at what COM port the USB is using in Device Manager
- Run FlashESP8266.exe and to COM port above
- Unplug and replug the device to reboot
- Run
termite,
- set
preferences
- COM port above
- Baud rate 11200
- Establish
Network Connection
- ssid1 {SSID}
- password1 {NETWORKPASSWORD}
- Take note of IP Address
- set
preferences
- Reserve IP address on router
- Navigate to Device home page http://IPADDRESS above and configure
Sonoff Basic Hardware Prep
- https://www.superhouse.tv/21-six-sonoff-secrets/
- Note: Some basics have an issue described
here:
https://github.com/arendst/Sonoff-Tasmota/issues/162
Sonoff Dual Hardware Prep
- In addition to the steps above, the Sonos Dual (Only use R2 or later) requires the Button0 to be shorted to the GND during flash.
Sonoff TH16 Hardware Prep
- Below is the thermometer mapping
- https://www.youtube.com/watch?v=erGh0Eca-hc
Add Tasmota devices to Home Assistant
To ease Home Assistant
configuration a feature called MQTT discovery is
available. (warning: this feature is not included in sonoff-basic.bin and sonoff-classic.bin)
With MQTT discovery, no user interaction or configuration file edit is needed
to add new devices to Hass.
For other type of devices, e.g iFan02, example entries for configuration.yaml is available in Home Assistant – Manual Config
On each Tasmota device which should be automatically discovered by Hass, enter the following commands in the web console:
SetOption19 1– Enables MQTT discovery\
By executing
command SetOption19 1 the automatic discovery feature is enabled and a retained
MQTT message starting with topic “homeassistant/..”, as defined in
user_config.h HOME_ASSISTANT_DISCOVERY_PREFIX, is sent containing parameters
used by Home Assistant to automatically configure a device.
To disable the
automatic discovery feature and remove the retained message, execute
command SetOption19 0 and the homeassistant topic is removed from the MQTT
server.
Note: This will also remove the device from Home Assistant.
Important:
To keep MQTT discovery
messages short, “base topic” feature is used.
This feature is not compatible with the default Tasmota topic prefix/topic/COMMAND, e.g. cmnd/sonoff/POWER
The topic will automatically be changed to topic/prefix/COMMAND, e.g. sonoff/cmnd/POWER
If you want to use a custom fulltopic, it MUST end with %prefix%/ or it will be
overwritten with topic/prefix/COMMAND.
This is an example of an allowed fulltopic: tasmota/%topic%/%prefix%/.
For SONOFF Dual
Configure as DUAL R2 in configuration Module and save
Return to configuration module and set GPIO1 as switch 01 and GPIO9 and switch 09
In
console enter seriallog0 #eliminate interferrance
For Sonoff TH16
Return to configuration module and set GPIO14 (Sensor) to Si7021
Itead
SI7021 Temperature and Humidity – SI7021 (3) in
group
Set SetOption19 1 #home assistant auto
discovery
SetOption8 1 #to set update Fahrenheit
Set TelePeriod 60 #to set update frequency in seconds
Setup Tasmota devices through Home Assistant
All automatically discovered entities will show up under:
Configuration -> Integrations -> Configured -> MQTT
The entities are grouped by hardware, example for a Sonoff T1 2CH:
References
- https://github.com/arendst/Sonoff-Tasmota/wiki/Tutorials
Video Tutorials for Tasmota and Home Automation
- SuperHouseTV – Sonoff Tasmota installation and configuration tutorial
- DrZzs – Great and Easy Tasmota related Videos
- Super House – Home Automation Tutorials
- The Hook Up – Home Automation Tutorials
- BRUH Automation – Home Automation Tutorials
- Burns Home Automation – Home Automation Tutorials
- Step to Step Tutorials – Hobbytronics Tutorials
- DigiblurDIY – Great and Easy Tasmota related Videos
Initial Configuration
- Connect to (AC) power (Serial NOT connected)
- If your WiFi was not set prior compile as described in Upload section, configure Wifi by using one of the provided configuration modes: Button Usage or use WPS if your router supports it.
- Connect to the device webpage (http://[sonoff-ip]/cn) NOTE: Replace [sonoff-ip] with actual IP address of your Sonoff device.
- Select the correct module type from the configuration frontend. If your device is not listed, a user contributed device template (explanation) may be available. If a template is not available, follow the procedure for configuring new devices.
- Configure the MQTT broker connection, choose a unique topic, e.g. “sonoff-kitchenlight”
- Test communication with the MQTT client of your choice
- Integrate with the Control interface or home automation solution of your choice
- Test your device for some time at the intended maximum intensity, check for overheating and if necessary, apply some limits in your home automation solution.