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

I have no idea what you’re talking about :wink:

1 Like

So far based on some few examples (again dealing with sensors migrated from one app to another), seems to be running fine - kudos to your work @martijnpoppen , great it’s new API compatible - I have a feeling we will need it soon in the future :wink:

1 Like

Nice! :tada:

Yeah i guess it will be released soon to all Homeys.

But before that apps should be updated (like FlowChecker etc :wink: )

1 Like

Apologies Martijn, seems that variable do not work for me…

From the flow backup itself with broken device abb773******** :

value: “{{round([[homey:device:abb773be-bcb9-4a57-b384-62b6d4ee94f1|measure_load]]/[[homey:device:bebfaf51-f347-4dce-bfd6-5425436f7517|measure_voltage]],2)}}”

Flow with Broken variable :
obrazek

Running it as

obrazek

Result - softrun TRUE:

Shall be script working in such case and updating variable ?

1 Like

@Sharkys advanced flow or regular?

That was regular but the same I can observe even on Advanced flows - the variables also didn’t get fixed and interestingly they are also not identified during soft-run ?

@Sharkys for regular it’s missing i see, i’ll do the same as i did for advanced flows. Will update soon :smiley:

1 Like

Thank you. But as I mentioned, even Advanced didn’t get fixed either…from the rewritten code I have no idea myself, which part of the code is actually responsible for replacing variables - eg. to throw some more details into console… :wink:

1 Like

hmm Will have a look! :smiley:

1 Like

@Sharkys I added the variable support to the script.

And thanks for the logging you added ! :ok_hand:

2 Likes

Script is updated with even more variable support! :smiley:

Thanks @Sharkys for testing

3 Likes

Hi Martijn,
sorry for adding your more work…

Found old device ID in URI of action card in flow "Too windy put left pergola blinds down" [main.ced25ea6.chunk.js line 1 > eval:130:33](https://tools.developer.homey.app/static/js/main.ced25ea6.chunk.js line 1 > eval)

Would update flow "Too windy put left pergola blinds down" with new action:

Object { id: "41397a65-a708-478e-89af-9c841061af6c", flow: {…} }

I see it shall be updating…

Checking flow "Too windy put left pergola blinds down"... [main.ced25ea6.chunk.js line 1 > eval:19:17](https://tools.developer.homey.app/static/js/main.ced25ea6.chunk.js line 1 > eval)

Found old device ID in URI of action card in flow "Too windy put left pergola blinds down" [main.ced25ea6.chunk.js line 1 > eval:130:33](https://tools.developer.homey.app/static/js/main.ced25ea6.chunk.js line 1 > eval)

Updating flow "Too windy put left pergola blinds down" with new action...

No error happens there…but just before checking Advanced flow, I get :


Uncaught (in promise) Error: Not Found: FlowCardAction with ID homey:device:5fe7ef5f-949d-4d68-9395-9b86b28d018b:windowcoverings_set
     at /node_modules/ athombv/homey-core/lib/Flow.js:261

That’s the ID of removed device btw… but I’m afraid you can’t influence it as this is directly in API ?

Fixing that flow manually for now.

Hey @Sharkys
That’s a strange one

Will try to reproduce that.

1 Like

I can’t keep the flow broken for now for a day or so, to retest eventually if that will start working or now…tricky point is that also Flow checker do not work anymore and it’s not identifying those flows, so I hope I will not forget :wink:

1 Like

Thank you for this trick.
It works great with my new lights :grinning:

1 Like

Maybe that you can duplicate the flow for debugging later?

Than you can fix one and disable the other.

Hi Martijn,
I’ve a problem. The Tool to fix flows isn’t working anymore for me. In the concole it is replacing all the devices, but when I look in all the flows the old device is still in there. I don’t get any error message and used the script from your GitHub. (with ID)
It’s on a HP23 and is the same for Advanced and regular flows.

There is also a bug with the triangle for broken flows. So can’t use flow checker either.

Can I help you with some additional info? I still have 80 devices to transfer, so lots of opportunities :stuck_out_tongue_winking_eye:

@Arjan-21 just to check. Did you change the softRun?

I’m sorry. It was my mistake with the softrun.
Thank you for your help!

1 Like

@Arjan-21 and thanks to you too! :slight_smile:

1 Like