Domoticz – Tasmota

Tasmota does support Domoticz MQTT out of the box for sensors and relays both.

To configure Domoticz and Tasmota, you must follow the procedure given below:


The following servers must be  available:

  1. Having installed/accessed an MQTT broker server and established a connection with the Tasmota device.
  2. Having installed Domoticz.

MQTT and Virtual Sensor

If you haven’t already configured Domoticz MQTT and Virtual Sensor hardware, follow this procedure:

  • Open the hardware page. There you must type –

MQTT Client Gateway with LAN interface.

  • Provide a suitable name.
  • Now, you will need to configure the interface with access to your MQTT server (Remote Address, Port, Username and Password).
  • After that, set the public topic to flat (which seems to relate to out in the select field).
  • Open the hardware page. There you must type –

Dummy (used for virtual switches).

  • Provide a name.

Virtual Switch

For creating a new virtual switch, use these steps. Make sure to remember its idx number.

  • To design a new virtual switch which you will be using with Sonoff, tap on Create Virtual Sensors.
  • Provide a suitable name. Select Sensor Type Switch.
  • Now go to the Device Page and search for the new switch with the name you have provided previously.
  • Remember its Idx number.

Tasmota Configuration

Tasmota allows several ways for configuring Domoticz. Let’s check them out.

  • Use the webinterface and select Configuration – Configure Domoticz:
    • Set In topic to domoticz/in as hardcoded in Domoticz
    • Set Out topic to domoticz/out as hardcoded in Domoticz
    • Configure Idx 1 to the value read in step 2.i
  • Use MQTT and execute commands (if necessary, replace tasmota with unique topic you configured in Initital Configuration, see point 5 there)
    • cmnd/tasmota/DzInTopic with payload domoticz/in as hardcoded in Domoticz
    • cmnd/tasmota/DzOutTopic with payload domoticz/out as hardcoded in Domoticz.
    • cmnd/tasmota/DzIdx1 with payload value read in step 2.i
  • Use the serial interface and execute commands:
    • DzInTopic with domoticz/in as hardcoded in Domoticz
    • DzOutTopic with domoticz/out as hardcoded in Domoticz
    • DzIdx1 with the value read in step 2.i


Those were all the steps you needed to follow to be able to control your device from the Domoticz user interface.

  • Go to the Switches page and then scroll down to search for your switch as configured in step 1.
  • Tasmota should respond when you toggle the light bulb.

Automatic Discovery

Tasmota allows automatic discovery by Domoticz through the Domoticz MQTT Discovery plugin.


The following services should be made available:

  • You have access or have installed a MQTT broker server. Plus, you made contact with your sonoff.
  • Domoticz is installed.
  • The Domoticz MQTT Discovery plugin is also installed.

MQTT Discovery Plugin

Configure Domoticz MQTT Discovery plugin.

  • Visit the hardware page and Type MQTT Discovery.
  • Provide a name, e.g. Tasmota.
  • Configure the interface with access to your MQTT server (MQTT Server Address, Port, Username and Password).
  • Now, change the Discovery topic to homeassistant unless it has been changed in a custom Tasmota build.
  • At last, change the Ignored device topic to /tasmota/ to avoid unconfigured Tasmota devices from being discovered.

Tasmota Configuration

Precompiled Binary:

  • Every Tasmota device needs to have its own topic. The quickest way is to set topic to tasmota_%06X (%06X will be replaced by MAC address). See here for how to set the topic.
  • Use MQTT or Serial or Web console and execute commands (replace %topic% with the device’s unique topic).
  • cmnd/%topic%/SetOption19 with payload 1 to enable MQTT discovery.

Custom Binary

  • The settings mentioned above can be defined in user_config_override.h (TBD)


  • That’s it! You are now able to find your Sonoff in the Domoticz user interface.
  • On the Switches page scroll down and find your Switch as configured in step 1.
  • Toggle the light bulb so that Sonoff can respond.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top