How to enable wifi before alarm

91 views
Skip to first unread message

David Tabernero

unread,
Dec 24, 2020, 11:48:51 AM12/24/20
to automa...@googlegroups.com
Hi
I would like my alarm to sound with my Spotify account
Since I disable wifi and data at night I thought use automate to can do it
Someone could help me please?
Thanks and sorry for my English

Henrik "The Developer" Lindqvist

unread,
Dec 24, 2020, 4:09:43 PM12/24/20
to Automate
Do you mean play a song on Spotify when an Alarm goes off?
If so, the it would be something like...
  1. Flow beginning
  2. Alarm
  3. App start: Spotify (this block, and the Delay below, may not be needed)
  4. Delay: 2s
  5. Audio player control
  6. (loop to #2)

David Tabernero

unread,
Dec 24, 2020, 5:31:08 PM12/24/20
to Henrik "The Developer" Lindqvist, automa...@googlegroups.com
Yes
But I have Spotify option in my alarm config. Problem is I have disabled wifi before alarm wake up because I'm sleeping so if wifi is disabled Spotify not works. 



--
You received this message because you are subscribed to the Google Groups "Automate" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automate-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/automate-user/9fb2723e-9026-45e6-823b-c96357b85b57n%40googlegroups.com.
Screenshot_20201224-232921.png

Henrik "The Developer" Lindqvist

unread,
Dec 25, 2020, 2:50:59 AM12/25/20
to Automate
Standard Android doesn't support such a feature, it's custom to the Alarm clock.
Try a flow which enables Wi-Fi when an Alarm goes off, so maybe Spotify can play the song, e.g...
  1. Flow beginning
  2. Alarm
  3. Wi-Fi set state
  4. (loop back to #2)

P. Andreas Schmidt, IVE

unread,
Jan 16, 2023, 5:46:23 AM1/16/23
to Automate
Dear David,

you've posted this more than 2 years ago. I hope you already figured it out, but in case not, here's how to do this (I've needed something similar):
you use the Alarm block, set it to immediately and get the time of the next alarm.
Then you use either of the two time blocks (delay or time await) substracting the amount of time from that that you need, i.e. 5 minutes is enough I guess for WiFi to turn on and connect. 
If you are in the habit of changing your alarm clock setting after the flow would have started, you should add a forked fiber with an alarm block set to "when changed", that will kill the parent fiber and loop back to the beginning and fetch the new time.

Something like:
0-Flow beginning
[1. Fork - (child): alarm "when changed" -> stop fiber parent -> loop back to 1]
2. (parent) Alarm immediately -> nextalarm
3. (parent) either:
a) delay (nextalarm - now - x) [x being the time in seconds that you want to anticipate your alarm i.e. 5 minutes = 5*60=300]
b) time await nextalarm - x
4. (parent) Wi-Fi set state -> loop back to 2

Hope this helps.

With kind regards,
Reply all
Reply to author
Forward
0 new messages