This app was mentioned in 11 comments, with an average of 1.45 upvotes
I use Sleep as Android, which supports sending intents to Tasker. Not sure how to do it with the stock app though. Perhaps with something like AutoAlarm?
The files and instructions are here https://github.com/jhotmann/TaskerWinkAPI
You will need the AutoAlarm app for getting your alarm time https://play.google.com/store/apps/details?id=com.joaomgcd.autoalarm
If you have any questions or issues let me know.
I wouldn't worry too much about it. Tasker already asks for every permission imaginable, and as mentioned below - the creator of all the AutoApps plugins is now the owner/developer of Tasker itself.
So over time a lot of the plugin features (to some extent) will get rolled into core Tasker anyhow. For the purpose you've stated with the Alarm - <strong>AutoAlarm</strong> would definitely be a quick and simple solution.
Well all your prayers have been answered. AutoAlarm plugin returns just about all the alarm data you can think of for the next set system alarm. Run the plugin and it gives you all these variables/data:
%dayname Name of the day the alarm will go off
%dayweek Day of the Week
%shortdayname Short Name of the day the alarm will go off
%day Day of the month alarm will go off
%daysc Cumulative Days to next alarm
%days Days to next alarm
%error Error that might have occurred
%hour Hour alarm will go off
%hoursc Cumulative Hours to next alarm
%hours Hours to next alarm
%milis Miliseconds to next alarm
%minute Minute alarm will go off
%minutesc Cumulative Minutes to next alarm
%minutes Minutes to next alarm
%month Month alarm will go off
%raw Raw next alarm variable gotten from Android
%second Second alarm will go off
%secondsc Cumulative Seconds to next alarm
%seconds Seconds to next alarm
%year Year alarm will go off
So run AutoAlarm and use whichever variables you need to use/modify to set new variables that put into a Time triggered Profile (yet it will accept variables for hours/mins etc) where the variables you modified represent a time 5 minutes prior to the Alarm.
Then create another Time Profile that use the values of the exact alarm time, and use Tasker to open/run all your music based apps, etc.
And in regards to the whole matter, if you want to do all this (i.e. Bluetooth and specific music apps playing, even set volumes, custom alarm tone, etc. etc. etc.) why even bother trying to integrate with the stock alarm clock, and just build your own alarm in Tasker with a simple Time Profile you configure.
Unfortunately it wasn't as simple as just subtracting 8 hours. I did this quite some time ago, so I don't remember exactly the reasoning for every step I put in, but in order to make this work correctly, I needed AutoAlarm in addition to Tasker. Essentially, I took all of the various pieces of the next alarm time (month, day, hour, etc.) from AutoAlarm and combined them into a string that Tasker could use to convert from a date format to seconds, subtracted the correct number of seconds for 8 hours, and then converted it back to a date and split it up to format it nicely in my widget. If I don't have an alarm set, it shows "ERR", which I never bothered to fix. But at least doing it this way makes it so I don't have to try to do a bunch of hokey stuff with the math or worry about if something is too close to midnight or whatever.
Check out the AutoAlarm plugin, it can get your next alarm, and even calculate when x minutes before will be.
I know that <strong>AutoAlarm</strong> can grab the information.
Sorry, I fell ill and didn't check reddit. I have never exported anything from my tasker but here goes nothing:
You need to have AutoAlarm installed. It is possible to parse the alarm time yourself but... well... I got lazy.
Here is the xml for the scene Nightstand.scn.xml
And here is the corresponding task Start_Nightstand.tsk.xml
I hope this works, let me know if it doesn't.
I believe AutoAlarm should solve your problem.
<strong>AutoAlarm</strong> should be able to accomplish this - screenshot of AutoAlarm config.