What's the easiest way to run an automation every hour and a half?

That will not work. The /90 here applies only to the minutes part of any time of day, going from 0 to 59. So this will match every hour on the hour.

I proposed PR #38282 which will make the above configuration invalid. Things can still get confusing though as e.g. minutes: /25 will match xx:00, xx:25 and xx:50 … so it waits for 25 minutes two times and then for 10 minutes.

(I don’t know of a simple way to fire every 90 minutes.)

1 Like

Thanks for the clarification!

1 Like

Still think it would be a benefit to have a cron platform. Then you could trigger every 90 minutes using this expression:

trigger:
  - platform: cron
    value: '30 1/3 * * *'

See Crontab Guru

2 Likes

What it doesn’t do, and which I think the OP wants, is to run at dawn, and then every 90 minutes. Mind you, neither did mine, even if it could work.

apologies for raising an old thread, but has anyone any idea how to trigger automations every 90 minutes?

please check: Automation Trigger - Home Assistant

Can you please try this? You need to setup an automation which has trigger type Template. Please adjust timeout_in_minutes variable and let me know.

Information: this will check when specific automation had run last time and if X minutes had passed. If the automation has never run yet, it will take last updated time instead of last triggered. So, it is not going to be in 3:00 - 4:30 - 6:00, it will try to execute in every 90 minutes from a starting point.

{% set timeout_in_minutes = 90 %}
{% if state_attr("automation.server_is_on_low_battery_notify", "last_triggered") == None %}
{{ 
    (
    (
    as_timestamp(now()) - 
    as_timestamp(states.automation.server_is_on_low_battery_notify.last_updated)
    ) 
    / 60.0 ) > timeout_in_minutes 
}}
{% else %}
{{ 
    (
    (
    as_timestamp(now()) - 
    as_timestamp(state_attr("automation.server_is_on_low_battery_notify", "last_triggered"))
    ) 
    / 60.0 ) > timeout_in_minutes 
}}
{% endif %}

PS: if you are looking for guaranteed solution, this cannot be the one please discard this possible solution, other way around, this is best intention and good will. Feel free to discard or give it a try!

You have posted a link to the Time Pattern Trigger. Did you see amelchio’s post (above) explaining why a Time Pattern Trigger cannot be used for a 90-minute interval?

trigger:
  - platform: template
    value_template: "{{ (now().hour*60+now().minute)%90==0 }}"

Checks if the number of minutes since the start of the day is exactly divisible by 90. Might do odd things on daylight savings adjustment days.

no, I did not get it why it is not possible? it looks like we can use a time pattern as below, would not it work?

“You can prefix the value with a / to match whenever the value is divisible by that number.”

Your trigger will fire every 30 minutes, if that description is correct.

Why are you asking if it will work? Didn’t you test it before you proposed it?

This is a community platform, not a customer service, we are doing our best to help. So, I am sharing my personal experience and my thought, so, if it works perfect, if not, i will learn something new. I do not have any obligation to be sure 100% correct/valid/tested other than good intentions. If you are looking for answers which are tested/validated, I will not be able to share them and you are free to discard my messages.

1 Like

thanks for explanation, I see that it will not sum the values, rather use individuals one. I will experiment locally.

Your reply only needed to be “No, didn’t test it.” However, that was evident from the fact you proposed using the Time Pattern Trigger when amelchio, one of Home Assistant’s developers, already explained it couldn’t be used to repeat every 90 minutes. Yet you proposed it anyway (10 months later). :man_shrugging:

Nowhere in the documentation does it suggest the options are additive.

i checked the code pointers, bear with me;

so, you are right, it will be triggered in next 30 minutes or next 1 hour, it will not use all parameters as a bundle.

please safely discard my messages, you are free to do, nothing enforces other way around.

The “danger” is that people will stumble across your recommendations and waste time trying to get them to work. If I ever suggest something that turns out to be wrong (not unknown :wink: ) I go back and edit the post to clarify my error (recent example).

1 Like

You are also free to delete/correct your original post to prevent misleading other people from believing your proposal works.

1 Like

i can definitely agree on this, you are right

If you agree then delete/correct your original two posts to prevent misleading other users.