Files
fresh-home/automations/time_of_day/set_time_of_day.yaml
T
2025-10-10 20:24:52 -04:00

30 lines
976 B
YAML

alias: Set Time of Day
id: automation_set_time_of_day
trigger:
- platform: homeassistant
event: start
action:
- action: input_select.select_option
data_template:
entity_id: input_select.time_of_day
option: >-
{% if is_state('binary_sensor.early_morning', 'on') %}
Early Morning
{% elif is_state('binary_sensor.morning', 'on') %}
Morning
{% elif is_state('binary_sensor.late_morning', 'on') %}
Late Morning
{% elif is_state('binary_sensor.early_afternoon', 'on') %}
Early Afternoon
{% elif is_state('binary_sensor.late_afternoon', 'on') %}
Late Afternoon
{% elif is_state('binary_sensor.early_evening', 'on') %}
Early Evening
{% elif is_state('binary_sensor.evening', 'on') %}
Evening
{% elif is_state('binary_sensor.late_evening', 'on') %}
Late Evening
{% else %}
Night
{% endif %}