Docs on Domoticz MQTT Connection

Python and python framework

Moderator: leecollings

Post Reply
ITguy
Posts: 2
Joined: Monday 01 July 2024 11:14
Target OS: Linux
Domoticz version:
Contact:

Docs on Domoticz MQTT Connection

Post 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?
User avatar
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

Post 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
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
ITguy
Posts: 2
Joined: Monday 01 July 2024 11:14
Target OS: Linux
Domoticz version:
Contact:

Re: Docs on Domoticz MQTT Connection

Post 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).
User avatar
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

Post by waltervl »

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
FlyingDomotic
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

Post by FlyingDomotic »

With topics description and some explanations of what you want to do, you may even find some help here ;-)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest