-
-
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
Ability to query group state #4989
Comments
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 |
If a developer familiar with the code sends me a few pointers, I could try implementing this myself and sending a PR. What are some files/functions I likely need to touch? |
For this use case you can use the Example for groups:
'1':
friendly_name: group_1
retain: true |
Thanks! But that requires resubscribing, which may not always be desirable. Is there a reason there is no option to query the state of a group just like you can query individual elements? If I were to send a PR that adds this functionality, would you accept that? It seems like a very natural feature, but maybe I'm missing something. |
Because groups actually have no state (and the state of devices in it can vary in theory). I'm wondering if it makes more sense to add a command to republish all known states? E.g by publishing to |
Okay, I guess that makes sense. Basically groups can be set, and it's equivalent semantically to setting each member of the group to the same state (though in terms of timing the group set seems to do all of them at once, while the iterative "do each member" is noticeably sequential). A command to republish all states would actually be truly useful to me. Would it also republish group states? My guess is no, since as you point out there is no real state with groups. Either way, it would be useful :) |
This would be republish the states as available in the |
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 |
It would be nice to be able to query the state of a group. My home automation system uses this at startup (of the home automation system, not zigbee2mqtt) to learn the current state of the system. It seems like there is no way to get the state of groups any more, they only output their state when the state changes.
Describe the solution you'd like
Explicitly querying the state of a group at
"zigbee2mqtt/<group_name>/get"
should send out the current state of that group.Describe alternatives you've considered
I could have my external system know the group to device mapping and learn the state by querying all the member devices. That's doable, but it seems like just re-implementing state tracking outside of zigbee2mqtt.
Additional context
It used to be possible to query the group state by querying any of the members. This was recommended as a solution by @Koenkk in #764 (comment). However, I believe with the change for #3461 that stopped working.
The text was updated successfully, but these errors were encountered: