# Run "Then"-cards from Homeyscript

**URL:** <https://community.homey.app/t/run-then-cards-from-homeyscript/56305>\
**Category:** Questions & Help\
**Created:** [December 10, 2021, 1:07am UTC](https://community.homey.app/t/run-then-cards-from-homeyscript/56305 "2021-12-10T01:07:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mroek](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mroek/32/38044_2.png) [@mroek](https://community.homey.app/u/mroek)\
**Post date:** [December 10, 2021, 1:07am UTC](https://community.homey.app/t/run-then-cards-from-homeyscript/56305/1 "2021-12-10T01:07:19Z")

</div>

I have the app CountDown installed, and I would like to set a timer from Homeyscript. I used the getFlowCardActions(); to find the action flow card to set a timer, which looks like this:

```auto
Start countdown timer
{
  "uri": "homey:app:nl.bevlogenheid.countdown",
  "id": "set_countdown_timer",
  "args": [
    {
      "name": "variable",
      "type": "autocomplete",
      "placeholder": "name"
    },
    {
      "name": "value",
      "type": "text",
      "placeholder": "seconds"
    }
  ]
}

```

However, I don’t really understand how to execute this flow card to start a named timer (which is already defined in the app). I tried a couple of variants, but I only managed to crash the countdown app.

Here’s an example of what I tried (which times out after 30 seconds):

```auto
await Homey.flow.runFlowCardAction({
  uri: 'homey:app:nl.bevlogenheid.countdown',
  id: 'set_countdown_timer',
  args: [
    {
      name: 'test_timer',
    },
    {
      name: '30',
    }
  ],
});

```

The goal is to set the timer called test\_timer to 30 seconds, but the script fails:

❌ Script Error  
⚠ Error: Timed out after 30000ms.  
at Timeout.\_onTimeout (/node\_modules/athom-api/dist/index.js:1:1260520)  
at listOnTimeout (internal/timers.js:549:17)  
at processTimers (internal/timers.js:492:7)

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [December 10, 2021, 6:59am UTC](https://community.homey.app/t/run-then-cards-from-homeyscript/56305/2 "2021-12-10T06:59:30Z")

</div>

I’m not very familiar with the Countdown app or calling flows from Homeyscript, but from the example scripts I would expect that `args` should look like this:

```auto
args: {
  variable: 'test_timer',
  value: '30'
}

```

And since `variable` is an autocomplete, I would also expect that the timer should already exist (but like I said, I’m not familiar with the Countdown app).

---

<div class="post-metadata">

**Author:** ![mroek](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mroek/32/38044_2.png) [@mroek](https://community.homey.app/u/mroek)\
**Post date:** [December 10, 2021, 8:08am UTC](https://community.homey.app/t/run-then-cards-from-homeyscript/56305/3 "2021-12-10T08:08:02Z")

</div>

Thanks, @robertklep. Makes sense, but it didn’t work. This is the call I tried:

```auto
await Homey.flow.runFlowCardAction({
  uri: 'homey:app:nl.bevlogenheid.countdown',
  id: 'set_countdown_timer',
  args:
    {
      variable: 'test_timer',
      value: '30'
    }
});

```

I get the same error after 30 seconds as before, unfortunately. The timer must (and does) exist before doing the call.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [December 10, 2021, 8:37am UTC](https://community.homey.app/t/run-then-cards-from-homeyscript/56305/4 "2021-12-10T08:37:31Z")

</div>

There’s a bug in the app where it will not report back errors with arguments (or rather, it will simply not return from the flow action handler unless all arguments are present and correct), which is causing the timeouts.

This should work:

```auto
args: {
  variable: { name: 'test_timer' },
  value: '30'
}

```

---

<div class="post-metadata">

**Author:** ![mroek](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mroek/32/38044_2.png) [@mroek](https://community.homey.app/u/mroek)\
**Post date:** [December 10, 2021, 8:46am UTC](https://community.homey.app/t/run-then-cards-from-homeyscript/56305/5 "2021-12-10T08:46:13Z")

</div>

I just came here to say I figured it out, and the solution is exactly what you wrote. I figured it out by creating a normal flow to update the timer, and then look at the output from Homey.flow.getFlows(); in the web api playground. There I noticed the additional indirection for the variable.

Thanks for your assistance!

---

<div class="post-metadata">

**Author:** ![Pieter\_Tack](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pieter_tack/32/31440_2.png) [@Pieter\_Tack](https://community.homey.app/u/Pieter_Tack)\
**Post date:** [March 29, 2026, 1:34pm UTC](https://community.homey.app/t/run-then-cards-from-homeyscript/56305/6 "2026-03-29T13:34:53Z")

</div>

@robertklep I’m trying this

```auto
await Homey.flow.runFlowCardAction({
  uri: 'homey:app:nl.bevlogenheid.countdown', // Example: CountDown app
  id: 'set_countdown_timer',
  args: {
    variable: { name: 'Moestuintimer' },
    value: '10'
  }
});

```

But it’s not working for me… Perhaps the API changed since last message? I’m not finding any guides either to put me in the right direction.  
Hoping someone here can help me activate a CountDown timer from HomeyScript…
