Get timer event scheduled time

I have a timer event based on temperature. So if temperature changes, the event would trigger sooner or later… but if the trigger time get sooner while this time already passed, it won’t trigger so I would like to catch it and started the event automatically when this happens…
Is there a way to know the scheduled time for a specific timer event? I have another time event in the same piston.
Thanks!

You could capture the next run time in a variable, maybe. So, if temperature triggers a 1 hour timer, set a "timerExpire" variable to be $now+3600000 (milliseconds in an hour). You can always do the math to see how much time is left. (timerExpire-$now)/60000 will give you minutes left.

I have a timer for my garage door that closes 8 minutes after it has been opened automatically. For that I use a loop that subtracts 1 from the timer's initial setting, then waits a minute and does it again. When the timer variable reaches 0, it closes the door. On my dashboard it shows a time to close like "<3 min" so we know how much time is left. It only updates once per minute, though.

1 Like

Dang, now I'm rethinking how I do my garage timer. A quick test piston works perfectly. Is running a loop once per second to update a variable too much? :thinking:

I have think on this last night and since the timer event is working on its own, I dont think I could get the trigger time from outside, but the trigger time is calculated from outside because its related to a variable...
I have check to replace the timer by a if trigger but I only can use every day at and if the time change, it wont schedule again so not working...
I think I could keep the timer and add a time variable that store the time of next event and if the @temp change, it trigger an event that check if that time is pass and if so trigger the action...

So I ll have the timer event, and another trigger from the global variable change (temperature) so if temp drop below x then if time is later then trigger time & engine is off then start engine...

Webcore is still a great thing but sometimes it needs a lot of workaround to cover all case! But it have a lot of functions so its always possible...

To awnser your question, actually my timer event is still running every minutes BUT with restrictions based on time. I wish the event to send the signal to my alexa to ask me if I want to start my car. If I say yes, it start the car (api). So I want the event to run only during school day and in the 7 am hour or 2pm hour.
So in the restriction I made it only during these hour and in the action I said only if the $minute == variable and the variable is an array with 3 values. so according to temp. so if its below -5 it return the first value (20) between -5 and 15 it return the second one (25) and if not the 3rd one (30). So if its cold the car will run longer for defrosting.

So if the temp is -4 the trigger would be 2:25 but if at 2:22 the temp drop to -6 the trigger will be 2:20 but its too late so it wont trigger. So with my event, the drop below will trigger and check those time and trigger the event if needed... The only thing is that it wont be automatic...