Configuration for Domoticz
With MQTT Autodiscovery you get ALL parameters into Domoticz with the native ‘MQTT Client Gateway with LAN interface’ hardware module.
Although still a bit in beta, Home Assistant MQTT Autodiscovery has been implemented in Domoticz as well. As the Gateway already supports this feature, it is very easy to get ALL parameters into Domoticz within minutes.
You need to run a recent beta version of Domoticz. Any version from late december 2021 onwards will do. Some additional finetuning for the discovery protocol has been done in Domoticz build 13949. So that build or later will work fine.
Turning on Autodiscovery
Open the web interface of the Gateway. Go to MQTT Settings. Mark the checkbox at ‘Use Home Assistant MQTT Discovery’. You can change the topic prefix to ‘ domoticz’ as well. Restart the Gateway.
Next go you your Domoticz dashboard.
Adding the hardware in Domoticz
The great thing about MQTT auto discovery is that this is a new native feature built into Domoticz. So aside from Mosquitto, you do not need to install software or another plugin.
In the Domoticz dashboard go to Settings -> Hardware.
And add a new hardware of the type ‘MQTT Auto Discovery Client Gateway with LAN interface’. If you already have one of these active, you still need to create a new one for the Gateway. Give it a name. F.i. ‘EMS Gateway’.
You need to set the remote address, which is the IP address of the machine that runs your MQTT broker (likely Mosquitto). Usually Mosquitto runs on the same machine as Domoticz. The port number is almost always 1883.
Optionally you can set the username and pasword if you configured Mosquitto that way.
At ‘Auto Discovery Prefix’ fill in ‘homeassistant’ or ‘ domoticz’ (Whatever you used on the EMS-ESP settings page). Leave the rest as it is.
Now click on ‘Add’.
Wait a minute or two so Domoticz can process all MQTT discovery topics the Gateway sends out. For each parameter in the Gateway you get a device in Domoticz. A simple boiler and thermostat will give you about 75 parameters.
If you go to Setup -> Devices and filter on the hardware you just created you get a long list of devices. If you see this list then the discovery was successful.
You can see the amount of devices that were created at the bottom of the list.
MQTT Discovery for Domoticz is still in beta. So features may be added later on and some bugs may still be present.
Help I don’t see any device
If the Device list in Domoticz is not filled now, something went wrong.
Make sure Mosquitto is running, that MQTT Discovery is turned on in the Gateway and that you entered the right IP address and credentials.
You can use a program called MQTT Explorer  to check for issues. Connect to your broker and you should see topics called ‘ems-esp’ and ‘homeassistant’. If you don’t see topics starting with ‘homeassistant’ then you did not turn on MQTT Discovery in the Gateway correctly. Please do so and restart the Gateway.
You should see something like below:
If you get devices into Domoticz, but not as they should, then you might need to delete the whole homeassistant tree in MQTT Explorer. Then restart the Gateway and it will re-populate these topics.