# \[HOW-TO\]\[Pro\]\[Cloud\] - Tool to FIX (advanced) flows after removing and re-adding devices

**URL:** <https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018>\
**Category:** Tutorials\
**Tags:** zigbee, flow, homey-pro, homey-bridge, howto\
**Created:** [June 23, 2022, 12:20pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018 "2022-06-23T12:20:57Z")\
**Posts on this page:** 20\
**Page:** 6

<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:** [April 2, 2023, 8:53pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/103 "2023-04-02T20:53:34Z")

</div>

I have no idea what you’re talking about 😉

---

<div class="post-metadata">

**Author:** ![Sharkys](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sharkys/32/54029_2.png) [@Sharkys](https://community.homey.app/u/Sharkys)\
**Post date:** [April 2, 2023, 9:12pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/104 "2023-04-02T21:12:13Z")

</div>

So far based on some few examples (again dealing with sensors migrated from one app to another), seems to be running fine - kudos to your work @martijnpoppen , great it’s new API compatible - I have a feeling we will need it soon in the future 😉

---

<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:** [April 2, 2023, 9:14pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/105 "2023-04-02T21:14:08Z")

</div>

Nice! 🎉

Yeah i guess it will be released soon to all Homeys.

But before that apps should be updated (like FlowChecker etc 😉 )

---

<div class="post-metadata">

**Author:** ![Sharkys](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sharkys/32/54029_2.png) [@Sharkys](https://community.homey.app/u/Sharkys)\
**Post date:** [April 2, 2023, 10:23pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/106 "2023-04-02T22:23:26Z")

</div>

Apologies Martijn, seems that variable do not work for me…

From the flow backup itself with broken device abb773\*\*\*\*\*\*\*\* :

> value: “{{round([[homey:device:abb773be-bcb9-4a57-b384-62b6d4ee94f1|measure\_load]]/[[homey:device:bebfaf51-f347-4dce-bfd6-5425436f7517|measure\_voltage]],2)}}”

Flow with Broken variable :  
 ![obrazek](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/1/919f90c3941fa2aa94ffaeb1901015acf107724e.png)

Running it as

![obrazek](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/5/e51b9b745ced818a17e2e7968ff6427e17f64581.png)

Result - softrun TRUE:

 ![obrazek](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/9/e95a929e1c4192959cfc7948b766baeb19ecd6c5.png)

Shall be script working in such case and updating variable ?

---

<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:** [April 2, 2023, 10:40pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/107 "2023-04-02T22:40:53Z")

</div>

@Sharkys advanced flow or regular?

---

<div class="post-metadata">

**Author:** ![Sharkys](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sharkys/32/54029_2.png) [@Sharkys](https://community.homey.app/u/Sharkys)\
**Post date:** [April 3, 2023, 4:32am UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/108 "2023-04-03T04:32:43Z")

</div>

That was regular but the same I can observe even on Advanced flows - the variables also didn’t get fixed and interestingly they are also not identified during soft-run ?

---

<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:** [April 3, 2023, 7:16am UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/109 "2023-04-03T07:16:15Z")

</div>

@Sharkys for regular it’s missing i see, i’ll do the same as i did for advanced flows. Will update soon 😃

---

<div class="post-metadata">

**Author:** ![Sharkys](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sharkys/32/54029_2.png) [@Sharkys](https://community.homey.app/u/Sharkys)\
**Post date:** [April 3, 2023, 9:21am UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/110 "2023-04-03T09:21:38Z")

</div>

Thank you. But as I mentioned, even Advanced didn’t get fixed either…from the rewritten code I have no idea myself, which part of the code is actually responsible for replacing variables - eg. to throw some more details into console… 😉

---

<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:** [April 3, 2023, 9:49am UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/111 "2023-04-03T09:49:18Z")

</div>

hmm Will have a look! 😃

---

<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:** [April 14, 2023, 2:26pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/112 "2023-04-14T14:26:18Z")

</div>

@Sharkys I added the variable support to the script.

And thanks for the logging you added ! 👌

---

<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:** [April 21, 2023, 9:53am UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/113 "2023-04-21T09:53:52Z")

</div>

Script is updated with even more variable support! 😃

Thanks @Sharkys for testing

---

<div class="post-metadata">

**Author:** ![Sharkys](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sharkys/32/54029_2.png) [@Sharkys](https://community.homey.app/u/Sharkys)\
**Post date:** [May 8, 2023, 10:49am UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/114 "2023-05-08T10:49:06Z")

</div>

Hi Martijn,  
sorry for adding your more work…

```auto
Found old device ID in URI of action card in flow "Too windy put left pergola blinds down" [main.ced25ea6.chunk.js line 1 > eval:130:33](https://tools.developer.homey.app/static/js/main.ced25ea6.chunk.js line 1 > eval)

Would update flow "Too windy put left pergola blinds down" with new action:

Object { id: "41397a65-a708-478e-89af-9c841061af6c", flow: {…} }

```

I see it shall be updating…

```auto
Checking flow "Too windy put left pergola blinds down"... [main.ced25ea6.chunk.js line 1 > eval:19:17](https://tools.developer.homey.app/static/js/main.ced25ea6.chunk.js line 1 > eval)

Found old device ID in URI of action card in flow "Too windy put left pergola blinds down" [main.ced25ea6.chunk.js line 1 > eval:130:33](https://tools.developer.homey.app/static/js/main.ced25ea6.chunk.js line 1 > eval)

Updating flow "Too windy put left pergola blinds down" with new action...

```

No error happens there…but just before checking Advanced flow, I get :

```auto

Uncaught (in promise) Error: Not Found: FlowCardAction with ID homey:device:5fe7ef5f-949d-4d68-9395-9b86b28d018b:windowcoverings_set
     at /node_modules/ athombv/homey-core/lib/Flow.js:261

```

That’s the ID of removed device btw… but I’m afraid you can’t influence it as this is directly in API ?

Fixing that flow manually for now.

---

<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:** [May 8, 2023, 10:57am UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/115 "2023-05-08T10:57:51Z")

</div>

Hey @Sharkys  
That’s a strange one

Will try to reproduce that.

---

<div class="post-metadata">

**Author:** ![Sharkys](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sharkys/32/54029_2.png) [@Sharkys](https://community.homey.app/u/Sharkys)\
**Post date:** [May 8, 2023, 10:59am UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/116 "2023-05-08T10:59:59Z")

</div>

I can’t keep the flow broken for now for a day or so, to retest eventually if that will start working or now…tricky point is that also Flow checker do not work anymore and it’s not identifying those flows, so I hope I will not forget 😉

---

<div class="post-metadata">

**Author:** ![HuisCHovens](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/huischovens/32/16973_2.png) [@HuisCHovens](https://community.homey.app/u/HuisCHovens)\
**Post date:** [May 20, 2023, 12:52pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/117 "2023-05-20T12:52:58Z")

</div>

Thank you for this trick.  
It works great with my new lights 😀

---

<div class="post-metadata">

**Author:** ![Ranney](https://avatars.discourse-cdn.com/v4/letter/r/848f3c/32.png) [@Ranney](https://community.homey.app/u/Ranney)\
**Post date:** [May 20, 2023, 4:04pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/118 "2023-05-20T16:04:37Z")

</div>

Maybe that you can duplicate the flow for debugging later?

Than you can fix one and disable the other.

---

<div class="post-metadata">

**Author:** ![Arjan-21](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arjan-21/32/27181_2.png) [@Arjan-21](https://community.homey.app/u/Arjan-21)\
**Post date:** [June 4, 2023, 2:52pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/119 "2023-06-04T14:52:42Z")

</div>

Hi Martijn,  
I’ve a problem. The Tool to fix flows isn’t working anymore for me. In the concole it is replacing all the devices, but when I look in all the flows the old device is still in there. I don’t get any error message and used the script from your GitHub. (with ID)  
It’s on a HP23 and is the same for Advanced and regular flows.

There is also a bug with the triangle for broken flows. So can’t use flow checker either.

Can I help you with some additional info? I still have 80 devices to transfer, so lots of opportunities 😜

---

<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:** [June 4, 2023, 2:56pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/120 "2023-06-04T14:56:30Z")

</div>

@Arjan-21 just to check. Did you change the softRun?

---

<div class="post-metadata">

**Author:** ![Arjan-21](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arjan-21/32/27181_2.png) [@Arjan-21](https://community.homey.app/u/Arjan-21)\
**Post date:** [June 4, 2023, 3:13pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/121 "2023-06-04T15:13:07Z")

</div>

I’m sorry. It was my mistake with the softrun.  
Thank you for your help!

---

<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:** [June 5, 2023, 7:03am UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/122 "2023-06-05T07:03:27Z")

</div>

@Arjan-21 and thanks to you too! 🙂

[Previous page](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018.md?page=5)

[Next page](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018.md?page=7)
