Page 1 of 1

user-definable MQTT topic

Posted: Thursday 04 June 2020 17:26
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

Re: user-definable MQTT topic

Posted: Thursday 04 June 2020 17:53
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

Re: user-definable MQTT topic

Posted: Friday 05 June 2020 11:05
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?

Re: user-definable MQTT topic

Posted: Friday 05 June 2020 11:11
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.