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

FYI: also added a softRun option. This allows you to check which flows would be changed by the script without updating them yet. :slight_smile:

5 Likes

Nice feature!

The script never failed yet, but some devices are used in over 20 flows. So now it is nice to be able to save the affected flow names up front, just in case.
Using the script with device names as alternative, is also a plus.

Thanks again, Martijn!

1 Like

Big hugs! Thanks!

Question, may a device name have a space in it? replace “ZL3-Verwarming” with “ZL3-Verwarming 2” seems to affect previous correct flows with “ZL3-Verwarming 2” also. The adv. flow is broken while the device was already changed by me.

These should be skipped I suppose.

@M_a_r_c_o the script only searches for the old Name and change it with the new one. Also it’s a exact match. So i shouldn’t affect it

Tried the script yesterday to replace some of my Shelly devices with the updated driver. The script really made life easier, thank you @martijnpoppen!

However, I stumbled across 2 issues.

  1. Being the variables Peter mentioned above. They didn’t get replaced and Flow Checker didn’t seem to detect them either as a broken variable. Is it possible to modify the script to include variables?
  2. For the Shelly devices, the When card “Power is below X W” and “Power is above Y W” cards did not get replaced by the script. Maybe that’s because the cards differ between the drivers?

\ Andreas

1 Like

@aste the variables

  1. i can check. Probably because the capabilities are different per driver. In that case Flowchecker will also not fail as it is not broken but a deprecated capability.

  2. When cards are different they probably are not fixed properly. But i’ll verify that

will this app also work from old pro to the new pro, it seems that all of the devices has to be removed from the old one and be connected to the new one.

1 Like

@Robin_De_Lange only if theres a way to copy the flows from the old to the new…but i guess that would be possible :smiley:

Athom is checking for the migration as far as i know

@martijnpoppen yes i heard it, but in case that won’t work. lets hope that the migration will work, especially back ups restore.

1 Like

Hey Robin and @martijnpoppen ,

You already can exchange (export/import) flows with The Flow Exchange(r) - Exchange Your Flows with Others!, also on your own homey or an old homey.

If Athom will not support migration, ill make the few changes needed to fully support migration from and old to new device.

But, for a large part, The Flow Exchange(r) can already do what you want. I use it a lott to copy/paste flows that are the same for al rooms, but with different devices.

Because during import, you can replace devices (or tags or apps or rooms) very easy and all references in the flows will be changed for yours.

3 Likes

@Arie_J_Godschalk thanks for your answer and offcourse overtaking chronograph :clap:, i allready made an link from mine flows but the most flows i have are “normal” flows. I saw somewhere that you’re on that to make that possible aswell?

Yeah but, lets put it like this: If Athom supports migration, adding default flows to TFE export is a low priority. If athom does not support migration, it gets a pretty high priority.

Chronograph rewrite to SDK3 is however a much higher priority for me either way.
Thats is actually needed for a stable working system, be it migrated or fresh.

And personally, when i get the new Pro, i will only migrate when it is supported. Rebuilding my house, more specific, re-adding all devices, is just not something i’ll do personally.

But i will try to support people starting fresh, by adding realitief little work to The Flow Exchange(r), because most difficult work has already been done. And it’s been written with adding normal flows from the start. So yeah, if Athom does not support migration, al do my best to try to make migrations as smooth as possible through TFE.

2 Likes

Ofcourse, i think everyone understand your priority. Another many thanks for making this happen and keep up the good work

2 Likes

Hi @martijnpoppen , it this condition right ?

const softRun = true; // true | false
// Enable softRun to check which flows will be changed. 

The script does nothing until I set it true - I thought the meaning is different, or ?

When it’s set to falseTRUE, the script only outputs to the browser console, so you can see which flows are involved.

2 Likes

I get it but that’s what I understand behind :

softRun = true  --> only to Console
softRun = false --> real execution

…but reality is actually opposite. No big deal I was just wondering why it doesn’t work on first shot. :wink:

I made a mistake, sorry about that.
It has to be:

… When it’s set to True, the script only outputs to the browser console, …

This should be right

Yeah that should be right indeed.
Softrun: true is only to show what should be changed

When its false it should really excecute

1 Like

@martijnpoppen, thank you, is really the first condition alright then?

if(softRun) { await Homey.flow.updateFlow({ id: f.id, flow: { id: f.id, trigger: trigger } }); } else { console.log(f.name, { id: f.id, flow: { id: f.id, trigger: trigger } }); }

2 Likes

@Sharkys nope your right. That one is not correct. Will update the script :slight_smile:
Thanks!

1 Like