Page 1 of 1

How can I add time conditions?

Posted: 26 Oct 2014 13:23
by dumpystig
I have adapted a Samsung Galaxy Tab 7.7 and have it permanently installed in my cars dash. I have also built a custom charger module that powers the Tab when the ACC or IGN is on. So when power is applied the Tab wakes, when power is disconnected the Tab goes into deep sleep.

The problem is that starting the car messes up the voltage supplied to the Tab and therefore the PowerOn flow doesn't always start as it should.
So what I want is a time parameter that will start the the flow only after power has been supplied for x seconds is true.

Can anyone help me with this or point me to somewhere I can get further info?

Re: How can I add time conditions?

Posted: 26 Oct 2014 19:44
by Bushmills
If Automagic Start event is unreliable, you probably want to avoid using it at all.
I could think of this approach:

Create a flow which is triggered periodically. Say, once a minute. Add your desired start actions. Add an action to disable that flow (that is, itself). Don't enable that flow.

Add another flow, triggered by device shutdown, which enables that previous flow. Enable this flow.

On boot - at least, if system has shut down correctly and successfully enabled that periodic flow - that flow should now, after some delay, execute, then disable itself, until next shutdown.

That's all untested, and merely offered as a suggestion for trying out. There may be more and other solutions.

Re: How can I add time conditions?

Posted: 26 Oct 2014 21:49
by dumpystig
Hey thanks for your suggestion.

Trouble is I haven't a clue how to go about creating timing triggers or anything to do with timing..... I just don't know where to start.

Re: How can I add time conditions?

Posted: 26 Oct 2014 21:56
by Bushmills
Do you know how to create a new flow?
It starts with an empty box for the trigger condition.
That's where you pick a trigger like "Periodic timer" for.
I'm sure that's all explained in great detail in the documentation of Automagic.

Re: How can I add time conditions?

Posted: 01 Nov 2014 12:48
by dumpystig
Yeah of course I know. I have already tried several flows.

Periodic Timer doesn't fit the bill as it is a trigger; I want a timed condition, i.e. when power is connected (trigger) check that it is connected for 5sec (condition) before waking device and turning screen on (action).

Re: How can I add time conditions?

Posted: 01 Nov 2014 13:14
by Bushmills
It may be that I replied to your post, having another post in mind. Because I mention the Automagic Start event, for which I give a suggestion for a possible workaround, while your problem has no relationship to Automagic Start condition. I'm sorry about this.
Let me refocus ...
What you're looking for is a flow, which triggers on (possibly unstable) power on.
Following I see two possibilities:
Pause 5 seconds, then check power again (this wouldn't catch temporary Power off within these 5 seconds)
There is a "power connected" condition for checking power.
or
Power On flow does:
enable a 2nd flow, triggered by Power Off event.
Pause 5 seconds
Disable Power Off flow
Execution of this Power Off flow should catch transient power off conditions.

Either case, look at flow options, from menu in flow editor, where you can set their response to multiple trigger while they still execute (could be called "flow execution rules")
You probably want to prevent 2nd activation of Power On flow, as long as it still executes. With that 5 seconds Pause, you will ensure that way, that no action in that flow is executed again as long as your 5 seconds power stabilisation phase lasts.