Press a button on a notification as soon as you receive it

Will emulate you pressing a notification button as soon as the notification is created

  1. joaomgcd

    STEP 1 - INTERCEPT NOTIFICATION FOR APP


    • Open Tasker and create a new profile
    • Use the AutoNotification Intercept event condition.
    (i) This will trigger the profile everytime there's a new notification, in contrast to the AutoNotification Intercept state which will make the profile remain active as long as the notification is present


    STEP 2 - CONFIGURE CONDITION


    • Make it only intercept created notifications
    • Set it to intercept notifications from AutoRemote only
    (i) I'm using AutoRemote because it has an easy way to create notifications so I can easily test this profile. You can intercept notifications from any app.
    • Accept these settings and create a task that reacts to this event


    STEP 3 - SHOW THAT YOU RECEIVED THE NOTIFICATION


    • Add a flash action with the text "Got autoremote notification %anbutton1action"
    (i) %anbutton1action contains a special ID that represents the action for the intercepted notification's first button which is the button on the left of notifications. This can be used to simulate the button action as you can see next


    STEP 4 - PRESS THE BUTTON


    • Add an AutoNotification Actions Tasker action
    • In the Intercept Action ID field insert the %anbutton1action variable
    (i) You could use any notification action here including %antouchaction for example which would simulate touching the notification itself. You can find all the notification action variables here.
    Here are how the notification actions are laid out:
    [​IMG]
    • Back out of Tasker to save


    STEP 5 - TEST IT


    To test it you can send yourself an AutoRemote notification with a button that flashes the words "Button 1 Pressed"
    When you receive the notification you should see the first flash saying that you got the notification along with the action ID.
    Then you should see a flash with "Button 1 Pressed" which comes from AutoNotification simulating the button press on the AutoRemote notification

    If you don't have AutoRemote or don't know how to create the notification mentioned above, create a notification with the native Tasker Notify action that does any action you want and test it with that. Make sure to have the "Intercept Tasker Notifications" option checked in the main AutoNotification app though!

Recent Reviews

  1. Thadius
    Thadius
    5/5,
    This tutorial helped me build a voice command to automatically set my nest thermostat to away mode when I leave the house. Thank you for your great products and tutorials.