Ok, sorry for the bad title but I could not figure out how to formulate myself. I have several lights where I use several separate flows that are almost identical. It checks for motion and for the time of day and the reading of a light-sensor and uses a function to transform the lux (light level) from the sensor to a dimlevel for the light-bulbs.
I have a function in all these flows and the function is the same. Is it possible to use the same function-node for all flows ? I did some testing and tried to replace all with one global function but after that all light-bulbs seamed to trigger as soon as one motion-detection happened.
Is this supposed to work somehow by checking id's or similar ?
I'm using function nodes all the time and aware on how tog grab/manage variables.
But I struggle to pass down the necessary values into a subflow
Simple example:
I have a sublfow to turn on a Lamp (LampID via variable)
The will switch ON
The lamp will wait for a specified duration (Duration via variable)
the lamp switches OFF
It works for the 1st lamp .. but whenever I try a 2nd or 3rd lamp the it forgets the previous ones .. it looks like the variables are getting overwritten every time