Hi all, i just want to know if its possible to exclude entitys in a template? I have got this and it shows me all my on lights and total lights. But I know it also counts all the groups from Philips hue Hub as lights. Just learning about template!
{{ states.light | selectattr( ‘state’, ‘eq’, ‘on’) | list | length }} of {{ states.light | count }}
This version gives you more flexibility if you have an application where you need to selectively reject lights that are either in a room or a zone. However, for your current needs (reject rooms and zones) the first example will do the trick.
That’s what this line in the template does. It rejects any entity that has a is_hue_group: true in its attributes. Only Philips Hue groups have this attribute.
So I got the the right amount of light showing now (the on lights)! I also want the total amount of lights in my home show. Like this 24 of 82 lights are on.
I have all that showing but I know that of my 82 lights in total 15 are hue groups, them I want to get rid of.
Did I express myself better this time? Sorry for my English.