mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-08-29 09:15:55 +00:00
Lots of little maintenance updates across the environment thanks to Spook
This commit is contained in:
@@ -91,6 +91,19 @@ sensor:
|
||||
value_template: >
|
||||
{{ states.light | list | count }}
|
||||
|
||||
lights_on_count:
|
||||
friendly_name: "Number of lights on"
|
||||
value_template: >-
|
||||
{% set lights = states.light | selectattr('state', 'eq', 'on') | list %}
|
||||
{% set qty = lights | count %}
|
||||
{% set p1 = 'lights are' if qty > 1 else 'light is' %}
|
||||
|
||||
{% if qty == 0 %}
|
||||
No lights on.
|
||||
{% else %}
|
||||
{{ qty }} {{ p1 }} on.
|
||||
{% endif %}
|
||||
|
||||
protect_count:
|
||||
friendly_name: 'Number of Smoke Detectors'
|
||||
value_template: >
|
||||
|
Reference in New Issue
Block a user