fix an issue with an input template

This commit is contained in:
2025-07-06 16:52:31 -04:00
parent a7274f6053
commit fbecc55c8f

View File

@ -1,7 +1,7 @@
blueprint:
name: Fan Cadence with Light Check
description: >
Turns on a fan every X minutes for Y seconds, but keeps it on if any selected lights are on.
Turns a fan on every X minutes for Y seconds, but only turns it off if none of the specified lights are on.
domain: automation
input:
fan_entity:
@ -11,8 +11,7 @@ blueprint:
domain: fan
interval_minutes:
name: Interval (minutes)
description: How often to start the fan cycle
name: Interval Between Fan Cycles (minutes)
default: 15
selector:
number:
@ -22,7 +21,6 @@ blueprint:
duration_seconds:
name: Fan On Duration (seconds)
description: How long the fan stays on each cycle
default: 60
selector:
number:
@ -41,8 +39,6 @@ blueprint:
trigger:
- platform: homeassistant
event: start
- platform: time
at: "00:00:00" # ensures automation starts at midnight if HA is already running
variables:
fan: !input fan_entity
@ -63,7 +59,7 @@ action:
seconds: "{{ duration }}"
- condition: template
value_template: >
{{ lights | map('states') | select('eq', 'on') | list | length == 0 }}
{{ expand(lights) | map(attribute='state') | select('eq', 'on') | list | length == 0 }}
- service: fan.turn_off
target:
entity_id: "{{ fan }}"