Making functions with flows?

So I have a bunch of different functions that act the same way but has to be applied to a bunch of different devices. Currently I build and test the function in one flow, then when I am happy with it I copy it to all the devices. Problem with that is first of all it’s a lot of work copying and pasting, as I have to manually go over and change all the variables and devices to the new flow, bound to make mistakes. And if I have to make changes to the function (which happens a lot) I have to make the same change multiple times.

I would like to just call a function that sets all the local variables to the global variables and devices. This way if I need to make a change I only have to do it once. And when I add a new device I just have to set the variables one time.

I know (assume*) it can be done through HomeyScript, but I don’t know how to script and was hoping it is possible through flows somehow, maybe with som apps?

You can use the “flow exchanger
You can also use it to share to yourself :slightly_smiling_face:

1 create the exchange file
2 create nthe required new variables
3 load the exchage files
4 during the load indicatie which variable needs to be replaced by which new one

What can also be usefull in this case: create “scenes”, a seperate flow that sets the devices
(See my thread “how to structure your flows”

Thhat wayyou only need to replace the “scene” flow with another.

Checkout the “Advanced triggers” app.
I use it for checking temperature.

I have created a text variable holding a JSON string: {“devivice1”:“state1”,“device2”:“state2”…}.
The flow is triggered by a “Advanced trigger” card, with the device name and the state (normal/high/low).
Then I use “JSON handler” app to find (or create) the device and take action depending on state.

I could have sent the current temperature, min-temp, max-temp and normal-temp but as I uses “becomes greater/less” I already new if it was too low/high.