Automation with input_datetime helper as time condition not working

I have an automation to turn on my outdoor christmas lights twice a day. But only if the current time is after the time specified in the input_datetime.start_christmas.

date of writing is jan 3 2024

  • When setting the input_datetime.start_christmas to dec. 1 2023 as date and then test the condition it says “condition did not pass”

  • When setting the input_datetime.start_christmas to dec. 1 2023 0:00 as date and time and then test the condition it says “condition passes”

  • When setting the input_datetime.start_christmas to jan. 5 2024 0:00 as date and time and then test the condition it says “condition passes” too.

alias: turn on christmas lights
description: ""
trigger:
  - platform: state
    entity_id: sun.sun
    to: below_horizon
    from: above_horizon
    enabled: true
  - platform: time
    at: "05:00:00"
    enabled: true
condition:
  - condition: time
    after: input_datetime.start_christmas
action:
  - service: light.turn_on
    data: {}
    target:
      entity_id:
        - light.lys_have_1
        - light.julelys_forhave
mode: single

I hope someone can help me out.

thanks

This is a common misconception/misunderstanding of Time conditions.

From the docs:

condition:
  - condition: template
    value_template: "{{now() > states('input_datetime.start_christmas')|as_datetime|as_local}}"
1 Like

I dont know how i missed that, sorry for the inconvenience, but thanks for the help!