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?
Docs on Domoticz MQTT Connection
Moderator: leecollings
- waltervl
- Posts: 5902
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Docs on Domoticz MQTT Connection
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
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
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Re: Docs on Domoticz MQTT Connection
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).
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).
- waltervl
- Posts: 5902
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Docs on Domoticz MQTT Connection
The mqtt mapper plugin can do that too I believe.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 389
- Joined: Saturday 27 February 2016 0:30
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Contact:
Re: Docs on Domoticz MQTT Connection
With topics description and some explanations of what you want to do, you may even find some help here 

Who is online
Users browsing this forum: No registered users and 1 guest