New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to debounce MQTT state updates #615
Comments
Makes sense, and thanks for the detailed report. I'm going to re-categorize this as an enhancement. MQTT state updates were designed to work to work this way, so the behavior you're describing is expected (although not desirable). To elaborate a bit:
The path forward is to either:
It's come up before (see #576), so makes sense that this should be an option (and probably the default). I won't have the chance to look at this for some time. If anyone else wants to take a crack, the relevant class is BulbStateUpdater. Option (1) is probably a pretty quick change. |
Thank you for the comprehensive answer! I tried my best to add a global debounce delay for the MQTT state updates. (See #617) For me it works perfectly now. Thank you for your work! |
Adds a setting that delays state updates from being sent until an update hasn't occurred for a configurable threshold Implements #615
Describe the bug
When I send a command over MQTT with multiple changes (for example hue and level), multiple status messages get sent, with the parameters changing one by one. That means, when I change both level and hue, the level gets changed first and a status message is sent with the old hue and just after that the full new status is sent. This is a problem, because it leads to jumping values in my control dashboard, as the old hue gets pushed as a update after I changed it with a command.
Steps to reproduce
send MQTT 1: {"state":"ON","level":95,"hue":250}
send MQTT 2: {"state":"ON","level":90,"hue":240}
received status messages after MQTT 2:
1: {"state":"ON","level":95,"hue":250,"saturation":100,"bulb_mode":"color"}
2: {"state":"ON","level":90,"hue":240,"saturation":100,"bulb_mode":"color"}
Expected behavior
Don't send status message 1 and send only 2 (only the full status update)
expected message after MQTT send 2:
{"state":"ON","level":90,"hue":240,"saturation":100,"bulb_mode":"color"}
Setup information
MQTT messages normally sent with Openhab, but also tested with MQTT.fx client.
Firmware version
1.10.5 (d1_mini)
Output of http://milight-hub.local/about
Output of http://milight-hub.local/settings
The text was updated successfully, but these errors were encountered: