Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #put this in configuration.yaml
- template:
- - sensor:
- - name: "lights_on"
- unique_id: lights_on
- icon: mdi:lightbulb-on
- state: >
- {% set lights = [ 'light.guest_room',
- 'switch.mainbath_left_toolbox',
- 'switch.mainbath_right_mainbath' #no "," at last entity
- ] %}
- {{ expand(lights) | selectattr('state','eq','on') | list | count }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement