# Script wait timeout?

**URL:** <https://community.homey.app/t/script-wait-timeout/95454>\
**Category:** Apps\
**Tags:** homeyscript\
**Created:** [November 22, 2023, 5:39pm UTC](https://community.homey.app/t/script-wait-timeout/95454 "2023-11-22T17:39:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greuh](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/greuh/32/79007_2.png) [@Greuh](https://community.homey.app/u/Greuh)\
**Post date:** [November 22, 2023, 5:39pm UTC](https://community.homey.app/t/script-wait-timeout/95454/1 "2023-11-22T17:39:00Z")

</div>

Hi,

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

```auto
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.

 ![Presse-papiers-1](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/c/bc8e9aad52df98242f9705cef4dd25ba61443033.png)

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

---

<div class="post-metadata">

**Author:** ![Caseda](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/caseda/32/138695_2.png) [@Caseda](https://community.homey.app/u/Caseda)\
**Post date:** [November 22, 2023, 5:47pm UTC](https://community.homey.app/t/script-wait-timeout/95454/2 "2023-11-22T17:47:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)\
**Post date:** [November 22, 2023, 6:00pm UTC](https://community.homey.app/t/script-wait-timeout/95454/3 "2023-11-22T18:00:39Z")

</div>

> [@Caseda](#):
>
> has a timeout of 30 seconds (if I’m correct, could be 60)

60 is it

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/7/a74106269d4a639b6443715e656114b113444e89.png)

---

<div class="post-metadata">

**Author:** ![Greuh](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/greuh/32/79007_2.png) [@Greuh](https://community.homey.app/u/Greuh)\
**Post date:** [November 22, 2023, 6:43pm UTC](https://community.homey.app/t/script-wait-timeout/95454/4 "2023-11-22T18:43:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [November 23, 2023, 5:14am UTC](https://community.homey.app/t/script-wait-timeout/95454/5 "2023-11-23T05:14:24Z")

</div>

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]:

 ![Screenshot from 2023-11-23 06-02-03](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/2/3208929d20d180eef830c10389c7ccbc7830c93a.png)

log:

 ![Screenshot from 2023-11-23 06-09-11](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/7/87eb6802f6622ddf49dd68283119c864b1e1e1ec.png)

---

<div class="post-metadata">

**Author:** ![Greuh](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/greuh/32/79007_2.png) [@Greuh](https://community.homey.app/u/Greuh)\
**Post date:** [November 23, 2023, 7:07pm UTC](https://community.homey.app/t/script-wait-timeout/95454/6 "2023-11-23T19:07:22Z")

</div>

This is perfect and works like a charm, thanks 🙂
