Moved more automation actions to scripts for modularity's sake

This commit is contained in:
2022-09-14 18:26:35 -04:00
parent a36d1918f4
commit 51e01484c2
2 changed files with 105 additions and 87 deletions

View File

@ -116,19 +116,7 @@ automation:
- platform: time
at: '06:06:00'
action:
- service: input_datetime.set_datetime
entity_id: input_datetime.nursery_cooling
data_template:
time: >
{% set high = state_attr('sensor.current_forecast','high_temp') | float %}
{% set low = state_attr('sensor.current_forecast','overnight_low') | float %}
{% if high >= 85 %}
20:30
{% elif high >= 80 or low >= 60 %}
21:30
{% else %}
22:30
{% endif %}
- service: script.nursery_scheduling
script:
kallen_scheduling_morning:
@ -357,3 +345,19 @@ script:
{% else %}
00:00
{% endif %}
nursery_scheduling:
sequence:
- service: input_datetime.set_datetime
entity_id: input_datetime.nursery_cooling
data_template:
time: >
{% set high = state_attr('sensor.current_forecast','high_temp') | float %}
{% set low = state_attr('sensor.current_forecast','overnight_low') | float %}
{% if high >= 85 %}
20:30
{% elif high >= 80 or low >= 60 %}
21:30
{% else %}
22:30
{% endif %}