# \[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:** 3

<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:** [October 1, 2022, 8:26pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/41 "2022-10-01T20:26:27Z")

</div>

FYI: also added a `softRun` option. This allows you to check which flows would be changed by the script without updating them yet. 🙂

---

<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:** [October 1, 2022, 9:15pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/42 "2022-10-01T21:15:14Z")

</div>

Nice feature!

The script never failed yet, but some devices are used in over 20 flows. So now it is nice to be able to save the affected flow names up front, just in case.  
Using the script with device names as alternative, is also a plus.

Thanks again, Martijn!

---

<div class="post-metadata">

**Author:** ![M\_a\_r\_c\_o](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/m_a_r_c_o/32/146_2.png) [@M\_a\_r\_c\_o](https://community.homey.app/u/M_a_r_c_o)\
**Post date:** [October 2, 2022, 11:09am UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/43 "2022-10-02T11:09:28Z")

</div>

Big hugs! Thanks!

Question, may a device name have a space in it? replace “ZL3-Verwarming” with “ZL3-Verwarming 2” seems to affect previous correct flows with “ZL3-Verwarming 2” also. The adv. flow is broken while the device was already changed by me.

These should be skipped I suppose.

---

<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:** [October 2, 2022, 11:17am UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/44 "2022-10-02T11:17:21Z")

</div>

@M_a_r_c_o the script only searches for the old Name and change it with the new one. Also it’s a exact match. So i shouldn’t affect it

---

<div class="post-metadata">

**Author:** ![aste](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/aste/32/9729_2.png) [@aste](https://community.homey.app/u/aste)\
**Post date:** [October 5, 2022, 9:13am UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/46 "2022-10-05T09:13:59Z")

</div>

> [@Peter\_Kawa](#):
>
> Note: The flows with broken variables did not fix themselves, so maybe here’s is a new challenge

Tried the script yesterday to replace some of my Shelly devices with the updated driver. The script really made life easier, thank you @martijnpoppen!

However, I stumbled across 2 issues.

1. Being the variables Peter mentioned above. They didn’t get replaced and Flow Checker didn’t seem to detect them either as a broken variable. Is it possible to modify the script to include variables?
2. For the Shelly devices, the When card “Power is below X W” and “Power is above Y W” cards did not get replaced by the script. Maybe that’s because the cards differ between the drivers?

\ Andreas

---

<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:** [October 5, 2022, 9:24am UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/47 "2022-10-05T09:24:23Z")

</div>

@aste the variables

1. i can check. Probably because the capabilities are different per driver. In that case Flowchecker will also not fail as it is not broken but a deprecated capability.

2. When cards are different they probably are not fixed properly. But i’ll verify that

---

<div class="post-metadata">

**Author:** ![Robin\_De\_Lange](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robin_de_lange/32/25173_2.png) [@Robin\_De\_Lange](https://community.homey.app/u/Robin_De_Lange)\
**Post date:** [October 13, 2022, 5:33pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/48 "2022-10-13T17:33:00Z")

</div>

will this app also work from old pro to the new pro, it seems that all of the devices has to be removed from the old one and be connected to the new one.

---

<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:** [October 13, 2022, 5:43pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/49 "2022-10-13T17:43:05Z")

</div>

@Robin_De_Lange only if theres a way to copy the flows from the old to the new…but i guess that would be possible 😃

Athom is checking for the migration as far as i know

---

<div class="post-metadata">

**Author:** ![Robin\_De\_Lange](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robin_de_lange/32/25173_2.png) [@Robin\_De\_Lange](https://community.homey.app/u/Robin_De_Lange)\
**Post date:** [October 13, 2022, 5:51pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/50 "2022-10-13T17:51:16Z")

</div>

@martijnpoppen yes i heard it, but in case that won’t work. lets hope that the migration will work, especially back ups restore.

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [October 15, 2022, 1:09pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/51 "2022-10-15T13:09:44Z")

</div>

Hey Robin and @martijnpoppen ,

You already can exchange (export/import) flows with [The Flow Exchange(r) - Exchange Your Flows with Others!](https://community.homey.app/t/the-flow-exchange-r-exchange-your-flows-with-others/68981), also on your own homey or an old homey.

If Athom will not support migration, ill make the few changes needed to fully support migration from and old to new device.

But, for a large part, The Flow Exchange(r) can already do what you want. I use it a lott to copy/paste flows that are the same for al rooms, but with different devices.

Because during import, you can replace devices (or tags or apps or rooms) very easy and all references in the flows will be changed for yours.

---

<div class="post-metadata">

**Author:** ![Robin\_De\_Lange](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robin_de_lange/32/25173_2.png) [@Robin\_De\_Lange](https://community.homey.app/u/Robin_De_Lange)\
**Post date:** [October 15, 2022, 1:57pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/52 "2022-10-15T13:57:11Z")

</div>

@Arie_J_Godschalk thanks for your answer and offcourse overtaking chronograph 👏, i allready made an link from mine flows but the most flows i have are “normal” flows. I saw somewhere that you’re on that to make that possible aswell?

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [October 15, 2022, 6:02pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/53 "2022-10-15T18:02:15Z")

</div>

> [@Robin\_De\_Lange](#):
>
> I saw somewhere that you’re on that to make that possible aswell?

Yeah but, lets put it like this: If Athom supports migration, adding default flows to TFE export is a low priority. If athom does not support migration, it gets a pretty high priority.

Chronograph rewrite to SDK3 is however a much higher priority for me either way.  
Thats is actually needed for a stable working system, be it migrated or fresh.

And personally, when i get the new Pro, i will only migrate when it is supported. Rebuilding my house, more specific, re-adding all devices, is just not something i’ll do personally.

But i will try to support people starting fresh, by adding realitief little work to The Flow Exchange(r), because most difficult work has already been done. And it’s been written with adding normal flows from the start. So yeah, if Athom does not support migration, al do my best to try to make migrations as smooth as possible through TFE.

---

<div class="post-metadata">

**Author:** ![Robin\_De\_Lange](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robin_de_lange/32/25173_2.png) [@Robin\_De\_Lange](https://community.homey.app/u/Robin_De_Lange)\
**Post date:** [October 15, 2022, 7:40pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/54 "2022-10-15T19:40:49Z")

</div>

> [@Arie\_J\_Godschalk](#):
>
> Yeah but, lets put it like this: If Athom supports migration, adding default flows to TFE export is a low priority. If athom does not support migration, it gets a pretty high priority.
> 
> Chronograph rewrite to SDK3 is however a much higher priority for me either way.  
> Thats is actually needed for a stable working system, be it migrated or fresh.

Ofcourse, i think everyone understand your priority. Another many thanks for making this happen and keep up the good work

---

<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:** [October 18, 2022, 8:33pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/55 "2022-10-18T20:33:14Z")

</div>

Hi @martijnpoppen , it this condition right ?

```auto
const softRun = true; // true | false
// Enable softRun to check which flows will be changed. 

```

The script does nothing until I set it true - I thought the meaning is different, or ?

---

<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:** [October 18, 2022, 8:52pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/56 "2022-10-18T20:52:54Z")

</div>

When it’s set to ~~false~~ TRUE, the script only outputs to the browser console, so you can see which flows are involved.

> **[How to Open the Browser Console on Chrome, Safari, Firefox, and Edge](https://appuals.com/open-browser-console/)**
>
> The most common reason why users want to open their browser console is to identify problems with page editing, broken interface elements, misbehaving

---

<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:** [October 18, 2022, 9:00pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/57 "2022-10-18T21:00:17Z")

</div>

I get it but that’s what I understand behind :

```auto
softRun = true --> only to Console
softRun = false --> real execution

```

…but reality is actually opposite. No big deal I was just wondering why it doesn’t work on first shot. 😉

---

<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:** [October 18, 2022, 9:32pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/58 "2022-10-18T21:32:49Z")

</div>

I made a mistake, sorry about that.  
It has to be:

… When it’s set to True, the script only outputs to the browser console, …

This should be right

> [@Sharkys](#):
>
> ```auto
> softRun = true --> only to Console
> softRun = false --> real execution
> 
> ```

---

<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:** [October 19, 2022, 6:26am UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/59 "2022-10-19T06:26:00Z")

</div>

Yeah that should be right indeed.  
Softrun: true is only to show what should be changed

When its false it should really excecute

---

<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:** [October 19, 2022, 9:44pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/60 "2022-10-19T21:44:00Z")

</div>

@martijnpoppen, thank you, is really the first condition alright then?

> if(softRun) { await Homey.flow.updateFlow({ id: f.id, flow: { id: f.id, trigger: trigger } }); } else { console.log(f.name, { id: f.id, flow: { id: f.id, trigger: trigger } }); }

---

<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:** [October 20, 2022, 7:06am UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/61 "2022-10-20T07:06:01Z")

</div>

@Sharkys nope your right. That one is not correct. Will update the script 🙂  
Thanks!

[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=2)

[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=4)
