fix an issue with an input template
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
blueprint:
|
blueprint:
|
||||||
name: Fan Cadence with Light Check
|
name: Fan Cadence with Light Check
|
||||||
description: >
|
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
|
domain: automation
|
||||||
input:
|
input:
|
||||||
fan_entity:
|
fan_entity:
|
||||||
@ -11,8 +11,7 @@ blueprint:
|
|||||||
domain: fan
|
domain: fan
|
||||||
|
|
||||||
interval_minutes:
|
interval_minutes:
|
||||||
name: Interval (minutes)
|
name: Interval Between Fan Cycles (minutes)
|
||||||
description: How often to start the fan cycle
|
|
||||||
default: 15
|
default: 15
|
||||||
selector:
|
selector:
|
||||||
number:
|
number:
|
||||||
@ -22,7 +21,6 @@ blueprint:
|
|||||||
|
|
||||||
duration_seconds:
|
duration_seconds:
|
||||||
name: Fan On Duration (seconds)
|
name: Fan On Duration (seconds)
|
||||||
description: How long the fan stays on each cycle
|
|
||||||
default: 60
|
default: 60
|
||||||
selector:
|
selector:
|
||||||
number:
|
number:
|
||||||
@ -41,8 +39,6 @@ blueprint:
|
|||||||
trigger:
|
trigger:
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
event: start
|
event: start
|
||||||
- platform: time
|
|
||||||
at: "00:00:00" # ensures automation starts at midnight if HA is already running
|
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
fan: !input fan_entity
|
fan: !input fan_entity
|
||||||
@ -63,7 +59,7 @@ action:
|
|||||||
seconds: "{{ duration }}"
|
seconds: "{{ duration }}"
|
||||||
- condition: template
|
- condition: template
|
||||||
value_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
|
- service: fan.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: "{{ fan }}"
|
entity_id: "{{ fan }}"
|
||||||
|
Reference in New Issue
Block a user