I have a Kodi box in my living room running 24/7 and i have added it to a group representing that room.
Until somewhen last year it would simply be ignored for the group state. Only lights, switches and binary sensors were used for the group state. I relied on this for quite some automations to trigger when any light would be turned on, e.g.
Now, behavior has changed and any media player state not being off seems to lead to my group being on. With Kodi being idle 24/7 all my groups are now on all the time! So, automations won’t trigger.
Is there a way to make group state calculation treat idle as an off state?
No, unfortunately I have not found a way to do this “natively” in Home Assistant. But I have a work-around for me.
It turned out, I was mainly using the group’s state semantics in a script, which would toggle the group. So, I implemented the old semantics myself. The relevant piece of template is this one:
'on' in expand(entity_id) | map(attribute='state') | list
It returns true if any member of the group passed in the variable entity_id is on. And false otherwise.
Since I had a script and templates already anyway, I just resorted to replacing states(entity_id) with something using the above template snippet: