1. Are you ready for the Galaxy S20? Here is everything we know so far!

Finally figured out how to set up system notification menu options in Tasker

Discussion in 'Android Apps & Games' started by Roymus, Feb 18, 2011.

  1. Roymus

    Roymus Well-Known Member
    Thread Starter

    Like many of you, I've been beating my brains out how to use Tasker to do things like create system notifications (i.e., custom clickable menu options in the Android pulldown notification list) to run selected apps/tasks. Tasker is extremely powerful, but the documentation is lacking and most on-line wikis/guides sadly miss the mark. I'm posting my findings on how to do custom notifications below in the hopes that it might help someone avoid the many trial and error cycles I went through to get this to work (also to get feedback from others who have done the same...always looking for better ways to do things). I'm also including my custom wifi scanner profile...it doesn't use WiFi Near, which has always been problematic (at least on my phone. Feel free to comment/critique/modify if you wish!

    System Notifications
    I have to say, this was the trickiest of the profiles I've set up, but in the end it works well. Here's how it goes for me:

    1. First, you must create an individual task to create the notification entry in your pulldown (not as part of a context, just a stand-alone task). DO NOT associate this task with a Context profile; it's just a stand alone. The example below is for toggling the phone in and out of Silence mode, a useful thing to have on a pulldown menu. NOTE: Do not click Done after entering the task...see step 2!

    1. Notify
    Title: Toggle Silence Mode (be sure to remember the title, you'll need it)
    Text: Click to toggle silence mode
    Permanent: Checked (this makes the notification "sticky" so it doesn't disappear if you clear it)

    2. Click the Test button on the bottom right of the Task dialog. This will actually create the notification entry in the Android notifications list as a "sticky" notification (it won't do anything yet). I know this is weird, but I have not discovered a way to actually create the notification without clicking the Test button...and I've looked! After clicking the Test button, you can click Done to save the task.

    3. Now you need to create a Notification event profile to go with the Notification task. Click New from the Tasker profile screen and enter the profile name (i.e., "Silence Mode Toggle"). Click Event as the First Context, then select UI, then Notification Click as the selected UI event. This will display the Notification Click event dialog.

    4. Now, do you remember the Title you entered in Step 1? You need to enter that exact same text in the Title field on the Notification Click event dialog. This will link the Notification Click event with the Notification entry from Step 1. Leave Owner Application as * (i.e., applies to all apps) and click Done.

    5. Now, add a new task to the Notification Click event from step 4. The task can do anything you want (in my case, toggling the phone's ringer mode). I used the Tasker If...End If functions to control the flow of events in the task as follows:

    1. If %SILENT~off
    2. Silent Mode (Mode: Vibrate)
    3. Stop
    4. End If
    5. If %SILENT~vibrate
    6. Silent Mode (Mode: Off)
    7. Stop
    8. End If

    All the above does is check to see if the phone is in normal mode, if true then set it to Vibrate Only, then stop the task. If the phone is already in Vibrate mode, then set Silent Mode off (back to normal).

    Now you're ready to test the Silent Toggle. You can do this from right within Tasker...just pull down the Notifications bar and you should see the Toggle Silence Mode entry. Click on it to turn your phone's ringer to Vibrate Only. Pull it down again and click to return the phone to normal.

    I also use the Notifications to set the phone into various states (Handsfree Car Mode, Work WiFi Mode)...I also have context profiles that do this based on location and WiFi, but sometimes they don't work and I need a quick way to make sure the phone is behaving the way I want.

    Bonus: I've always had trouble with the WiFi Near context...it seems to misbehave and disconnect the wireless for no reason, as well as other weirdness. So, I've set up a custom WiFi Checker profile. To do this, I simply create a new profile (called WiFi Checker). Select Tim as the First Context, then clear the From and To checkboxes and check the Repeat checkbox. Enter the repeat interval (I entered 5 minutes). Then associate a task to to the Wifi Checker profile that does something similar to the following:

    1. Stop (if %WIFII~*CONNECTION*) //What this does is stop the task if you already have a viable wifi connection. The WIFII variable will have the text string "CONNECTION" in it, along with the SSID and other info.

    2. WiFI Set On (if %WIFI~off) //Turns Wifi on if it's off.

    3. Wait (1 Minute) //Leaves Wifi on for a minute, this gives your phone a chance to automatically connect to a remembered network if there's one in the vicinity.

    4. WiFi Set Off (if %WIFII!~*CONNECTION) //If no valid connection is made, then turn WiFi off again...the whole process will be repeated again in 5 minutes!

    I think the above is more reliable than using the WiFi Near contexts...my phone stays connected the whole day at work. If you want to get fancy, you can then set up a Wifi Connected profile to check the SSID and do things based on the specific connection (for example, I have one that will reduce the phone volume if I'm connected to my work wifi). I know you can also use Location or Cell Near, but this is simpler to set up and does the job.

    Hope the above helps...it's my longest post on Android Forums to date!
     

    Advertisement

    decalex, AngryHatter and megapixle like this.
  2. megapixle

    megapixle Newbie

    Nice post, thanks for sharing.
     
  3. amlothi

    amlothi Android Expert

    I do a similar thing for Wifi but I use the Wifi Near ability of Tasker somewhat.

    First, I have a context of Wifi Near with a Task to Stop (do nothing). All this does it make sure Tasker is performing Wifi Near checks.

    Then, a second profile with contact Wifi Connected and a task to change a variable value. (not necessary to have the variable in between, but I like to use that variable for IF statements in other profiles).

    The variable then turns on or off Wifi/Auto Sync/etc.
     
  4. barqers

    barqers Android Expert

  5. decalex

    decalex Android Enthusiast

    Thank you for the extensive instructions! Yes.. Tasker is definitely lacking in this. Reading on their site, this permanent notification is made to look like a very simple task to create. If you haven't seen this-- have a look. Maybe you'll see something simpler that I didn't. Your method was the only one that actually worked for me, though.

    Tasker - Permanent Notifications

    .
    .
     
Loading...
Similar Threads - Finally figured set
  1. Android News
    Replies:
    0
    Views:
    32
  2. Android News
    Replies:
    0
    Views:
    25
  3. Android News
    Replies:
    0
    Views:
    16
  4. Android News
    Replies:
    0
    Views:
    8
  5. Android News
    Replies:
    0
    Views:
    10
  6. notableuser
    Replies:
    1
    Views:
    239
  7. Ushtar Ali
    Replies:
    2
    Views:
    638
  8. Cyberdev
    Replies:
    2
    Views:
    625
  9. MoodyBlues
    Replies:
    4
    Views:
    1,359
  10. tube517
    Replies:
    55
    Views:
    2,295

Share This Page

Loading...