sleep as android and google calendar

353 views
Skip to first unread message

Kristian Bowbrick

unread,
Sep 13, 2016, 5:37:56 PM9/13/16
to Tasker
I am fairly new to tasker and have only used a few simple tasks.  This one seems as though it should be really simple but is giving a right headache!

I have alarms in my sleep as android named the same as my shifts in my google calendar.  For example when I am on an 06:00-16:00 shift, my google calendar entry is named 0600-1600.  For this shift I need to get up at 04:30, so I have an alarm set for 04:30 named 0600-1600.

I have an nfc tag by my bed which currently, when scanned simply opens sleep as android.  What I would ideally like is when I scan the tag it opens sleep as android, looks up my shift for the next day, turns on the appropriate alarm for the morning and turns off all other alarms.

Can anyone help me with this one?

Thanks in advance.

Scott J Miller

unread,
Sep 13, 2016, 7:52:30 PM9/13/16
to tas...@googlegroups.com

This is not exactly what you want, but it might give you some ideas. I don't use Sleep As Android. I use Gentle Alarm instead. So the concept should be similar. My profile checks my calendar for all day events that indicate I am not working that day, and changes the alarm choice. There is a math operation that is used to look into the future to retrieve the calendar entry. I based this on several threads I've seen in this forum.

Profile: CheckDayOff (99)
Time: From 12:00PM every 5h Till 11:00PM
Enter: DayOff (98)
A1: Array Clear [ Name:%Alldayevent ]
A2: Variable Set [ Name:%Daytocheck To:%TIMES+45000 Do Maths:On Append:Off ]
A3: Test App [ Type:Calendar Title Data:%Daytocheck Store Result In:%Alldayevent ]
A4: If [ %Alldayevent(#?vacation/holiday/new year's day/memorial day/independence day/labor day/thanksgiving day/christmas day) !~ 0 ]
A5: Variable Set [ Name:%DayOff To:Yes Do Maths:Off Append:Off ]
A6: Gentle Alarm [ Name:dayoff Set:On ]
A7: Gentle Alarm [ Name:workday Set:Off ]
A8: Else
A9: Variable Set [ Name:%DayOff To:No Do Maths:Off Append:Off ]
A10: Gentle Alarm [ Name:dayoff Set:Off ]
A11: Gentle Alarm [ Name:workday Set:On ]
A12: End If

Rich D

unread,
Sep 13, 2016, 10:15:23 PM9/13/16
to Tasker Google Groups Post


> This is not exactly what you want, but it might give you some ideas.

+1

There is a lot of info available on this subject. Try a google search like -

'Tasker get next calendar event'

Try to piece something together. when you get stuck post here for help. Include a exported description of all relevant profiles and tasks.

To post your profile or task here...  Long press on the profile or task name / ( 3 dot menu with 4.0+ ) export / export "DESCRIPTION" to clipboard (not XML)

Any linked tasks will be exported with the profile they are linked to..

To be able to export, The beginner mode needs to be off and the profile needs to be named by you (Not the Tasker listed name.  Tasker will list your profile with the context name if you have not given it one).

Reply all
Reply to author
Forward
0 new messages