Hey Martijn,
Using the webapi playground, nothing happend. Using the method as described, it works.
I can not explain and will look soon again to webapi playground again, but for the moment glad that I could fix it my way.
Apparently somehow HS indeed has some new permissions, because the scripts never worked with HS. I’ve to admit I tested it once when the script was just published back in '22.
“Meten is weten” (a Dutch saying): I just tested with a Homeyscript and it managed to replace a device in standard+adv. flows.
Note: the other script, fix-flows-by-name.js also works @ Homeyscript.
Note 2:
Both scripts still work fine @ Web API Playground…
.
@sschot Steven, the reason why you didn’t see anything @ Playground:
When running the script with the softRun option set to true: you have to open the browser’s console to view the script logs;
Otherwise nothing happens onscreen, except “Request took xxxms”
It’s mentioned right below the true/false setting: // Open the console in your browser and the result will be shown there // Howto open console: https://balsamiq.com/support/faqs/browserconsole/
Maybe run it using Playground and share screenshot from developer console from the Browser - eg. those showing some errors, that would also understand this better.
I can confirm that it works in the Homey script. I created the script, entered the device ID or name, set it to false, saved it, and when you run the test within the script, it changes the flows where this device is connected. No need to do anything else.
Nice work .
This looks exactly what i want but i can´t seem to get it to work. I first tried with my heatpump to no avail, so now I´m experimenting with two virtual devices, that wouldn´t make a difference right? (They are same type and functions).
Collected the ID´s of the respective unit and pasted the “raw” version of the script from github. When running softRun = true i get no errors and it shows the simple flow it´s going to change but when changing to false, i get errors. Not sure what to do now, hope someone can help
Ah, ok. Will try to search for other options. Now i saw …FIX (advanced) flows… on the headline. Does this only fix advanced flows? Those i tried were simple flows
Hi @martijnpoppen, yesterday I used your script for the first time. It worked great (after switching softRun from true to false… ) and it’s so much helpful! Thank you very much!
Thanks for this great script. I have asked for that and it looks a lot of people are happy. Since I am not a programmer and I must say a bit overwhelmed by this script a question. Did anybody asked Athom if there is an option to build this into the software? Or does anybody from Athom reads this and is willing to help less IT software programming people?
@Ringler I think Athom is aware of this script and a lot of people have asked for such a feature. Until today there’s no alternative for this.
I understand that you might be overwhelmed by the script. However you only need to add 2 ID’s and change one field from true to false to let this script function.
Dear Martijnpoppen. Thanks for your reply. Yes, I think I should be able to use the script. Have already read through and could use it. What, and looks like I am the only one not understanding this, I was more wondering is the sequence of deleting the devices:
Write down the Device ID
Remove the Device
Re-add the Device
Get the Device ID of the new paired device
Bullet point 3 and 4. Do I need to delete the old device and add the old device again (or what means re-add?)
Sorry for that probably dumb question. Can you help? Thanks a lot
@Ringler It depends on your situation of coruse. but some apps don’t allow you to add the same device multiple times to the same Homey.
So let’s take the following example.
We have a light bulb connected to homey but it doesn’t work anymore. So first we are going to get the device ID of this device. Then we remove the device from Homey. Flows will be broken after that.
Now we’re going to add the same device back to Homey (via the normal add device option in the app) and once it’s added we write down the id of this device.
Sorry. I feel too stupid. I delete the old device, then I add it again and I also add the new device? And then I run the script and then I delete the old device again? It is just a bit odd to me to add the old device again after I have deleted it (because I want to replace it with the new one). But if that sequence is required I would do so. Die I understand it correct. Sorry, for my confusion.