Lately I noticed that Domoticz publishes the status of the devices on the MQTT domoticz/out topic twice.
After investigation I found out that this is because not only the "MQTT Client Gateway" does publish (as expected), but also the MySensors MQTT Gateway.
I have left the settings of the MySensors MQTT Gateway at the defaults, which means that the MySensors MQTT Gateway should publish on the domoticz/out/MyMQTT topic, as it actually does, if it gets a request from a MySensors node.
So basically the MySensors Gateway publishes regular status update on domoticz/out and replies on requests via domoticz/out/MyMQTT...
So question is, is this by design, or is this a bug?
(p.s. I need the MQTT Client Gateway to respond to normal commands and send status updates, but also the MySensors MQTT Gateway, so the need to work simultaneously without interfering).
MySensors MQTT Gateway publishes on domoticz/out topic
Moderator: leecollings
-
- Posts: 331
- Joined: Sunday 22 February 2015 12:19
- Target OS: Linux
- Domoticz version: 2020.x
- Location: Netherlands
- Contact:
Re: MySensors MQTT Gateway publishes on domoticz/out topic
Can other users also confirm that the MySensors Gateway publishes all device/status status-update on the domoticz/out topic?
-
- Posts: 81
- Joined: Sunday 04 January 2015 0:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest-1
- Location: /dev/null
- Contact:
Re: MySensors MQTT Gateway publishes on domoticz/out topic
Not really. How is your Gateway config? Mine is:
Code: Select all
// Set this node's subscribe and publish topic prefix
#define MY_MQTT_PUBLISH_TOPIC_PREFIX "domoticz/in/MyMQTT"
#define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "domoticz/out/MyMQTT"
-
- Posts: 331
- Joined: Sunday 22 February 2015 12:19
- Target OS: Linux
- Domoticz version: 2020.x
- Location: Netherlands
- Contact:
Re: MySensors MQTT Gateway publishes on domoticz/out topic
Sorry I didn't mean the physical hardware gateway and sensors, but the "MySensors Gateway with MQTT interface" configuration as it set-up in the hardware config of Domoticz. This acts as a client/interface for the physical gateway to Domoticz.
So what I'm saying is that by activating this in the Domoticz hardware settings, it starts publishing events on /domoticz/out.
That is exactly what the "MQTT Client Gateway with Lan interface" is doing, thereby duplicating all messages.
So what I'm saying is that by activating this in the Domoticz hardware settings, it starts publishing events on /domoticz/out.
That is exactly what the "MQTT Client Gateway with Lan interface" is doing, thereby duplicating all messages.
-
- Posts: 81
- Joined: Sunday 04 January 2015 0:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest-1
- Location: /dev/null
- Contact:
Re: MySensors MQTT Gateway publishes on domoticz/out topic
Sorry too 
I think this is "by design" to publish all messages within Domoticz to the topic domoticz/out. So even when a MYS node publish' a message to Domoticz on the (default) topic domoticz/in/MyMQTT you should see that message also on the topic domoticz/out.
In some configurations this might seems to double the messages but in fact it is replicating or relaying the messages. This can be useful or sometimes it isn't.
For most MYS communication to and from Domoticz I use node-red in between. This gives you much more flexibility but also some extra work.

I think this is "by design" to publish all messages within Domoticz to the topic domoticz/out. So even when a MYS node publish' a message to Domoticz on the (default) topic domoticz/in/MyMQTT you should see that message also on the topic domoticz/out.
In some configurations this might seems to double the messages but in fact it is replicating or relaying the messages. This can be useful or sometimes it isn't.
For most MYS communication to and from Domoticz I use node-red in between. This gives you much more flexibility but also some extra work.
-
- Posts: 331
- Joined: Sunday 22 February 2015 12:19
- Target OS: Linux
- Domoticz version: 2020.x
- Location: Netherlands
- Contact:
Re: MySensors MQTT Gateway publishes on domoticz/out topic
Mmm, I don’t think Domoticz should ever replicate any messages it receives from MQTT back to MQTT. That would completely defy the purpose of using a broker like MQTT which is there to do exactly that.
Also, if it would be disirable to publish internal events from Domoticz to a MySensors node, it would have to do this at the topic that is configured at the MYS MQTT Gateway which is domoticz/out/MyMQTT by default.
Also, if it would be disirable to publish internal events from Domoticz to a MySensors node, it would have to do this at the topic that is configured at the MYS MQTT Gateway which is domoticz/out/MyMQTT by default.
-
- Posts: 81
- Joined: Sunday 04 January 2015 0:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest-1
- Location: /dev/null
- Contact:
Re: MySensors MQTT Gateway publishes on domoticz/out topic
If you look as the MYS gateway sending messages to the Domoticz/in topic then I agree with you. But in my opinion this is not the case. The MYS system is seen as separate hardware and therefore is treated the same as all other hardware. The common thing is MQTT and might 'feel' strange seeing the same messages twice but in fact it is another message but with the same content.
Domoticz is due to the lack of any architectural design (where programmers first start typing and later start thinking) sometimes a bit counter intuitive. But hey, its free.
Domoticz is due to the lack of any architectural design (where programmers first start typing and later start thinking) sometimes a bit counter intuitive. But hey, its free.

Who is online
Users browsing this forum: No registered users and 0 guests