fablab-luenen / McLighting

The ESP8266 based multi-client lighting gadget
MIT License
216 stars 30 forks source link

Don't publish status change on MQTT-out when change was from MQTT-in #67

Closed mikkel75 closed 4 years ago

mikkel75 commented 4 years ago

Hi,

Great project btw!

I have an issue when I want to be able to monitor and control McLighting devices from my Domoticz system using MQTT. My system looks like this https://1drv.ms/u/s!AlY-U_GE-GiVgsJYYFZF4eo25_vGwg?e=Ivfnb6

The problem is that I get a MQTT message loop, since both McLighting and Domoticz sends out a new MQTT message when it receives one.

I have discussed with the Domoticz developer about a way to update a virtual device WITHOUT triggering a new MQTT message. So far with no luck.

It would be great if McLighting could have such a feature, so that state change based on incomming MQTT wouldn't result in a MQTT out message.

Hope you can help :)

Thanks

bpohvoodoo commented 4 years ago

Hi I will have a look. Possibly i will add a compile switch for this into the definitions.h file, but i am not shure, if this makes sense, because you do not know the state after mqqt_in. Possibly the device fails the in_command.

mikkel75 commented 4 years ago

Hi. Sounds good....just out of curiosity - is it normal for MQTT devices to transmit it's status after a change from MQTT/in ? If so, I would agree that the problem lies with Domoticz...

bpohvoodoo commented 4 years ago

Yes, it is. Otherwise you can't be shure the device did what you wanted.