Updated @Sharkys
Itâs odd, while I had no problem running a softRun when Martijn added the feature, so I probably didnât get what you were trying to tell
But thanks for finding a bugâ
i updated 5 of mine ikea lights, and before i removed it i took both idâs. after updating and connecting to homey i tried this script. for most of my light the script work perfect. but for 2 of my light it doesnt work. the strange thing is that 2 advanced flows doesnt work and one normale flow does work.
i tried the script with the id codes and the script with the device name. both doesnt do the job.
it is also strange that when i look at the flow, the Cart not available id is the id from my button, which one you see at the left side of the picture. but that need to be an ikea light cartâŚ
what do i wrong?
@Robin_De_Lange hard to say. It might be that the idâs were not correct or that the ID wasnât found in the flow.
You can try the softrun option which is on top of the script.
There you can see what the script will change
Thank you, I think I found the problem. I dont know why but my the button cart was switched with the light cart. maybe I didnât write the good id on my paper the first time.
the key was to switch the button id with the new light id, so my button carts are gone now and the lights carts are back. de button carts is easier to put back in the flow again by hand
Ok thats good to know.
Thatâs the drawback of the script
I had it too while testing, broke 30 flows
Is there also a way (like this script) by changing the addresses that you can pass the data from the old device to the new one (eg for the insights) otherwise you will lose your history again.
Okay, very unfortunate, but if you have a spare device so that you can replace it before removing.
Hi @martijnpoppen, would you have any idea why script do not work on anything like this (standard flow, THEN actions) ? It ussually works on almost anything⌠I wish it would be supporting also TIMER app but that probably use some else then IDs.
As you can see, device id is âebbâŚâ but using it with :
const oldIds = [âebb8843f-49a3-40e1-b5d5-c2e8a240d3c1â];
const newIds = [âNEW_IDâ];
âŚit doesnât touch that flows at allâŚ
Are you sure the New Device is the same Brand/Type/App as the Old device was?
Hmm, itâs true it was app rewrite, so for sure the condition âappâ might be not valid. I thought it will work simply based on the ID, just possibly not being functional action afterwards or partially broken. Just surprised that the script is actually not touching those at all if itâs ID based only.
Exactly, so why it keeps the old records ? Itâs true that those might be the oldest I have on my HomeyâŚ
Strange is that it always worked so far fineâŚ
Looking on the JSON export and seems to be fine for replacement if thatâs the URI part being replacedâŚ
@Sharkys when you run this script do you see any results in the console?
To open console: press Ctrl + Shift + J (or Cmd + Shift + J on a Mac).
Thanks Martijn. Hmm, I guess I have some problem with my HomeyâŚ
One problem realized, I had enabled Rebind protection to discard upstream responses containing RFC1918 addresses. - that actually seems to disabled Homey check if Homey is connected locally or via Cloud
But that didnât resolve the next :
softrun true
softrun false
(several attempts)
âŚrebooting Homey now.
I still donât get why other replacements worked before/worksâŚ
Will report back if I find anything else.
StrangeâŚtoday I was fixing another flows for another devices (I (re)moved some of my Zigbee routers ;-))) )âŚit workedâŚthen I came back to the device I originally tried to fix - again soft run is OK, but real run - getting errors :
Is the /flow/flow part right ?
await Homey.flow.updateFlow({ id: f.id, flow: { id: f.id, actions: actions } });
The script runs fine when commeting out actions part for updating actions cards�??
I will probably fix it manually but still I find it interesting.
Will have a look!
Martijn I know what is different when it doesnât work. Iâm actually trying to fix same device BUT from different app ! Itâs for sure the reason, do you think that this could be somehow adjusted for such cases ? Might be VERY useful mainly when some devs have abandoned their apps and are even not willing to transfer - it means new app is available then but as you know, with completely different IDâŚso even the device type, flows, triggers etc. are the same, script doesnât work.
Btw I will try also based on name script, if that will not resolve the issueâŚ
udpate so nope, even based on name it do not work.