"Smart Period" Event not triggered

312 views
Skip to first unread message

Philipp Keil

unread,
Oct 11, 2016, 10:58:31 AM10/11/16
to Sleep as Android
Hi there.

I tried to setup a Tasker profile for the smart period feature in Sleep As Android. It should turn on my Philips Hue lights on lowest power when the smart period starts and turn them up to 100% brightness slowly until my usual alarm time is reached. 
The problem now is, that the event "Smart Period" in the Tasker plugin of Sleep As Android doesnt fire even when it clearly works, because the alarm goes off prematurely when i shake the phone. I also think its strange that Sleep As Android provides an Event for Smart Periods as mentioned here (http://sleep.urbandroid.org/documentation/tutorials/tasker/#events), but doesnt specify an Intent for it as seen here (http://sleep.urbandroid.org/documentation/developer-api/intents-and-content-providers/).



On another note, while experimenting with the tasker event of Sleep As Android I found, that when manually starting Sleep Tracking, it fires a "Sleep Tracking started" Event, but when I set "Start Automatically" in the "Smart wake up" settings, it doesnt fire.

Steps to reproduce this:
  1. Setup a Tasker profile for the "Sleep Tracking started" Event and link it to a task.
  2. Run Tasker Run Log.
  3. Check "Start Automatically" in "Smart wake up" settings.
  4. Have atleast 10% battery left (or whatever your setting is), so that sleep tracking is actually started.
  5. Add an Alarm atleast 45 minutes from now (because "Start Automatically" starts sleep tracking 45 minutes before alarm time).
  6. Observe the Tasker Run Log.

Am I doing something wrong here or is this indeed bugged?

Jiri Richter

unread,
Oct 11, 2016, 11:14:59 AM10/11/16
to Sleep as Android Googlegroup, sleep-as...@googlegroups.com

Jiri replied

Oct 11, 17:14
Hi!

Thank you for your message. That's an error of our documentation. The app fires the event 45 minutes before smart period starts. It's the com.urbandroid.sleep.alarmclock.AUTO_START_SLEEP_TRACK intent. The reason for this is that we need to gather some data to know whether you're in deep or light sleep.
I have fixed the docs...sorry about that.

Thank you very much.

Best regards,

Jiri Richter
Urbandroid Team
Follow us: 


Sleep as Android Googlegroup sent a message

Oct 11, 16:58
--
You received this message because you are subscribed to the Google Groups "Sleep as Android" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sleep-as-an-dr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

{#HS:262464033-22738#}

Philipp Keil

unread,
Oct 11, 2016, 11:40:57 AM10/11/16
to Sleep as Android
Thank you!

I get it and tried it but to no avail. I think Sleep As Android doesnt fire the intent com.urbandroid.sleep.alarmclock.AUTO_START_SLEEP_TRACK.

When I send the intent in  Tasker directly myself however, it works and triggers the intents com.urbandroid.sleep.alarmclock.AUTO_START_SLEEP_TRACK com.urbandroid.sleep.alarmclock.SLEEP_TRACKING_STARTED and the event Smart period (like seen in the screenshot I attached). However the intents com.urbandroid.sleep.alarmclock.SLEEP_TRACKING_STARTED and the event Smart period probably get triggered because sending the intent com.urbandroid.sleep.alarmclock.AUTO_START_SLEEP_TRACK actually starts sleep tracking in Sleep As Android? Shouldnt this not happen, because com.urbandroid.sleep.alarmclock.AUTO_START_SLEEP_TRACK is an event and not an Action like described in your documentation (http://sleep.urbandroid.org/documentation/developer-api/intents-and-content-providers/#events)?

Philipp Keil

unread,
Oct 11, 2016, 11:42:51 AM10/11/16
to Sleep as Android
I actually forgot the screenshot...
Screenshot_2016-10-11-17-22-02.png

Jiri Richter

unread,
Oct 12, 2016, 9:00:57 AM10/12/16
to Sleep as Android Googlegroup, sleep-as...@googlegroups.com

Jiri replied

Oct 12, 15:00
Hi again!

In fact that intent is both an event and an action :)
We broadcast it when the right time comes and our app also listens to it and starts sleep tracking.
Could you please send me a debug log from the night of tracking? There must be something else going on....just do menu>report a bug as soon as possible, hopefully the night will still be there...


Thank you very much.

Best regards,

Jiri Richter
Urbandroid Team
Follow us: 


Sleep as Android Googlegroup replied

Oct 11, 17:43
I actually forgot the screenshot...

Sleep as Android Googlegroup replied

Oct 11, 17:42
Thank you!

I get it and tried it but to no avail. I think Sleep As Android doesnt fire
the intent com.urbandroid.sleep.alarmclock.AUTO_START_SLEEP_TRACK.

When I send the intent in Tasker directly myself however, it works and
triggers the intents com.urbandroid.sleep.alarmclock.AUTO_START_SLEEP_TRACK
, com.urbandroid.sleep.alarmclock.SLEEP_TRACKING_STARTED and the event Smart
period (like seen in the screenshot I attached). However the intents
com.urbandroid.sleep.alarmclock.SLEEP_TRACKING_STARTED and the event Smart
period probably get triggered because sending the intent com.urbandroid.sleep.alarmclock.AUTO_START_SLEEP_TRACK
actually starts sleep tracking in Sleep As Android? Shouldnt this not
happen, because com.urbandroid.sleep.alarmclock.AUTO_START_SLEEP_TRACK is
an event and not an Action like described in your documentation (
http://sleep.urbandroid.org/documentation/developer-api/intents-and-content-providers/#events
)?

Philipp Keil

unread,
Oct 12, 2016, 6:46:00 PM10/12/16
to Sleep as Android
I just found my (really dumb) mistake. I just always tested with alarms under 50 minutes from now (with smart period on 5minutes)...
Reply all
Reply to author
Forward
0 new messages