How to avoid loops with MQTT updating devices

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
Andrex
Posts: 92
Joined: Thursday 18 February 2016 9:11
Target OS: Linux
Domoticz version:
Contact:

How to avoid loops with MQTT updating devices

Post by Andrex »

Hi guys,
I have an Arduino that works as a switch. When pressed it turn a relay on and it sends the command to DomoticZ (via MQTT) updating the switch status.
The problem is that when I press the switch a domoticz/in MQTT message is sent from Arduino with the switch status. DomoticZ sees that message, update the switch state and send a domoticz/out MQTT message with the switch state. The Arduino is listening to that topic, it updates the switch status and it sends a domoticz/in MQTT message......and the loop is started :(
Is there a way to insert a field in the MQTT message the Arduino is sending so that if DomoticZ sees that field it doesn't send a domoticz/out update?
Or do you have any other suggestion to avoid this loop?
Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest