It’s possible to delay automation action for example by two hours by using “- delay: 02:00:00”. It would be great if it was possible to use negative values in delay, causing action to happen before set time. That would cause automation to check triggers and conditions before given time: for example, “- delay: -02:00:00” would trigger two hours before.
For example, the user has set up time “09:00” on UI. With two hours negative delay, and if possible other conditions are met, this automation triggers at 07:00 instead.
Gilean, you are confusing a service which happens in an action or sequence (delay) with something you can apply to a trigger.
This is not the same and as you have seen on your other thread already possible.
If you already know you want it 2 hours in advance then you can offset the input time (as you currently are doing or
Trigger it two hours early and wait.
Eg I want a light to come on at a random time between 19:00 and 21: and it should stay on for random between 30 and 60 minutes
Then you trigger it at 19:00 determine how long you should wait for it to start then start it, then calc how long to run.
So Always trigger your automation at the start time, look at the temp, if it’s below x turn on, then wait an hou, if it’s below y, turn on
Or just use the examples given
Well, I did a feature request as other user encouraged me to do so… I began to think this might not work simply as negative delay, but thought that maybe something else would be implemented anyway eventually…
Ah, so basically you mean if I set up my leaving time at 10:00, then the automation triggers at 07:00 (or, ALWAYS three hours before given time) and then turns on the heater if a condition (temperature) is met, but if not, then wait for one hour and check the temperature again etc? When I think it that way, then yes, the logic must happen in trigger and not in action
In effect that was the way ALL the other suggestions were pointing you, but they are a bit less than clear as Petro knows this stuff backwards and just goes in at the deepend.
To be honest that was where I was going. You set your trigger and a mx+c graph between 0 houra and 3 hours with your temps at both ends then trigger at (say 07:00 but when can get this as you’ve seen from 10:00) and the calc says ‘wait 51 munutes before turning on’
You should continue this on the other thread as no one will vote for this. There are far too many other things we need to get done first.
I think there should be forum support for down voting, some proposals are simply ridiculous, and generally only ‘seem’ have an application in home automation if you are completely bladdered and viewed from 3.25 parsecs
Edit: in comparison, this one is reasonably sensible, but I still wouldn’t vote for it as I think I can do simple subtraction in my head.
Here is a great example where a negative delay would be super useful:
I would create an automation that is triggered when retrieving the lottery results on Saturday evening, then I would set a negative delay of say 12 hours and then have an action to send myself a notification to play those exact numbers when I’m still in the mall on Saturday morning.