Expose members of deCONZ lightgroups as entity_id attribute#48348
Expose members of deCONZ lightgroups as entity_id attribute#48348chishm wants to merge 2 commits into
Conversation
9b8a972 to
bb750fe
Compare
This mimics the native HA light group platform.
bb750fe to
f7e6049
Compare
Kane610
left a comment
There was a problem hiding this comment.
Thanks for your PR!
Whats the value of exposing the lights as attributes when they are not configurable from HASS?
What happens if an entity id change?
What happens if the constellation of lights change for the group?
|
The motivation for this PR is to allow scripts and other components to expand groups into individual lights. The particular use-case I have in mind is to configure adaptive_lighting with a deCONZ group, then allow it to only adjust individual lights within the group that are currently turned on. The reverse would also be possible: if all lights in a group are currently on then only a single If any entity_id changes, or the group constellation changes, this won't be visible until the deCONZ component is refreshed (e.g. restart HA or call |
|
@chishm The reasoning is odd, as adaptive lighting is an integration that can access the device registry and thus already access this data. Why add a copy of this same data again? I would not recommend on adding this, as the group represents a group of Zigbee devices, not Home Assistant entities. |
|
@frenck The deCONZ integration doesn't currently report group members at all. The information is lost as soon as it has finished initialising. I added the If there's a better way to make group membership information available to other integrations, in a standardised manner, then I'm happy to do it that way. |
|
I got that my comment above was about just that. |
|
I think I understand what you're saying. This is leaking information through the abstraction that it shouldn't, and there are better ways to solve the problem. Thank you for taking the time to review this, @Kane610 and @frenck. I'll close this PR in favour of a light.adjust service (architecture discussion TBD). |
|
Great you see other ways of reaching your end goal through an even more generic approach! |
|
Hopefully this isn't considered a necro-bump. Here's the architecture discussion I mentioned. |
Proposed change
Make deCONZ light groups mimic native HA LightGroup by reporting its members in the
entity_idattribute. This allows scripts and other components (e.g. Adaptive Lighting) to discover if only some lights are on in the group, and act appropriately.Also change the default icon to
mdi:lightbulb-groupto match HA LightGroup.Type of change
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: