# An Advanced Flow to re-enable a Flow, passing the flow ID/Name

**URL:** <https://community.homey.app/t/an-advanced-flow-to-re-enable-a-flow-passing-the-flow-id-name/158643>\
**Category:** Questions & Help\
**Tags:** advancedflow\
**Created:** [August 22, 2026, 5:51pm UTC](https://community.homey.app/t/an-advanced-flow-to-re-enable-a-flow-passing-the-flow-id-name/158643 "2026-08-22T17:51:26Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Drako74](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/drako74/32/150506_2.png) [@Drako74](https://community.homey.app/u/Drako74)\
**Post date:** [August 22, 2026, 5:51pm UTC](https://community.homey.app/t/an-advanced-flow-to-re-enable-a-flow-passing-the-flow-id-name/158643/1 "2026-08-22T17:51:26Z")

</div>

Hi all,

Can I please ask for assistance from anyone smarter than me, cos I’m stumped.  
The Flow Checker app (highly recommended BTW) can detect and return the name & ID of disabled flows. I have a few flows that can be disabled by the press of a Zigbee button. For example if you want to override the turning off of a light by a presence sensor to keep it on while you are in and out of a room.

Trying to be clever, I thought I could create a flow using Flow Checker to send a question via Push to my mobile, asking if I wanted to re-enable a flow, then pass the flows ID to the Then action card Enable Flow, to re-enable a detected disabled flow.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/2/52d092fde8270528724a2bf05bb45dfb21776160.png)

But you can’t use the values of the tags Flow & ID returned by the Flow Checker “is disabled” card to specify which Flow you want to enable. A Homey shortfall to be sure, but I was hoping someone might have an idea for a way around it???

Much appreciation and thanks

.

.

EDIT:

@martijnpoppen as it’s your awesome Flow Checker app I’m using here, do you have any ideas how I might accomplish this (and yes I use a number of your apps, cos they’re all brilliant and very useful ⭐ )

---

<div class="post-metadata">

**Author:** ![martijnpoppen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/martijnpoppen/32/84849_2.png) [@martijnpoppen](https://community.homey.app/u/martijnpoppen)\
**Post date:** [August 22, 2026, 6:55pm UTC](https://community.homey.app/t/an-advanced-flow-to-re-enable-a-flow-passing-the-flow-id-name/158643/2 "2026-08-22T18:55:24Z")

</div>

@Drako74 use a HomeyScript 😃 and provde the tags to it.

```auto
// args[0] = flow ID passed in from the Flow card
const flowId = args[0];
const enable = args[1] === 'true'; // pass 'true'/'false' as second arg, or use a boolean tag

const flows = await Homey.flow.getFlows();
const advancedFlows = await Homey.flow.getAdvancedFlows();
const flow = flows[flowId] || advancedFlows[flowId];

if (!flow) {
  log(`Flow with ID ${flowId} not found`);
} else {
  if (flows[flowId]) {
    await Homey.flow.updateFlow({ id: flowId, flow: { enabled: enable } });
  } else {
    await Homey.flow.updateAdvancedFlow({ id: flowId, advancedFlow: { enabled: enable } });
  }
  log(`Flow "${flow.name}" ${enable ? 'enabled' : 'disabled'}`);
}

```

---

<div class="post-metadata">

**Author:** ![Drako74](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/drako74/32/150506_2.png) [@Drako74](https://community.homey.app/u/Drako74)\
**Post date:** [August 22, 2026, 11:32pm UTC](https://community.homey.app/t/an-advanced-flow-to-re-enable-a-flow-passing-the-flow-id-name/158643/3 "2026-08-22T23:32:20Z")

</div>

@martijnpoppen as usual you are a legend sir, I doff my hat to you.

It might take me a little time to get my thick head around that, so I can make my advanced flow work the way I want it… but nonetheless I am extremely grateful and appreciative of your knowledge and expertise. The Homey Wizard 🧙 Thank you

---

<div class="post-metadata">

**Author:** ![Drako74](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/drako74/32/150506_2.png) [@Drako74](https://community.homey.app/u/Drako74)\
**Post date:** [August 23, 2026, 8:16am UTC](https://community.homey.app/t/an-advanced-flow-to-re-enable-a-flow-passing-the-flow-id-name/158643/4 "2026-08-23T08:16:10Z")

</div>

Unfortunately my Homey (Java) Script understanding is almost non-existent, and I couldn’t get it to work. Just kept returning the error “Missing Parameter: advancedflow” and I can’t figure out how to fix it

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/2/2234fc8479de2f253899b8a9575263af269789d0.png)

---

<div class="post-metadata">

**Author:** ![smarthomesven](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/smarthomesven/32/79712_2.png) [@smarthomesven](https://community.homey.app/u/smarthomesven)\
**Post date:** [August 23, 2026, 11:58am UTC](https://community.homey.app/t/an-advanced-flow-to-re-enable-a-flow-passing-the-flow-id-name/158643/5 "2026-08-23T11:58:55Z")

</div>

Not a fix, but do you know that instead of asking “Y/N”, you can also use the “Confirm” condition card?

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/b/1b6ffe9ac80d6017029c1a329d9e57c696f12056.png)

Then you get yes/no buttons in the notification

---

<div class="post-metadata">

**Author:** ![Drako74](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/drako74/32/150506_2.png) [@Drako74](https://community.homey.app/u/Drako74)\
**Post date:** [August 23, 2026, 12:29pm UTC](https://community.homey.app/t/an-advanced-flow-to-re-enable-a-flow-passing-the-flow-id-name/158643/6 "2026-08-23T12:29:47Z")

</div>

> [@smarthomesven](#):
>
> do you know that instead of asking “Y/N”, you can also use the “Confirm” condition card?

I hadn’t seen that before… but now you’ve mentioned it I went looking for it, thank you 👍🏼

But yes, I still can’t get the script part to work… been scratching my head for hours, but I think it’s just over my head 😞 oh well

---

<div class="post-metadata">

**Author:** ![smarthomesven](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/smarthomesven/32/79712_2.png) [@smarthomesven](https://community.homey.app/u/smarthomesven)\
**Post date:** [August 23, 2026, 12:33pm UTC](https://community.homey.app/t/an-advanced-flow-to-re-enable-a-flow-passing-the-flow-id-name/158643/7 "2026-08-23T12:33:58Z")

</div>

Can you share the non-working script? So copy it exactly from the HomeyScript card

---

<div class="post-metadata">

**Author:** ![martijnpoppen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/martijnpoppen/32/84849_2.png) [@martijnpoppen](https://community.homey.app/u/martijnpoppen)\
**Post date:** [August 23, 2026, 12:35pm UTC](https://community.homey.app/t/an-advanced-flow-to-re-enable-a-flow-passing-the-flow-id-name/158643/8 "2026-08-23T12:35:11Z")

</div>

@Drako74  
sorry small change:

```js
const flowId = args[0];
const enable = true;

const flows = await Homey.flow.getFlows();
const advancedFlows = await Homey.flow.getAdvancedFlows();
const flow = flows[flowId] || advancedFlows[flowId];

if (!flow) {
  log(`Flow with ID ${flowId} not found`);
} else {
  if (flows[flowId]) {
    await Homey.flow.updateFlow({ id: flowId, flow: { enabled: enable } });
  } else {
    await Homey.flow.updateAdvancedFlow({ id: flowId, advancedFlow: { enabled: enable } });
  }
  log(`Flow "${flow.name}" ${enable ? 'enabled' : 'disabled'}`);
}

```

try like this:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/c/dc191b4a04ad168d3e41018aea0a1d684cd295c8.png)

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

and if you want a disable flow you create a additional script

---

<div class="post-metadata">

**Author:** ![Drako74](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/drako74/32/150506_2.png) [@Drako74](https://community.homey.app/u/Drako74)\
**Post date:** [August 23, 2026, 12:41pm UTC](https://community.homey.app/t/an-advanced-flow-to-re-enable-a-flow-passing-the-flow-id-name/158643/9 "2026-08-23T12:41:33Z")

</div>

Thank you. Tried the revised script code, still gives error about advanced flow.

This is the advanced flow:

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

This is the full error it returns:

```auto
❌ Script Error

```

```auto
⚠️ Error: Missing Parameter: advancedflow
    at ManagerFlow.value (/app/node_modules/homey-api/lib/HomeyAPI/HomeyAPIV3/Manager.js:192:27)
    at Test.js:14:22
    at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
    at async HomeyScriptApp.runScript (/app/app.js:364:22)
    at async /app/lib/flow/actions/RunCodeWithArgAction.js:29:9

```

```auto
{"message":"Missing Parameter: advancedflow"}

```

Also tried it like this, but get the same error:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/d/0d5ac4631281621669159901c6a0b02c481762fb.png)

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/4/b4a7111912324a92ff9fcf09afb5f864708300d6.png)

---

<div class="post-metadata">

**Author:** ![Drako74](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/drako74/32/150506_2.png) [@Drako74](https://community.homey.app/u/Drako74)\
**Post date:** [August 23, 2026, 1:04pm UTC](https://community.homey.app/t/an-advanced-flow-to-re-enable-a-flow-passing-the-flow-id-name/158643/10 "2026-08-23T13:04:54Z")

</div>

This is the whole thingymajig I am trying to achieve. This is the last part to get working as desired, if it’s possible.

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

---

<div class="post-metadata">

**Author:** ![martijnpoppen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/martijnpoppen/32/84849_2.png) [@martijnpoppen](https://community.homey.app/u/martijnpoppen)\
**Post date:** [August 23, 2026, 1:13pm UTC](https://community.homey.app/t/an-advanced-flow-to-re-enable-a-flow-passing-the-flow-id-name/158643/11 "2026-08-23T13:13:49Z")

</div>

@Drako74  
Ah typo from my side

```js
const flowId = args[0];
const enable = true;

const flows = await Homey.flow.getFlows();
const advancedFlows = await Homey.flow.getAdvancedFlows();
const flow = flows[flowId] || advancedFlows[flowId];

if (!flow) {
  log(`Flow with ID ${flowId} not found`);
} else {
  if (flows[flowId]) {
    await Homey.flow.updateFlow({ id: flowId, flow: { enabled: enable } });
  } else {
    await Homey.flow.updateAdvancedFlow({ id: flowId, advancedflow: { enabled: enable } });
  }
  log(`Flow "${flow.name}" ${enable ? 'enabled' : 'disabled'}`);
}

```

---

<div class="post-metadata">

**Author:** ![Drako74](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/drako74/32/150506_2.png) [@Drako74](https://community.homey.app/u/Drako74)\
**Post date:** [August 23, 2026, 2:32pm UTC](https://community.homey.app/t/an-advanced-flow-to-re-enable-a-flow-passing-the-flow-id-name/158643/12 "2026-08-23T14:32:10Z")

</div>

I’ll give it another try when I get home… just visiting my mum after surgery… I’ll let you know how I get on soon as had chance to try it. Thank you, your expertise and assistance are very much appreciated 😊🤘🏼

---

<div class="post-metadata">

**Author:** ![Drako74](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/drako74/32/150506_2.png) [@Drako74](https://community.homey.app/u/Drako74)\
**Post date:** [August 24, 2026, 12:35am UTC](https://community.homey.app/t/an-advanced-flow-to-re-enable-a-flow-passing-the-flow-id-name/158643/13 "2026-08-24T00:35:32Z")

</div>

You sir are a leg-end… finally got it working 😃😃😃

Breathes a sigh of relief, that is awesome, truly awesome. Thank you!

.

And thank you @smarthomesven for the tip on the response card… I’m going to create a 💩 tone of flows using that now, just cos I can 🤪

Thank you kindly gentlemen for your valued assistance.
