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

<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:** [September 27, 2023, 6:25pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/144 "2023-09-27T18:25:02Z")

</div>

@martijnpoppen@late4marshmellow , thank you for the scripts, both work now!

when im a few days off work i will transfer/repair many devices, so then i use this script 🤣  
because i’m gonna try to change the philips hue bridge to switch from the hue app to Matter protocal en hope the delays are gone then. but i will do this when i’m free from work, otherwise my wife keeps yelling at me that “Nothing” works in our home 🙃

maybe to make it easier if its possible?, can you also search by the app that the device falls under? so for example I can see all the id’s of the devices in an overview that fall under the Hue bridge app

---

<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:** [September 27, 2023, 11:07pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/145 "2023-09-27T23:07:07Z")

</div>

> [@Robin\_De\_Lange](#):
>
> can you also search by the app that the device falls under? so for example I can see all the id’s of the devices in an overview that fall under the Hue bridge app

In Homeyscript you can run this:

```auto
// Replace "appName" with the driverURI, which is homey:app: followed by the reversed url behind /app/ in the app store URL, between the / / character ;P 
// for example: https://homey.app/nl-nl/app/nl.philips.hue/Philips-Hue/ should result in homey:app:nl.philips.hue

let appName = "homey:app:nl.philips.hue"
// end of user input

const myDevices = await Homey.devices.getDevices();
for (var iMyDevice in myDevices){
  if (myDevices[iMyDevice].driverUri == appName) {
  log(`Device:\t ${myDevices[iMyDevice].name} \nZone:\t ${myDevices[iMyDevice].zoneName}\nID:\t ${myDevices[iMyDevice].id}`)
  }
};
//if (deviceName == "") {
if (appName == "") { 
  return false
} else {
  return true;
}

```

In the Web Playground you can use this (but I don’t get it to work at the moment)  
 → replace `com.mi.flora` with `nl.philips.hue` :

> [@Developer Web API Playground - Notes of geeky oneliners](https://community.homey.app/t/developer-web-api-playground-notes-of-geeky-oneliners/24392/6):
>
> This can be shortened to promise.then(…) slight_smile Or this: Homey.devices.getDevices() .then(f =\> { return Object.values(f).filter((device) =\> device.driverUri === 'homey:app:com.mi.flora'); }) .then(devices =\> console.log(JSON.stringify(devices)));

---

<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:** [September 27, 2023, 11:18pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/146 "2023-09-27T23:18:07Z")

</div>

Thank you! that worked!  
I couldn’t resist and just transferred my hue bridge from the hue app to matter. however, there are quite a few flow cards missing which are important to me, so think I’m going to report it to athom and switch back to the hue bridge app

---

<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:** [September 28, 2023, 12:06am UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/147 "2023-09-28T00:06:44Z")

</div>

@martijnpoppen I notice when repairing the flows that he does not include the normal flows. all the advanced flows he repaired but not the normal flows.

see below, the advanced flows are the same as before because the script did this and the normale flow is not repaired.

 ![IMG_2607](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/9/49fb5add2d546716eb022fb9a737b69ca5a4a792.jpeg)  
 ![IMG_2606](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/2/62e2435b755fbb192d66b32ab0e2a2ee8d7e6d70.jpeg)

---

<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:** [September 28, 2023, 6:00am UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/148 "2023-09-28T06:00:07Z")

</div>

Try to run it multiple times, that usually works for me.

---

<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:** [September 28, 2023, 3:51pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/149 "2023-09-28T15:51:30Z")

</div>

Does this work? Because when you try it one time the id is the new id and the old id is gone right?

---

<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:** [September 28, 2023, 4:21pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/150 "2023-09-28T16:21:47Z")

</div>

Nope,just first time it might fix first occurrence, then 2nd etc. - you can’t break anything by running it multiple times

---

<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:** [September 28, 2023, 4:31pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/151 "2023-09-28T16:31:49Z")

</div>

aah oke good to know. thanks

---

<div class="post-metadata">

**Author:** ![Marius\_Stensrod](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marius_stensrod/32/56540_2.png) [@Marius\_Stensrod](https://community.homey.app/u/Marius_Stensrod)\
**Post date:** [August 1, 2024, 5:19pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/152 "2024-08-01T17:19:17Z")

</div>

@martijnpoppen , Thank you very much for making this script! Today I was reincluding my heat pump, because of the new device classes released from Athom. This script made it super easy to repair all my flows.

---

<div class="post-metadata">

**Author:** ![Sebby5](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sebby5/32/122738_2.png) [@Sebby5](https://community.homey.app/u/Sebby5)\
**Post date:** [September 29, 2024, 8:46am UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/153 "2024-09-29T08:46:33Z")

</div>

Unfortunately I have the same issue.  
Console output:

 ![Scherm­afbeelding 2024-09-29 om 10.43.42](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/1/e17a7071f4dbc4a2152649795c3c5b03402360d2.png)

Advanced flows: Succes  
Basic flows: No Succes

@martijnpoppen does it have something to do with Homey Script classic?

---

<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:** [September 29, 2024, 8:48am UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/154 "2024-09-29T08:48:57Z")

</div>

@Sebby5 by the looks you are using homeyscript.  
Please check the instructions again. This doesn’t work in homeyscript

---

<div class="post-metadata">

**Author:** ![Sebby5](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sebby5/32/122738_2.png) [@Sebby5](https://community.homey.app/u/Sebby5)\
**Post date:** [September 29, 2024, 9:03am UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/155 "2024-09-29T09:03:24Z")

</div>

> [@martijnpoppen](#):
>
> @Sebby5 by the looks you are using homeyscript.  
> Please check the instructions again. This doesn’t work in homeyscript

This was the log from the Web API playground 🙂

---

<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:** [September 29, 2024, 9:05am UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/156 "2024-09-29T09:05:01Z")

</div>

@Sebby5 sorry. Please ignore my previous message 😛

Can you give a bit more explaination what you’re trying?

Like replacing the same device or is it a different device

---

<div class="post-metadata">

**Author:** ![Sebby5](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sebby5/32/122738_2.png) [@Sebby5](https://community.homey.app/u/Sebby5)\
**Post date:** [September 29, 2024, 9:08am UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/157 "2024-09-29T09:08:56Z")

</div>

I am trying to replace TadoZones devices:

 ![Scherm­afbeelding 2024-09-29 om 11.06.30](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/3/73406b76692907f263a555326360b44a52d0aac9.png)

Which succeeded in the advance flows, but failed in the classic flows.  
I get the same error message like you get when trying to save a flow with invalid cards.

To me it looks like the script cannot succeed in replacing the Device ID’s and then saves that flow, causing the same error.

---

<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:** [September 29, 2024, 9:16am UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/158 "2024-09-29T09:16:02Z")

</div>

@Sebby5 yeah most of the time this error occurs when the devices are different from each other. So when they don’t share the same flowcards

Maybe you can paste your flow here so I can have a look

You can do that with:

> Homey.flow.getFlow({id: “flowidhere”})

You can find the flow id in the url when you open the flow in the webapp 🙂

---

<div class="post-metadata">

**Author:** ![Sebby5](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sebby5/32/122738_2.png) [@Sebby5](https://community.homey.app/u/Sebby5)\
**Post date:** [September 29, 2024, 9:25am UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/159 "2024-09-29T09:25:57Z")

</div>

Sharing the flow with the native flow sharing fails at Athom’s end.  
Here’s the code return.

```auto
{
  "id": "a3b06afb-8d21-449c-aa87-22ed6b21c31c",
  "uri": "homey:flow:a3b06afb-8d21-449c-aa87-22ed6b21c31c",
  "name": "Beganegrond Verwarmen",
  "enabled": true,
  "folder": "878e3270-5279-4994-99b4-6d219dba3265",
  "order": 136,
  "trigger": {
    "id": "homey:manager:flow:programmatic_trigger",
    "args": {}
  },
  "conditions": [],
  "actions": [
    {
      "id": "homey:device:71551d65-a4d6-41fc-aed8-1923c2aaf34b:target_temperature_set",
      "args": {
        "target_temperature": 19
      },
      "group": "then"
    },
    {
      "id": "homey:device:98261e5e-df99-4dbb-86ea-5a11f201d8bf:target_temperature_set",
      "group": "then",
      "delay": null,
      "duration": null,
      "args": {
        "target_temperature": 19
      }
    }
  ],
  "triggerable": true,
  "triggerCount": 0
}

```

---

<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:** [September 29, 2024, 10:44am UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/160 "2024-09-29T10:44:12Z")

</div>

> [@Sebby5](#):
>
> `target_temperature_set`

@Sebby5 thats a default flowcard from Athom. 😕

Can you confirm the new device has `target_temperature_set` ?

---

<div class="post-metadata">

**Author:** ![Sebby5](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sebby5/32/122738_2.png) [@Sebby5](https://community.homey.app/u/Sebby5)\
**Post date:** [September 29, 2024, 12:21pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/161 "2024-09-29T12:21:52Z")

</div>

I can confirm that:

 ![Scherm­afbeelding 2024-09-29 om 14.21.10](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/8/f86ae4cb367860c9f11a43c00b58d80dd9320ae4.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:** [October 11, 2024, 2:53pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/162 "2024-10-11T14:53:58Z")

</div>

@Sebby5 better late than never 😛

I fixed the script for the issue you had

---

<div class="post-metadata">

**Author:** ![Henk\_Renting](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/henk_renting/32/87634_2.png) [@Henk\_Renting](https://community.homey.app/u/Henk_Renting)\
**Post date:** [October 22, 2024, 3:36pm UTC](https://community.homey.app/t/how-to-pro-cloud-tool-to-fix-advanced-flows-after-removing-and-re-adding-devices/65018/163 "2024-10-22T15:36:42Z")

</div>

I have a problem in fixing basic flows as well; nothing seems to change in the flows concerned and I get the following error:

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

I am trying to change the flows by both ID and device names; same result… ☹  
It concerns the same device which I removed from Homey and re-added again.  
Doing it from Developer Tools of course and softrun is set to false.  
Both Chrome and Edge result in the same.  
Haven’t got this device in Advanced Flows, so i don’t know the result there.  
Used the latest scripts from Github and am on Homey v12.1.2 and HomeyScript app v3.6.0.

Am I doing something wrong, or can something be wrong with (the compatibility?) of the script, @martijnpoppen? I’d be glad to supply any info you might want…

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

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