I have automation to turn on my outside lights 30 minutes after sunset and turn them off again at 1030. It is a little complicated because I have a few scenes that the automation can choose from depending on the holiday. If there is a defined holiday, it turns on the specified holiday scene. If it’s not a holiday, it should turn on the outside lights to a bright scene. So, strangely, the automation works perfectly for the holiday scenes. It worked perfectly for the week of Halloween, but for the default, it doesn’t activate at all. The automation triggers, but the bright scene never comes on. The Holiday dates for the scenes are defined in the config.yaml. Am I missing something for the automation for the “nonholidays”?
alias: Turn on Outdoor Lights After Sunset
description: Turns on outdoor lights 30 minutes after sunset, with holiday scenes.
triggers:
- trigger: sun
event: sunset
offset: "+00:30:00"
conditions: []
actions:
- choose:
- conditions:
- condition: template
value_template: "{{ states('sensor.current_holiday') != 'None' }}"
sequence:
- action: scene.turn_on
target:
entity_id: >
{% set holiday = states('sensor.current_holiday') %} {% if
holiday == "New Year's" %}
scene.holiday_new_years
{% elif holiday == "Valentine's Day" %}
scene.holiday_valentines
{% elif holiday == "St. Patrick's Day" %}
scene.holiday_st_patricks
{% elif holiday == "4th of July" %}
scene.holiday_4th_of_july
{% elif holiday == "Halloween" %}
scene.holiday_spooky
{% elif holiday == "Thanksgiving" %}
scene.holiday_thanksgiving
{% elif holiday == "Christmas" %}
scene.holiday_christmas
{% else %}
scene.outside_bright # Default scene
{% endif %}
default:
- action: scene.turn_on
target:
entity_id: scene.outside_bright
data: {}
mode: single