Files
fresh-home/automations/season/season_is_winter.yaml
T
2024-04-14 14:08:56 -04:00

31 lines
934 B
YAML

alias: 'Season is Winter'
id: automation_season_is_winter
initial_state: 'on'
trigger:
- platform: homeassistant
event: start
- platform: time
at: '03:00:00'
condition:
- condition: and
conditions:
- condition: template
value_template: '{{ ( now().month == 12 ) or ( now().month < 3 ) }}'
- condition: or
conditions:
# Either after the 1st of January
- condition: template
value_template: '{{ now().month == 1 and now().day >= 1 }}'
- condition: and
conditions:
# or before the 12th of December and we've not turned it on early
- condition: template
value_template: '{{ now().month == 12 and now().day < 12 }}'
- condition: template
value_template: '{{ states("input_select.season") != "Christmas" }}'
action:
- service: input_select.select_option
data:
entity_id: input_select.season
option: Winter