STEP 1 — SCREEN UNLOCKING SCENE
We're first going to create a Tasker scene whose only purpose is to help us unlock the screen. If you have security on your screen, you'll have to manually unlock it, or follow this if you are rooted
- Tap the Scenes tab in Tasker
- Tap the plus icon below
- Make the scene as small as you can
- Exit the scene editor to save it
STEP 2 — DISCONNECTED EVENT
- Click the Profiles tab and create a new profile with the plus sign below
- Select Event->Plugin->AutoWear and edit the condition
- Under "Event" select "Power Disconnected"
- Accept these settings and create a new Task
STEP 3 — CHECK ALARM NOTIFICATION
We are now querying the system to see if an Alarm notification exists, so we're going to make AutoNotification look for notifications from the "Clock" app that have the title "Alarm"
- In the task add a Plugin->AutoNotification->Query action
- Set "App Name" to "Clock
- Set "Title" to "Alarm"
- Accept these settings and go back to the task
STEP 4 — IF IT'S THE RIGHT NOTIFICATION...
When you query your notifications you get back lists of results. Each of the items in these lists correspond to a notification. Because we narrowed it down to the Clock app and to the "Alarm" title, we're pretty certain that if the notification exists, it'll be the first one, so we'll access position 1 in the lists.
We need to only proceed if the notification exists in the first place, so lets check if the action for Button 2 is set. Button 2 is the "Dismiss" button on the Alarm notification.
- If the action is not set, that means that the notification doesn't exist
- Add an "If" action
- Set the condition to "%anbutton2action1 Is Set"The 1 at the end of "%anbutton2action" means that we're accessing position 1 of the list
STEP 5 — CLOSE IF
- Add an "End If" action so that the "If" is properly closed
STEP 6 — CLICK DISMISS BUTTON
We're now going to "click" on the dismiss button of the alarm's notification with AutoNotification
- Add a new Plugin->AutoNotification->Actions action
- Set "Intercept Action ID" to %anbutton2action1
- %anbutton2action1 is the action that corresponds to the second button in the Alarm notification, which is "Dismiss"
- Accept these settings and go back to Tasker
STEP 7 — SHOW SCENE TO UNLOCK
Showing this scene will make your screen unlock but won't show any ugly popups on the screen. That's why we're keeping it out of sight.
- Add a "Show Scene" action between the "If" and "End If"
- Select the "Small Popup" scene you created before
- Set it to appear as a Dialog
- Make it appear at the top left of your screen
- Set animation to Scale
STEP 8 — LAUNCH NEWS APP
- Add a App->Launch App action
- Select your favorite news app
STEP 9 — DESTROY SCENE
If you don't wait and dismiss the scene right away, you won't give it enough time to unlock your screen and the screen will remain off
- Add a 3 second wait action
- Add a "Destroy Scene" action.
STEP 10 — TEST IT
The alarm should now be cancelled and your favourite news app should open.
- Test it! Set an alarm and wait for it to appear.
- Press the play button in the task.