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
> 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).