Why isn't this trigger working?

I have a sensor with the following value (see image):
sensor

and I’ve set up a trigger as follows:

alias: Vakantie
description: ""
triggers:
  - trigger: time
    at: >
      {{as_timestamp(state_attr('sensor.agenda_bart','Vandaag_Events')[0].start)|
      timestamp_custom("%H:%M")}}
conditions: []
actions:

However, this doesn’t work. Can someone explain why? Thanks for any feedback.

My original response overlooked the screenshot. (It’s usually best to paste stuff like that as preformatted text rather than screenshotting.)

Your template is valid given the state of the sensor you posted. Your problem, I think, is that the time trigger only supports limited templates, and state_attr isn’t supported in limited templates.

Set it to trigger each minute or second and then make the check for time in the conditions instead.

I would probably create a sensor entity that has the event time as it’s state.
That can be used to trigger a time trigger.

EDIT:
Or where is this data coming from?
Is it a calendar?

Thank you everyone for your response. Yes, it is a calendar!

So why not use a calendar trigger?

1 Like