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

@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 :rofl:
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 :upside_down_face:

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

1 Like

In Homeyscript you can run this:

// 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 :

2 Likes

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

3 Likes

@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.


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

2 Likes

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

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

2 Likes

aah oke good to know. thanks