-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[feature] debounce for groups #3461
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Still wanted |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Unstale |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days |
Unstale |
I'm wondering that instead of debounce, we can also not publish a new group state when there is nothing different to be published. This has to advantage of not having to wait the debounce time before a new state gets published. |
Should we not try to keep the behavior consistent between groups and devices? Although both would work for my use case. |
Both yes and no, the no part is not to add features/settings for things that are not used. Besides that not republishing the "optimistic" state for groups when it didn't change makes a lot of sense, I can't imagine why you don't want this. |
Edit, attempt at better phrasing Yes, not updating when there is no change makes more sense and would make debounce for groups not necessary. Although for devices there are some exceptions I think like when the elapsed or last_seen payload is present. |
I only meant the optimistic state for groups based on device changes. So a /set on a group will still publish a state update, even when identical. But when e.g. 2 bulbs in a group report they have been turned off, the group will only publish it's updated state once. Please try the |
Seems to behave as expected. Both triggered via remote or via mqtt will result in 1 publish |
Good, does it solve your OP issue? Because this is exactly what you described in "How to reproduce" |
Yeah this is fine for my use case. my 6 bulb groups now no longer spam mqtt messages 1-3 sec after toggling them via de group. |
Great, merged I assume we can close this now 😄 |
Something is still broken after restarting z2m, I need to investigate more but it looks like it does not republish retained messages for groups at startup now. |
I've just verified this is indeed the case! :( How I verified this:
Only the sub that was for a device got the payload published again as expected, the sub for the group did not. I guess the one that publishes at startup should get called with a 'force' flag or something that will always (re)publish. |
@sjorge fixed |
Looks good now after grabbing the latest dev. |
Bug Report
What happened
I noticed I get a attReport from 2 bulbs in a group usually within a second of eachother, the group update get published twice to mqtt with the sam payload.
What did you expect to happen
I expected to be able to set 'debounce' for a group, but that had no effect.
Looking at the code, I don't think that is currently support. So I guess this is a feature request.
How to reproduce it (minimal and precise)
Add 2 trådfri bulbs to a group, then change the state via the group.
The text was updated successfully, but these errors were encountered: