Page 1 of 1

Docs on Domoticz MQTT Connection

Posted: Tuesday 02 July 2024 9:39
by ITguy
I'm trying to implement a Python plugin for a custom hardware talking MQTT.

And I'm having a hard time figuring out how to talk to MQTT server via domoticz MQTT connection.

The API seems to be quite low-level, with JSON describing MQTT package. And there's seem to be no documentation describing what keys I use to describe a packet, which makes it very hard to implement communication with MQTT server.

Also, I had an idea to use something like paho-mqtt to communicate with server, but Domoticz MQTT connection has it's own lifecycle and callbacks, where other MQTT clients wouldn't fit.

So, my questions are:
- is there a doc (or at least some good examples) on "protocol" used by Domoticz MQTT connection to communicate with MQTT server?
- is there a way to integrate MQTT client lib (e.g. paho-mqtt) into Domoticz plugin?

Re: Docs on Domoticz MQTT Connection

Posted: Tuesday 02 July 2024 11:40
by waltervl
If you want to write a Domoticz python plugin you talk directly with Domoticz with the python plugin functions. No need to talk Domoticz MQTT for this.

Alternatively you can use the existing MQTT mapper plugin in which can make a configuration file to map your MQTT device to Domoticz devices. https://www.domoticz.com/forum/viewtopic.php?t=39279

Re: Docs on Domoticz MQTT Connection

Posted: Wednesday 03 July 2024 19:37
by ITguy
Thanks for the answer. I'll check MQTT mapper as you suggest.

The thing is, my device is controlled by MQTT messages, so I do have to send these from my plugin , to switch things on and off, get sensor data, etc (unless I'm missing something and there are other ways to do it via domoticz).

Re: Docs on Domoticz MQTT Connection

Posted: Wednesday 03 July 2024 22:51
by waltervl
The mqtt mapper plugin can do that too I believe.

Re: Docs on Domoticz MQTT Connection

Posted: Thursday 04 July 2024 23:54
by FlyingDomotic
With topics description and some explanations of what you want to do, you may even find some help here ;-)