For christmas morning, I would like to have all my christmas lights turn on bright and early. Kind of doing the “christmas magic” like in the movies, that the lights and all come on once santa has come. In this case the kids know “don’t wake us up till the christmas lights have come on”
However, i am struggling to get an automation to work on a specific day. I have been trying to test it, automation below.
- id: '16401193016401193018411841'
alias: Turn on christmas lights on christmas morning
description: ''
trigger:
- platform: time
at: 23:45:00
condition:
- condition: state
entity_id: input_boolean.christmas_time
state: 'on'
- condition: template
value_template: '{{ now().month == 12 and now().day == 22 }}'
action:
- service: light.turn_on
target:
entity_id: light.christmas_lights
mode: single
So you can see here I had it trying to turn the lights on at 11:45PM on 12/23. But in my automations pane I see this.
Looks like the automation is disabled because it thinks there is a missing entity.
Seems like you’re writing this by hand? Do you have the same unique_id somewhere else? For me, whenever I create automations with unique_id’s, I just give it a unique name for what it does.
- id: turn_on_christmas_lights_on_christmas_morning
alias: Turn on christmas lights on christmas morning
description: ''
trigger:
- platform: time
at: 23:45:00
condition:
- condition: state
entity_id: input_boolean.christmas_time
state: 'on'
- condition: template
value_template: '{{ now().month == 12 and now().day == 22 }}'
action:
- service: light.turn_on
target:
entity_id: light.christmas_lights
mode: single
If you’re using the automation editor, make sure light.christmas_lights and input_boolean.christmas_timeexists.
Lastly, you’re off by 1 day
Also, you can change that to be a bit more readable
value_template: "{{ '12-23' in now().date() | string }}"