The time trigger pattern only checks if the current time resembles the value of hour, minute and second and therefore can only be set to from 0-23 for hour.
If you want to set it every 48 hours, you probably have to use some sort of condition template.
thank you! I understand it how. I was confused by the documentation and some guides I saw. There is a way apparently to set an automation with the time pattern where you write “/5” for example in the minute section and that means every 5 minutes.
In my mind setting “/48” in the hour section made sense it meant every 48 hours but apparently not.
Oh yeah, I actually didn’t consider you were using the “/”. I think it can only look in the timeframe of 24 hours. But I understand your question better now.
But a trigger of /48, which means every 48 hours doesn’t really makes sense I guess, because it is 48 hours relative of what?
minutes: /5 means on minute 0, 5, 10 etcetera. hours: /2 means on hour 0, 2, 4 …
So always relative to 0 and then added with the /value. I guess they could have set 0, 48, 96 hours. But then you are running something always at 0.00 AM. That makes a lot less sense than every 2 hours during a day.
For future reference, whenever you restart Home Assistant, or execute Reload Automations, all automations are restarted. That means any automation that was in progress is terminated and re-initialized.
If you use the Automation Editor to compose/modify automations, the moment you click its Save button will cause it to execute Reload Automations.
As for the Time Pattern Trigger, its options are all relative. For example, hours represents hours of the current day (0-23), minutes represents minutes of the current hour (0-59), etc.
Your proposed days option presents a problem because it would be relative to the current year but every year doesn’t have the same number of days.
how about an extra parameter to specify the referencce point? for example if you want every 2 days, specify starting from say 1st of June 2022. Then after a restart it will read the starting point and it will know where it is.
sorry for the silence! I have managed to burn the water valve (my mistake) and now I am waiting for a replacement and I will test out the proposed solutions!
I may have done something wrong because the automations didn’t start with your implementation. Do you mind looking at the following settings and see what is wrong?
I would never suggest to do what you have done (i.e have one automation turn on/off other automations). My posted example turns a switch on/off.
There’s no reason to turn on/off the two automations. Just add the Template Condition, that I had suggested two months ago, to each automation so that it will execute its actions every two days.
(In addition, as paddy0174 already mentioned, your example misspells iif)
ok I am changing things and following your advice. I have made a small example with your automation but I get an error when I test the condition. I have copied and pasted your automation and when I switch to the visual editor in the condition section I get the test button. When I press it I get the following error:
template value should be a string for dictionary value @ data['value_template']. Got None
I copy and paste your entire automation in a new automation using the yaml editing method (I cannot create it using the UI editor ) and I press save and it changes to what I have and I get the error I mentioned.
What should I do?