Automation doesn't trigger by selected time

Hi,

I have input_datetime.bedtime for time.

My automation

- alias: Bed Time Automation
  trigger:
    platform: template
    value_template: "{{ now().strftime('%H:%M:%S') == states('input_datetime.bed_time') }}"
  action:
    - service: script.going_sleep

In dev tools I checked values:

{{ now().strftime('%H:%M:%S') # 16:32:00 }}
{{ states('input_datetime.bed_time') # 16:34:00 }}

So they looks the same, and my question, why automation doesn’t trigger at all?

now() can’t be used as the TRIGGER for an automation.

Someone else can explain the ‘technical reason’ why it can’t, but you’ll have to TRIGGER this automation differently.

Ok, thanks. So I understand I need to create time sensor and use it for automations?

Yes exactly. You can check out this topic with the same problem.