Started playing around with AF and like it a lot!
But I have a question on how to elegantly incorporate a “run only once” functionality in an AF.
I would like to start the living fan when the temperature in the living room reaches let’s say 22°C. The fan will turn on and start a delay block of 120 minutes. Then the fan will turn off again.
BUT now the flow starts itself multiple times a day when the temperature sensor readout goes below 22° and then above 22° again.
Is there a way to create something in the AF that tells the flow to only run once a day?
Wow thanks Ronald, that’s a really good way to do it!
Thanks for the help and the visual aid!
If you want to get advanced, I’d recommend getting the CountDown app and using that instead of the 120 min delay. It might absolutely be more than good enough to use a delay in this case, but this might be a fun addition that can lead to more advanced flows. Like so:
Actually, there are more than one “count downs” in store and at least some of them may add additional functionality. For example to stay alive over reboots. Sorry, not sure, what’s about the AF’s “sleep 120” (good, if it also wakes up after reboot, but suspecting - no).
Also some count-downs have possibility to check the timer’s status - useful, when for some nasty reason arises need to see how long the fan is planning to run.
PS. Those are additional features, and really not needed, if the AF’s built in functionality is sufficient for You. Why to change/mess with working system
So, there are two reasons for me bringing them up, and both are somewhat advanced, which is why I did say that for this simple flow, it is likely overkill. However, if I made this flow, I’d make it this way. Here’s why:
It’s generally much stronger programmatically to move something to be asynchronous instead of using a synchronous sleep for more than a few seconds (in the case of Homey). Leaving a flow hanging to wait for two hours is normally undesired in programming. However, I’m sure Homey makes the call asynchronous behind the scenes for us, so this is more of a approach to the issue than it is a technical limitation.
It opens up for better ways to make flows, and more advanced ways. You can more easily test the condition, or you can really simply make every trigger of “when temperature is greater than 22” restart the timer, to make the flow work so that the fan is on for two hours after the last time the temp went over 22. Of course, that may not be desirable, but it opens up for such possibilities. In addition, you can adjust the timer itself for testing purposes, or whatever other reason you might have.
So while it makes this exact flow more cluttered, it’s worth knowing about, which is why I brought it up
Thanks for the replies guys, really appreciated!
BUT: I have a new problem with this… Now it’s getting hotter: the “temp become greater then” does not work anymore because it never goes below the target temperature for the flow to start…
Is there a “when the temp IS instead of BECOMES”?
Therefore you can use Temp Changed, in the AND part you can compare the value to the value you need.