What is Sonoff-Tasmota?

Sonoff-Tasmota is an alternative open source firmware for ESP8266 based devices such as iTead SonoffAllterco Shelly and many, many more.

It provides local control, MQTT and integration with home automation systems such as openHAB, Home Assistant and Domoticz.

You may find more information on the official GitHub page

You may also find relevant information on Tasmota at

If you are starting out and wish to have a relatively easy experience in developing your projects, then try the build-in web interface.

4 Channel Switch

Example of Tasmota Web Interface
the Sonoff 4 Channel Pro MQTT Switch

hello, I got your sonoff basic with tasmota. How can I rest it to factory defaults ? thank you Nicola


On delivery it is already in factory reset state.

If you want to factory reset afterwords, check this link Tasmota Button Usage

Long press

When held continuously for 40 seconds (Configurable with SetOption32, value is 10x the configured hold time) Tasmota will reset to firmware defaults and restart.

Initial configuration of the Sonoff-Tasmota devices
  1. Power up the sonoff device. The device will create a WIFI access point with the name sonoff-xxx, where xxx is some number
  2. On your computer, change your wifi network to sonoff-xxxx and browse to
  3. Enter the details of your WIFI network and click save.
  4. The device will restart and get an IP address from your the DHCP server of your network.
  5. On your computer, change your wifi network back to your wifi network
  6. Use the Tasmota Device Locator or your router to find the IP address of the device.
  7. Browse to the IP address of the RF bridge.
  8. Go into "Configuration"
  9. Go into "Configure Module"
  10. Select Module Type, according to note below and press "Save". Now the RF Bridge is configured as such.
  11. To get to the main menu of the RF Bridge, browse to the IP address of the RF bridge.
  12. In "Configuration" it is now possible to specify MQTT and other parameters

Note: Values for configuration of module type

  • RF Switch: Sonoff RF 2
  • Temperature/Humidity monitor: Sonoff TH 4
  • Power Monitor: Sonoff Pow 6
  • S20 Smart switch: Sonoff S2x 8
  • RF Bridge: Sonoff Bridge 25
  • Smart Bulb: AiLight 27

For the temperature/humidity monitor, you also need to specify the sensor type, e.g. AM2301.

How do I configure MQTT with a Tasmota device?

You use the Tasmota WEB UI for configuration. Enable MQTT in "Configuration/Other" and then specify your setup in "Configuration/MQTT".

For more details see also

How do I configure a Tasmota devices with Home Assistant

There is a description of the integration with Home Assistant on the Tasmota site.

DrZzz has made some tutorials, which may be helpful (but skip the parts about flashing Tasmota).

General setup for tasmota is described at

For the RF Bridge there are some more specific instructions at

How can I locate my Sonoff Tasmota Device?

The device is given an address by a DHCP server or the WIFI router.

If you know the subnet address you can use the Tasmota Device Locater to search for the device. Else check with the router.

How to install and test the Tastmota MQTT Smart Bulb

The MQTT Smart Bulb shall be configured as an "AiLight (27)" module.

The installation is done as for any other Tasmota device. However you need to be extremely careful when setting up the Wifi network, since there are no button to do a factory reset. Wrong SSID or password and the bulb is bricked! See how you can configure wifi to enable factory reset below.

To control light, you will normally use MQTT, but to test the basic functionality, it is described how to do this with the web console interface below.


For installation follow the standard procedure.

When the basic installation is done and the module is configured as AiLight you should see the following screen in your web browser:

Test the Light

Using the Toggle button will switch the white light on and off.

To test the colors press the "Console" button and test the light.

You can experiment with the commands color and dimmer. The color parameters are red, green, blue and white. Values are between 0 and 255. The dimmer is percentage with values from 0 to 100.

  • color 255,0,0,0
  • color 0,255,0,0
  • color 0,0,255,0
  • color 0,0,0,255
  • dimmer 50

WifiConfig to Enable Factory Reset

The bulb can be configured to go into AP mode if it can not find the configured Wifi network.

Go into the console and give the command

  • wificonfig 7

With this configuration it will start up in AP mode if it can not find the configured Wifi network. It will expose the network name "sonoff-xxxx". Attach to the network and in your web browser go to to find the UI. Here you can do a "factory reset".

MQTT Setup

As a minumum configure MQTT host, user and password.

In the web browser UI go into "Configuration/Configure MQTT"

After configuring MQTT, the color command can be given on the topic cmnd/sonoff/color. E.g. to activate the green light publish the parameters 0,255,0,0

To get information from the device subscribe to "stat/sonoff/+"