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
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
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.
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).
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 ) I go back and edit the post to clarify my error (recent example).
You are also free to delete/correct your original post to prevent misleading other people from believing your proposal works.
i can definitely agree on this, you are right
If you agree then delete/correct your original two posts to prevent misleading other users.
all other people, I will continue to post with good intentions and propose possible solutions. I do not have any enforcement to update/delete any historical messages. Enjoy your Friday and relax.
This might have issues when there is downtime happening like updating hass or electric outage. Rather than taking mod, i would go with greater comparison.