Would like to create time teller for every 15min

602 views
Skip to first unread message

Ivan Ooi

unread,
Sep 4, 2015, 12:56:26 PM9/4/15
to Automate
Hi all,

 Any ideas how to create time teller for every 15min ?
Can't find any where...

Thanks

Automate developer

unread,
Sep 4, 2015, 1:34:49 PM9/4/15
to Automate
Delay 15 min -> Speak "Time is {now;dateFormat;time}" -> loop

andrea....@gmail.com

unread,
Sep 8, 2015, 5:26:37 AM9/8/15
to Automate
Hi, would it be possible to:

1) begin the announcement at an exct hour instead of immediately?

2) tell the hour alone, without date and minutes?

Thanks!

andrea....@gmail.com

unread,
Sep 8, 2015, 6:16:07 AM9/8/15
to Automate, andrea....@gmail.com
Apologize, reading the documentation I understood that the answer to question n.2 should be: Speak "Time is {now;dateFormat;k}"

Automate developer

unread,
Sep 8, 2015, 1:30:56 PM9/8/15
to Automate
Try:

    Flow beginning
         |
+--------+
|        |
|    Time await
| Time of day: ((dateParts(Now)[3]+1) % 24)*3600
|        |
|    Sound play
|        |
+--------+

Andrea Bruzzesi

unread,
Sep 8, 2015, 4:14:05 PM9/8/15
to Automate
Thanks a lot, I've yet to test it thoroughly but that formula seems to work.

If I understand it tells the flow to wait the amount of seconds needed to reach the next hour.

You know you're a genius, don't you?

Automate developer

unread,
Sep 8, 2015, 5:08:43 PM9/8/15
to Automate
No, that flow example awaits the next hour of day, i.e seconds since midnight of that hour.
It could also have used use the Delay block to wait for the seconds remaining until the next hour, but that calculation would be even more complex.

No genius required, just basic math skills and knowledge of the available functions:
http://llamalab.com/automate/doc/function/index.html

horr...@gmail.com

unread,
Sep 29, 2015, 8:22:40 AM9/29/15
to Automate
Hi, I've made a simple delay loop - every 30 sec app should do a "screen on" check and put the number of seconds past from the algorithm start into log - first it says 30, then 60, then eg. 300+ and then 800+ - I suspect that it's the android's fault - but do you know maybe how to deal with that?

Automate developer

unread,
Sep 29, 2015, 12:25:13 PM9/29/15
to Automate, horr...@gmail.com
Make sure you use proceed Exact and that the Awake the device option is enabled.
If it's still not near to 60 between delays it's likely caused by an some energy saving app or the Android 5+ Power save mode.
Also if you're playing a memory intensive game/app, Automate may be killed regardless, and restarted again when memory is available.

Łukasz Dobrzyński

unread,
Sep 29, 2015, 12:29:04 PM9/29/15
to Automate developer, Automate
Thanks for the reply, I'll investigate.


--
LD

buttersco...@gmail.com

unread,
Dec 28, 2016, 12:45:20 PM12/28/16
to Automate

I have to come back on that one.
I cannot see, what the suggested "% 24" should enhance?

To find the next amount of seconds since midnight I would have simply used (dateParts(Now)[3]+1)*3600


Funny though, that on my phone I have to correct this formula by factor -600 before handing over in "Time of day", when calculating in an variable; although the amount of seconds is correct in the variable at first.

Basic maths skills need additional debugging knowledge ;-)

Best wishes
BSM

Henrik "The Developer" Lindqvist

unread,
Dec 28, 2016, 2:50:14 PM12/28/16
to Automate, buttersco...@gmail.com
Modulo % is used to wrap the 24:00 (which is invalid) back to 00:00.
Reply all
Reply to author
Forward
0 new messages