Issues with "christmas day" automation

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.

image

image

Looks like the automation is disabled because it thinks there is a missing entity.

Thanks!

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 }}"

i only have 5 automations at the moment so definitely not a duplicate :slight_smile:

I was thinking the ID needed to be numeric, ill remember i can use text in the future.

That date was the last attempt from last night that didn’t work.

Entities exist.

image

Not sure why the error says there is an orphaned entity. :confused:

Gonna try to updating that value_template.

Thanks!

Do you edit through the UI?

I recreated on my “test instance” and got it working. Then moved it to my “prod” instance. It is working now.

  - id: 'christmas_morning_lights'
    alias: Turn on christmas lights at 06:00am on christmas morning
    description: ''
    trigger:
    - platform: time
      at: input_datetime.christmas_morning_time
    condition:
    - condition: state
      entity_id: input_boolean.christmas_time
      state: 'on'
    - condition: template
      value_template: "{{ '12-23' in now().date() | string }}"
    action:
    - service: light.turn_on
      target:
        entity_id: light.christmas_lights
    mode: single

I have created that input_datetime object to hold the time now.

Not sure why the other one didn’t work, but I’m on mobile and it’s a pain to try to compare them. Either way, glad you got it working.