
ESPEasy and Domoticz share a long history. In the early years of the firmware, Domoticz was one of the platforms it was designed around, and the two still work together comfortably today. Sensor readings flow from the board into Domoticz devices, and switches on the Domoticz dashboard can control relays on the board.
This article explains the two main ways to connect them, through HTTP or through MQTT, and walks through creating devices, linking them with IDX values and resolving common problems.
Two Controllers for Domoticz
The firmware includes two controllers designed specifically for Domoticz. The Domoticz HTTP controller, numbered C001, sends readings directly to the Domoticz web server. The Domoticz MQTT controller, numbered C002, exchanges messages through an MQTT broker using the topics that Domoticz expects.
Both approaches work well, and the choice depends on your setup. HTTP is the simplest to configure because it needs nothing beyond Domoticz itself. MQTT requires a broker but offers better support for two-way communication and scales more gracefully as the number of devices grows.
Understanding IDX Values
Domoticz identifies every device by a number called its IDX. When the board sends a temperature reading, it must include the IDX of the Domoticz device that should receive it. Without the correct IDX, the reading has nowhere to go.
This is the single most important concept in the integration. Each task on the board that sends data to Domoticz needs an IDX, and each IDX must belong to a Domoticz device of a compatible type. A temperature and humidity task, for example, should point to a temperature and humidity device rather than a plain temperature device.
Creating Virtual Devices in Domoticz
Before configuring the board, create the devices in Domoticz that will receive its readings.
Open the Hardware page in Domoticz and add a new hardware entry of the Dummy type, giving it a clear name such as ESP Nodes. Once it is created, a button appears allowing you to create virtual sensors. Choose the sensor type that matches your data, such as temperature, temperature and humidity, or switch, and give it a name.
After creating the device, open the Devices page and note its IDX number from the list. Repeat the process for every reading or switch you plan to connect.
Setting Up the HTTP Controller
On the board, open the Controllers tab and select an empty slot. Choose the Domoticz HTTP protocol and enter the details of your Domoticz server:
- The IP address of the machine running Domoticz.
- The port, which defaults to 8080 for Domoticz's web server.
- A user name and password, if your Domoticz installation requires authentication.
Enable the controller and submit. Then open each task that should send data, tick the box for the Domoticz controller and enter the IDX of the matching Domoticz device. Save the task.
Within a minute or so, depending on the task interval, the Domoticz device should update with the latest reading. Its last-seen time on the Devices page confirms that data is arriving.
Setting Up the MQTT Controller
The MQTT approach requires an MQTT broker. Domoticz does not include one, but Mosquitto can be installed easily on the same machine, which is often a Raspberry Pi.
In Domoticz, add a new hardware entry of the type MQTT Client Gateway with LAN interface, and point it at your broker. This tells Domoticz to listen for messages and to publish updates.
On the board, choose the Domoticz MQTT controller in an empty slot. Enter the broker's address, port and credentials. The controller uses the topics domoticz/in for messages sent to Domoticz and domoticz/out for updates published by Domoticz. In most cases these defaults should be left unchanged, because Domoticz expects them.
As with the HTTP controller, tick the controller box in each task and enter the appropriate IDX.
Controlling Switches From Domoticz
Sending readings is only half of the integration. Domoticz can also control outputs on the board, such as relays.
With the MQTT controller, this works naturally. When you toggle a switch in Domoticz, it publishes the change on domoticz/out, and the board receives it. A switch input task on the board, linked to the same IDX as the Domoticz switch, keeps both sides in step.
With the HTTP controller, Domoticz can send commands to the board by calling its web interface. In the Domoticz switch settings, the on and off actions can be set to URLs that call the board's command endpoint, for example to set a GPIO pin high or low. This approach is straightforward but less elegant than MQTT, especially when the board needs to report changes made locally.
Combining Domoticz With Local Rules
Rules on the board complement Domoticz well. A rule can react to a physical button immediately, switching a relay without waiting for a server, while the controller keeps Domoticz informed of the new state. If Domoticz becomes unavailable, the local behaviour continues to work.
This division of responsibility suits most installations. Domoticz provides dashboards, history graphs, notifications and cross-device automation, while each board handles the immediate, local decisions that should never depend on a network connection.
Choosing the Right Device Types
Domoticz offers many device types, and choosing the correct one avoids confusing results. Some useful pairings include:
- DHT22 or BME280 readings with temperature and humidity devices, or temperature, humidity and barometer devices for the BME280.
- Analogue readings, such as light levels or soil moisture, with custom sensor or percentage devices.
- Pulse counters, such as water or gas meters, with counter devices.
- Relay outputs with light or switch devices.
When a task sends several values, check that the Domoticz device type accepts the same number and order of values. A mismatch usually results in only part of the data appearing.
Troubleshooting the Integration
- Readings never arrive: confirm the IDX in the task matches the device in Domoticz, and check the controller's IP address and port.
- Values appear in the wrong device: two tasks may share the same IDX by mistake.
- Only one value of several appears: the Domoticz device type may not match the number of values the task sends.
- Switches do not respond: with MQTT, confirm the MQTT gateway is connected in Domoticz; with HTTP, check the command URLs.
- Authentication errors: make sure the credentials on the controller match a Domoticz user, or allow local networks without authentication in the Domoticz settings.
The log on the board's Tools tab is invaluable here. It shows each attempt to send data, along with any error returned by the server or broker.
When to Choose HTTP or MQTT
Choose HTTP when you have a small number of sensors, no existing MQTT broker and mostly one-way data. Choose MQTT when you already run a broker, need reliable two-way control or plan to share the same data with other systems such as Node-RED or Home Assistant. Many people start with HTTP and move to MQTT as their installation grows.
Planning a Tidy Domoticz Installation
As the number of nodes grows, a little organisation keeps Domoticz manageable. Give each virtual device a name that combines its location and measurement, such as Greenhouse Temperature or Garage Door, so that dashboards and logs remain readable. Use Domoticz room plans to group devices by area, and keep a simple record of which board and task feeds each IDX.
That record proves its worth when a board is replaced or reconfigured. Because the link between a task and a Domoticz device depends entirely on the IDX, a replacement board configured with the same IDX values continues to feed the same devices, preserving their history and any automations that depend on them.
It also helps to keep the unit names on each board consistent with the device names in Domoticz. When the log on a board mentions a task, you can immediately find its counterpart in the dashboard, and the reverse.
Domoticz and Other Platforms Together
Many installations eventually use more than one platform. Because each node can run up to three controllers, a board can send readings to Domoticz while also publishing them to an MQTT broker for Node-RED, Home Assistant or a database. Each controller has its own settings, and each task chooses which controllers receive its values.
Running platforms side by side is also a convenient way to migrate gradually. You can add a second controller to existing nodes, build dashboards and automations on the new platform and only remove the old controller once everything works as expected. Because the board's local rules continue to run regardless of the controllers, the essential behaviour of each device stays the same throughout the transition.
Testing each new device on its own before adding the next one is a habit worth forming. Create a single virtual sensor, link one task to it and confirm that readings arrive with the expected values and units. Only then move on to the next sensor or switch. This step-by-step approach makes it obvious which change caused a problem, rather than leaving you to untangle several new devices at once when something does not appear as intended.
Frequently Asked Questions
Does ESPEasy still work with Domoticz?
Yes. The firmware includes dedicated Domoticz HTTP and Domoticz MQTT controllers that remain part of the standard set.
What is an IDX value?
It is the number Domoticz uses to identify each device. Every task that sends data to Domoticz must include the IDX of the device that should receive it.
Which port does the Domoticz HTTP controller use?
It uses port 8080 by default, which matches Domoticz's standard web server port.
Do I need an MQTT broker for Domoticz?
Only if you use the MQTT controller. The HTTP controller communicates directly with Domoticz without a broker.
How do I find a device's IDX?
Open the Devices page in Domoticz. Each device in the list shows its IDX number.
Why does only part of my sensor data appear?
The Domoticz device type probably does not match the values the task sends. Choose a device type that accepts the same set of readings.
Conclusion
ESPEasy and Domoticz remain a dependable pairing. Create virtual devices in Domoticz, note their IDX values and link each task through either the HTTP or MQTT controller. Start with HTTP for simplicity, move to MQTT when two-way control matters, and keep time-critical behaviour in local rules. The result is a monitoring and control system that is easy to extend, one board at a time.