Page 1 of 1

Run flow only Once during a timerange..

Posted: 27 May 2017 01:19
by labor
Hellow guys, I'm kind of new to the automation world and I'm having some trouble setting this flow in automagic.

My flow is intended to activate "Night Mode on Nougat" via autoinput, as my phone is not rooted and I can't use the default settings. So far so good, I created a user input action that allow automagic to toggle Night Mode on and off, my trouble lies in automatizing the process.

I want:
Between 5 pm and 6am, whenever I unlock the phone, automagic runs the input macro once that i successfully created to activate Night Mode.

Things that I tried:

* "Global variable date/time" trigger with [x] trigger immediately on missed events and it worked greatly BUT it do not repeat as you have to set date/time. I need this to happen daily;

* "User present trigger" + time range condition. Problem found: It activates whenever I unlock the phone during the time range and not only once as it was intended;

* "Time" trigger. Problem found: This trigger does not have the [ ] trigger immediately on missed events options so if my phone is not unlocked upon the event time I miss the flow.

I know I'm doing something stupid but it's driving me crazy for the last two days and any help would be really appreciated :)

Re: Run flow only Once during a timerange..

Posted: 27 May 2017 13:48
by Serum_114
Create a global variable switching the value to true if your flow has executed. Create a flow that runs at 6 am resetting it to false. The first step in your flow would be to check the global variable for 'false' before executing.

Re: Run flow only Once during a timerange..

Posted: 27 May 2017 14:17
by Serum_114
A simpler way to accomplish this would be by doing a 'set flow state: disable' during the flow. I prefer the variable option because I have many flows I want to run when my device is unlocked. The variable allows me to trigger just one flow that calls others. If you aren't doing that, disabling the flow is the easiest way to accomplish what you're trying to do.