From fbecc55c8fd88b98c52c0328d8d8e1492ed5b5e9 Mon Sep 17 00:00:00 2001 From: rzen Date: Sun, 6 Jul 2025 16:52:31 -0400 Subject: [PATCH] fix an issue with an input template --- fan-cadence.yaml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/fan-cadence.yaml b/fan-cadence.yaml index 04be358..6844c3f 100644 --- a/fan-cadence.yaml +++ b/fan-cadence.yaml @@ -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 }}"