Trigger an automation with a model

Hi all

could you please help me to figure out what’s wrong here? I’m trying to fire up an automation with a model, which is based on a time helper I configure with another automation. This is the code I’d like to use in the Template trigger:

{{  states('input_datetime.timer_scaldasonno') == (as_timestamp(now()) | timestamp_custom('%H:%M')) }}

What I’m trying to do here is to trigger the automation when the current time matches the time I stored in the time helper previously, but can’t figure out what’s wrong here. I was thinking perhaps the comparison is not working because I’m not comparing the same data, but it looks like both are string type, so it should work I guess… I even tried this:

{{  states('input_datetime.timer_scaldasonno') == (as_timestamp(now()) | timestamp_custom('%H:%M:%S')) }}

just to make sure it wasn’t due to the missing Seconds, but it doesn’t work too.

Any idea?

Since the changes in the WTH month you don’t need to use template triggers to do this. This will work:

trigger:
  platform: time
  at: input_datetime.timer_scaldasonno

See the third example here: https://www.home-assistant.io/docs/automation/trigger/#time-trigger

Nice eh?

Damn that worked like a charm… Completely overlooked it… I spent 3 hours building the template :frowning:

Anyway, thanks to you I fixed it, that’s the most important thing.

Thanks a lot !