user-definable MQTT topic

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

Post Reply
davidevans
Posts: 3
Joined: Thursday 15 June 2017 18:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 5877
Contact:

user-definable MQTT topic

Post by davidevans »

Domoticz in/out MQTT topics are forced to be domoticz/in and domoticz/out at v4.10717 and 2020.1.

I have seen earlier discussion closed saying this cannot be changed.

I am integrating multiple instances of Domoticz. It is a bit inconvenient that I can't make each instance publish using a its own unique MQTT topic but I can work around that.

Unfortunately, I can't think of a reliable way to direct a command to a specific Domoticz instance via MQTT: the message {"command": "switchlight", "idx": 2450, "switchcmd": "On" } will be received by all instances when published to topic domoticz/in and it is likely that more than one instance will have a device with the same idx value.

I would be grateful if somebody could suggest a way to do this using just Domoticz and a single MQTT broker.


Thanks

David
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: user-definable MQTT topic

Post by waaren »

davidevans wrote: Thursday 04 June 2020 17:26 Domoticz in/out MQTT topics are forced to be domoticz/in and domoticz/out at v4.10717 and 2020.1.
I would be grateful if somebody could suggest a way to do this using just Domoticz and a single MQTT broker.
If you compile locally you could try to modify hardware/MQTT.cpp
the TOPIC_IN is hardcoded in that file so you can give each domoticz system it's own topic
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
MikeF
Posts: 350
Joined: Sunday 19 April 2015 0:36
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.2
Location: UK
Contact:

Re: user-definable MQTT topic

Post by MikeF »

waaren wrote: Thursday 04 June 2020 17:53 the TOPIC_IN is hardcoded in that file so you can give each domoticz system it's own topic
Maybe that could be defined as a parameter in a future release?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: user-definable MQTT topic

Post by waaren »

MikeF wrote: Friday 05 June 2020 11:05
waaren wrote: Thursday 04 June 2020 17:53 the TOPIC_IN is hardcoded in that file so you can give each domoticz system it's own topic
Maybe that could be defined as a parameter in a future release?
I don't see a specific reason why that would not be possible but time is always a constraint. Hopefully one of the developers will find some time to dive into this.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest