#Automation trigger with timestamp

1 messages · Page 1 of 1 (latest)

zealous minnow
#

Hi, I got an entity that his state is timestamp that changing every few days.
What type of trigger do I need to put in my automation to make it work that everytime that the timestamp = state is right now the trigger will work on my automation?

entity:

sensor.calendar_upcoming

state:

2024-11-23T15:16:00+00:00

attributes

device_class: timestamp
icon: mdi:weather-night
friendly_name: Calendar Upcoming

Thanks for help!!

vernal horizon
subtle hull
#

If the sensor entity shows the “next” time something happens, it could be a race condition whether the automation triggers first, or if the sensor updates to the “new next” time, and so the automation never fires. There is now an option that appears after you choose the entity to provide a time offset. I would suggest firing 10 seconds early to avoid that scenario. If the 10 seconds really matters, you can have the first step of your automation be a 10 second delay.

zealous minnow
zealous minnow
subtle hull
#

As long as that time will remain and display a value that is in the past for some amount of time. Then you should be fine.

zealous minnow
subtle hull
#

Yes, regardless if you need an offset or not, use that trigger

zealous minnow
#

Sweet, thanks I will give it a try

zealous minnow
subtle hull
#

There is a field in the trigger in the UI right below where you selected the entity to use as the time

#

Unless you’re more than 1-2 months behind on your HA version, that option was recently added

zealous minnow
#

That i suppose, right?

#

If I want only 10 seconds should I write 00:00:10 ?

#

**10 minutes sorry

subtle hull
#

Yes

zealous minnow
subtle hull
#

But no you want 00:10:00

#

Yep

zealous minnow
#

like in the pic

#

ok will give it a try

#

Thanks bro

subtle hull
#

No problem

zealous minnow
# subtle hull No problem

The automation just triggered, but the offset you told me trigger the automation 10 minutes AFTER the sensor time.
How can I do 10 minutes before the sensor time?

subtle hull
#

Put a negative sign in front of it

zealous minnow
subtle hull
#

offset: "-00:10:00"

zealous minnow