This worked when I was using Deconz (which adds an attibute is_group for Deconz Groups). But I switched to Zigbee2MQTT so Zigbee groups no longer have this attribute and the resulting count is too high.
As the Zigbee groups are Hidden entities (Hidden in the entity properties) as they are part of a Home Assistant Light Group (to also include non-Zigbee lights) I have 2 options of filtering the entities:
Filtering by an attribute exposed by Zigbee2MQTT. Is there an attribute for Zigbee Groups exposed?
Filtering the Hidden entities.
I do not know how to do either of them. Can anyone help? Any help appreciated.
Hi @kaosmagix Christian, I was wondering if you were ever able to solve this. I have a similar issue in my template counter, it is adding individual lights of a group and the group itself, in my case a light fixture with 3 bulbs are grouped into one group in home assistant. The group provided by zigbee (Hue) includes these lights as well so in my case the counter tells me 5 lights are on, while what I want it to tell me is only 1 light is on (the ceiling light with 3 bulbs)
No, I didn’t find a way of doing this yet. For the moment I changed my naming to filter out entites ending with _1, _2, etc. and the naming convention I used for the Zigbee groups.
I still hope to find a way to filter in a proper way (not depending on the entity name).
Thank you @koasmagix. Your response kind of gave my a thought, however it is not the easiest way, I would be able to add light group or something unique to each light entity that I want to count, or simply add the extension _count to each light entity that I want included. Very cumbersome, but it might work. Need to rethink if this is what really adds value to my monitoring though…
It would look like this:
light.group_provided_by_hue
light.ceiling_1
light.ceiling_2
light.ceiling_3
light.group_homeassistant_ceiling_include_in_count
If I then filter the lightcount template sensor by ‘*_include_in_count’ it would provide me
template.sensor_light_count = 1 for this instance.