Script wait timeout?

Hi,

I am using a very simple homeyscript to be able to wait a variable amount of time:

await wait( args[0]*1000 ); // Seconds to ms,
return true;

It works well, when arguments are not too high (a few tens, maybe less than 100), when called with the card:
Run “script” with “argument”

However, with higher argument value, it never exits.
It is an important flow as it has to power on or off a heater that is not regulated. The regulation is done by the flow, depending on a temperature sensor.

I am testing both the success and error exits of the card, but none of them are hit when the argument is 500 for example.

Am I doing something wrong ?

Alexis

Every flow card (not just HomeyScript) has a timeout of 30 seconds (if I’m correct, could be 60) until it is being timed out.

60 is it

1 Like

Oh, I didn’t know this. This is disappointing
I guess I will have to rethink my workflow. Thanks :slight_smile:

You can consider using a timer, like Chronograph. It takes tags/variables as input,
But you’ll need an extra flow card.

When [first part of flow]
Then start Timer ‘wait’;
When timer ‘wait’ has finished,
Then continue [rest of flow]:

log:

This is perfect and works like a charm, thanks :slight_smile:

1 Like