Script with long wait executes fine but gives error

I have a script that acts as a TV standby killer. When the measured power from a fibaro plug falls below 15 watt, the scripts activates a homeyscript. This script reads the logic variables and seeks the fgs 222 relay from which the TV and audio equipment is powered. To make sure the power stays at 15 watt for 10 minutes, to avoid unwanted power off, the script has a waiting time of 10 minutes and then powers the fgs 222 off if the power consumption is indeed still below 15 watt.
It logs the result back to the flow, that sends me a mail of the result.
It works fine, the only thing is that the flow ends in an error, where you would expect a succes. I have send a mail from the success output as well as the error output.
I have also tested the script stand alone, and that results without error.
When I decrease the waiting time to 10 seconds, the flow ends in success.
The error has to do with the waiting time of 15 minutes, it looks like the flow has some kind of timeout or something.
Any ideas or similar experiences ?
Also I would like some kind of logfile where you can see the output from console.log and flow errors, is there a way to make that happen. A kind of windows event log, for homey. I am familiar with, but did not find it there.
Thanks for your ideas.

Flow cards have a hard limit of 30 second before it timesout (also a fail), so this is expected.

1 Like

You can use a Chronograph timer instead.
This doesn’t “hold” the current flow, but starts a second one instead. So you can set virtually any delay time.

power TV changed
power TV is less than 15W
start or replace timer X with a delay time of 10 minutes
Pause timer X

timer X has finished
Send notification “TV standby succes”

Using a chrono timer that sets of a second flow. Didn’t think of that. Thanks for the suggestion.

1 Like