Automation that triggers every 25 minuts

I need to create an automation that triggers every 25 minutes. I can’t use the stock Time pattern because it must run on this specific recurring interval. If it needs code (ie template or other), how do I incorporate that into the automation as a trigger?

There are a couple ways…

Use a template trigger:

trigger: template
value_template: >-
  {%set last_triggered = state_attr(this.entity_id, 'last_triggered') | default(as_datetime(0), true )%}
  {{ now() - last_triggered > timedelta(minutes=25) }}

Use a timer. Have your automation trigger off the timer finishing and include an action in the automation to restart the timer.

Both of these could have edge cases where they don’t run as expected after restart. So you will likely want to include a trigger for when HA restarts.

You could try a template trigger

trigger: template
value_template: >-
  {{ as_timestamp(now()) // 60 % 25 == 0 }}

Take a look here for the concept

Tankless Water Heater Recirc Pump - How to automate pump toggle-on multiple times within time window - Configuration - Home Assistant Community 8/12

and here for the implementation

Tankless Water Heater Recirc Pump - How to automate pump toggle-on multiple times within time window - Configuration - Home Assistant Community 12/12

Thank you for the suggestions. What I ended up with is creating a Timer in the Helper page that runs 25 minutes and defined it as an entity. Then I could incorporate that entity into my Automation as a trigger when it went from active to idle. I also created a Script that restarted the timer and incorporated that as the final action of the Automation. Regards, Mark

1 Like