If you want to replace the old device with an other (new) device, it’s the same procedure:
“Say 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 a new light bulb 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.”
Ok. Thanks a lot for this clarification. The way you write makes sense to me. For me bullet point 4 was unclear as it says re-add the device after I have removed it. So bullet point 4 is actually adding the new device.
- Write down the Device ID
- Remove the Device
- Re-add the Device
- Get the Device ID of the new paired device
I will try it out. Thanks a lot again for all your help.
Update: I have tried it and it did not work. No idea, what I do wrong, but following the 5 steps, deleting the old one, adding the new and copying the script to the “Web API Playground” in the Dev Environment (adding there the two device IDs as described) does not work. The old device is now deleted and the flows are broken. I think this is really only something for programmers…
You do not always replace an “old” device with a newly purchased device.
Sometimes a device that has been working for 2 years without any problems stops working after an app update or a Homey firmware update, for example.
Even then, you can delete this “old” device after noted the device ID and add this “old” device again.
Have you set the parameter const softRun
from true
to false
in line 6 of the code? Because only then will the flows be repaired.
Initial state
// Set the softRun variable to true or false to determine whether changes should be logged or actually executed
const softRun = true; // true | false
After change
// Set the softRun variable to true or false to determine whether changes should be logged or actually executed
const softRun = false; // true | false
If softRun
is set to true
, the replacement of the device will be only simulated. This can be checked in the web browser console. But this is maybe a bit more for programmers.
I hope this was helpful for you.
@martijnpoppen, does the script in Developer Tools/Web Api Playground have to be executed in a specific web browser? Safari, for example, is not suitable for many similar things.
@DirkG I would recommend Chrome or Firefox
It now runs in Homeyscript as well, Dirk.