Is your feature request related to a problem? Please describe
ZigBee groups are fantastic for improving the efficiency of the ZigBee network and controlling lights simultaneously. However, a ZigBee group is indistinguishable from an individual device as far as a home assistant is concerned. This makes it impossible to automatically determine if controlling a group will change any other devices and vice versa.
Describe the solution you'd like
Home Assistant groups use an attribute entity_id (not to be confused with the entities own ID), which specify a list of child entity IDs. Populating this for Zigbee groups would prove extremely useful.
Describe alternatives you've considered
It is possible to simulate the solution by customizing the entity in YAML, though this needs maintaining manually and is error-prone, e.g.:
Just one example where this is useful. I use a JSON structure to generate my UI, and want to specify lights as a hierarchy. I currently use light groups in HA, particularly where I want to combine Z2m lights with Hue lights. However, wherever possible, I'd prefer to use Zigbee groups. Specifying the entity_id allows the following to work seamlessly:
{%- set lights = [ states.light.all_lights ] %}
{%- set l %}
[
{%- for light in lights recursive %}
{{" "*loop.depth}}"{{ light.entity_id }}": [
{%- if light.attributes.entity_id is defined -%}
{{ loop(expand(light.attributes.entity_id)) }}
{%- endif -%}
]{{',' if not loop.last }}
{%- endfor %}
]
{%- endset %}
{{ l }}
If there are concerns about future compatibility issues with other addons/integrations/extensions, it would be acceptable to use a different attribute than entity_id; for example, z2m_entity_id, or z2m_group.
Is your feature request related to a problem? Please describe
ZigBee groups are fantastic for improving the efficiency of the ZigBee network and controlling lights simultaneously. However, a ZigBee group is indistinguishable from an individual device as far as a home assistant is concerned. This makes it impossible to automatically determine if controlling a group will change any other devices and vice versa.
Describe the solution you'd like
Home Assistant groups use an attribute
entity_id
(not to be confused with the entities own ID), which specify a list of child entity IDs. Populating this for Zigbee groups would prove extremely useful.Describe alternatives you've considered
It is possible to simulate the solution by customizing the entity in YAML, though this needs maintaining manually and is error-prone, e.g.:
Also, making changes requires a HA restart.
Additional context
Just one example where this is useful. I use a JSON structure to generate my UI, and want to specify lights as a hierarchy. I currently use light groups in HA, particularly where I want to combine Z2m lights with Hue lights. However, wherever possible, I'd prefer to use Zigbee groups. Specifying the entity_id allows the following to work seamlessly:
Which produces output like:
Where I have set the
entity_id
attribute forbedroom_1_spots
(as above), but not forbedroom_2_spots
.