Lots of little maintenance updates across the environment thanks to Spook

This commit is contained in:
CCOSTAN
2025-03-21 13:52:14 +00:00
parent ffb52d7302
commit 047f3a3a8c
18 changed files with 166 additions and 112 deletions

View File

@@ -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: >