Open marc-gist opened 6 years ago
I'm running into the same challenge -- button presses (events) get published with retain which causes downstream consumers (like Home Assistant) to trigger whenever they are restarted because it thinks a new event was fired. Turning retain off globally would fix his problem but introduce sync issues with all the stateful devices. Perhaps the configurable precision should be down to the type/property level. For example, I have devices that expose both a switch and a button. I'd want "smartthings/device/switch" to be published with retain and "smartthings/device/button" not to be.
Looking at the code, this would need to be implemented in the nodejs component. I see two viable options:
Thoughts on the approach? I'm learning more to the second option because it would be far simpler to implement and can work on a PR if others agree. :)
Also running into this issue. Was resetting the docker container every night at 11 pm, coincidentally lights were turning on-off off-on at that time which I wasn't sure why until I realized the retain flags send the press or push along on the restart of this docker container.
Agreed @andrewsayre #2 seems to make sense
Is there anyway to set if the retain flag should be true/false for a particular device?
I have buttons in SmartThings, that i don't want the "press" action to be retained in the broker.
Thanks,!