But I would like to know how many lamps are on in my studio, for example. In the studio light1 on, light2 on and light3 off. So if 2 lights are on in the studio i like to have an number of 2. Now i get 0 or all the lights in my house.
thnx all i going to try that. first have an problem with
{{ states.light|selectattr('state','equalto','on')|list|length }} On
If everithis is off then it is 0, if one light is on it counts 2 (no dubble light) it seems it is counting also the light groups. Is there an way to only count the real lights?
By rejecting entities that are light groups. A light group has an attribute named entity_id so you have to filter out entities containing that specific attribute.