How do people handle states in homey flows?
A simple example: If power of my dishwasher is below 5 it is “stopped” and above 50 it is “started”.
The way I tend to handle these now are by setting a boolean variable and then listening to that variable.
Then I have a listener for that variable and when the value changes I run various flows.
This means I have:
Flow 1: if value changed and value > 50 and foo = false; then set foo = true
Flow 2: if value changed and value < 5 and foo = true; then set foo = false
Flow 3: if variable has changed and is true; then do something
Flow 4: if variable has changed and is false; then do something
Now this works really well, but it is kind of verbose to create 4 flows and variable, especially if I have a lot of these, so is there a better way to handle these kind of scenarios?
// Michael Medin