Room card: Number of lights on/covers up/ ... in area without using sensors #805
timvdsm
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm trying to build a new roomcard using bubble cards where I show the lights on / covers open / covers closed per room.
I don't have separate sensors for all of them per room (as there are a lot of rooms :-)).
I just calculate it very easy using the commands below, which gives nicely all the current states.
Lights on:
expand(area_entities('kitchen')) | selectattr ( 'domain' , 'eq' , 'light' ) | selectattr ( 'state' , 'eq' , 'on' ) | list | count
--> this gives the number of lights on in the kitchen
Cover open:
expand(area_entities('livingroom')) | selectattr ( 'domain' , 'eq' , 'cover' ) | selectattr ( 'state' , 'eq' , 'open' ) | list | count
--> this gives the number of covers open in the livingroom
Covers closed:
expand(area_entities('sleeproom')) | selectattr ( 'domain' , 'eq' , 'cover' ) | selectattr ( 'state' , 'eq' , 'closed' ) | list | count
--> this gives the number of covers closed in the sleeproom
Otherwise I would have to create around 50 separate sensors for it.
Is there any way I can use these 3 commands as the states for subbuttons?
At this moment I guess I only can use templates for sensors in subbuttons?
Beta Was this translation helpful? Give feedback.
All reactions