Tasker: Android missed notification reminder

One interesting nuance of Android is the inability to repeat notifications.  So for example, you missed a call or there was a calendar appointment notification.  If you happen to miss the initial notification, there is no mechanism for follow-up notifications to be triggered.

There are many apps devoted to this in the market, but I was never happy enough with any single one, and the more sophisticated apps seem to cost.

Enter Tasker, a nifty little Android app that lets you take complete control of your device by making profiles and tasks.  With Tasker I built a series of profiles and tasks that create a more sophisticated set of notification reminders to my liking:

Description

There are three types of profiles:

  1. The profile that actually performs the notification reminder
  2. Profiles that trigger the notification reminder.  You choose which ones to enable based on things you want to be reminded of:
    1. Missed calls
    2. Missed text messages
    3. Missed Google Voice calls / texts
    4. Calendar appointments
  3. Profiles that clear the notification reminder – clear the reminder based on certain actions for all of the triggers in #2 above.  For examples:
    1. Clear all missed reminder notifications when you choose “Clear All” from the notifications menu
    2. Clear the missed call reminder when you view your missed calls
    3. Clear the calender reminder when you view the calendar or dismiss the appointment

Disclaimer:  I got the base idea from Tasker’s site itself, but ended up having to tweak them a lot to get them working the way I wanted them to, and to prevent infinite loops of reminders.

Profiles

The following is a text description of the profiles contained in this project.  This is simply here to help explain what each of the profiles is for, what it does, and why.  The profiles themselves can be imported directly into Tasker at the bottom of this article.

  1. Missed Notification Reminder– the profile that actually triggers the reminder notification
    1. Contexts:
      1. Variable Value %MISNOT > 0   –  at least one notification reminder has been triggered
      2. Variable Value %PHONE_USE Isn’t Set  –  I’m not currently talking on the phone (optional addition so the reminder beeps / vibrates don’t happen while you’re talking on the phone)
    2. Tasks:
      1. |> Anonymous (#1 below)
      2. <| Anonymous:  (#2 below)
  2. Missed Notification Clear – All  –  clear all notification reminders when all notifications are cleared
    1. Contexts:
      1. Button Widget Clicked *, Image, Any, Any  –  the best context I could find for the “Clear All” (X) image button in ICS notification window
      2. Variable Value %WIN, Matches Regex, “[A-Za-z]+ \d+, \d+”  –  The window name in ICS for the notifications window is the current date.
      3. Variable Value %MISNOT Is Set
    2. Tasks:
      1. |> Anonymous:  Variable Clear %MISNOT
  3. Missed Notification Clear – Notify Click  –  clear all notification reminders when the “Missed Notification” notification is clicked
    1. Contexts:
      1. Notification Click *, “Notification Reminder”
      2. Variable Value %MISNOT Is Set
    2. Tasks:
      1. |> Anonymous: Variable Clear %MISNOT
  4. Missed Notification – Calls  –  trigger the notification reminder for missed calls
    1. Contexts:
      1. Missed Call *
    2. Tasks:
      1. |> Missed Notification Increment
      2. <| Missed Notification Decrement
  5. Missed Notification – Text  –  trigger the notification reminder for unread text messages
    1. Contexts:
      1. Unread Text Any
    2. Tasks:
      1. |> Missed Notification Increment
      2. <| Missed Notification Decrement
  6. Missed Notification – Google Voice  –  trigger the notification for missed GV voicemail messages, calls or text messages
    1. Contexts:
      1. Notification Voice  –  A notification is generated from the “Voice” app
    2. Tasks:
      1. |> Anonymous (#3 below)
  7. Missed Notification Clear – Google Voice  –  clear the notification reminder when the Voice app is opened
    1. Contexts:
      1. App Opened: Voice
      2. Variable Is Set: %MISNOT  – only triggered if the notification reminder is occurring
    2. Tasks:
      1. |> Anonymous (#4 below)
  8. Missed Notification – Calendar  –  trigger the notification reminder for calendar notifications
    1. Contexts:
      1. Notification Calendar  –  A notification is generated from the “Calendar” app
    2. Tasks:
      1. |> Anonymous (#5 below)
  9. Missed Notification Clear – Calendar Dismiss  –  clear the notification reminder when the calendar notification is dismissed
    1. Contexts:
      1. Button Widget Clicked: “Dismiss all”/”Dismiss”/”Snooze all”/”Snooze”
      2. Variable Is Set: %MISNOT
    2. Tasks:
      1. |> Anonymous (#6 below)
  10. Missed Notification Clear – Calendar View  –  clear the notification reminder when the calendar event is viewed
    1. Contexts:
      1. Variable Value, %WIN matches “View event/Calendar”
      2. Variable Is Set: %MISNOT
      3. App Opened: Calendar
    2. Tasks:
      1. |> Anonymous (#6 below)

Tasks

The following are text descriptions of the different tasks associated with this project, again for explanations of what they do, not for creating them manually.  Import the project below and all of these tasks will be imported for you.

  1. Anonymous #1
    1. Notify “Notification Reminder” – send the notification for the reminder
    2. Perform Task: “Notification Reminder”
  2. Anonymous #2
    1. Notify Cancel  “Notification Reminder” – cancel the notification we triggered
    2. Variable Clear: %MISNOTCOUNT – clear our unique notification profile counter
    3. Variable Clear: %MISNOT_INSTANT_STORE – clear our instant profile storage variable
  3. Notification Reminder  –  Performs the actual reminder vibrate or sound
    1. Wait 5 minutes
    2. Stop IF %PACTIVE !~ *,Missed Notification Reminder,*  –  Stop processing if the missed notification reminder profile is not still active
    3. Goto #1 IF %PHONE_USE Is Set  –  Don’t notify if on the phone
    4. Goto #1 IF %SILENT ~ on  –  Don’t notify if “Silent Mode” (not “Vibrate Mode”) is on
    5. IF %SCREEN ~ on
      1. Vibrate Pattern (short)
      2. Notify “Notification Reminder”
    6. ELSE
      1. Vibrate Pattern (long)
      2. Notify Sound “Notification Reminder”
    7. END IF
    8. Goto #1
  4. Missed Notification Increment
    1. If %PACTIVE !~ *PACTIVE
      1. Variable Set %PACTIVETMP, %PACTIVE – make a copy of the active profiles variable for parsing
    2. ELSE
      1. Variable Set %PACTIVETMP, “,” – initialize to just a comma
    3. IF %MISNOT_INSTANT Is Set – if we have an instant profile configuration to handle
      1. IF %MISNOT_INSTANT_STORE Is Set – if we already have an instant profile store created
        1. Append %MISNOT_INSTANT to %MISNOT_INSTANT_STORE
      2. ELSE
        1. Set %MISNOT_INSTANT_STORE = %MISTNOT_INSTANT
      3. — NOTE — the %MISNOT_INSTANT and %MISNOT_INSTANT_STORE variables help us handle “Event” profiles that fire and are active for only a split second, therefore they do not actually exist in %PACTIVE.
      4. Variable Clear %MISNOT_INSTANT
    4. Append %MISNOT_INSTANT_STORE to %PACTIVETMP IF %MISNOT_INSTANT_STORE Is Set
    5. Variable Split %PACTIVETMP, “,” – create an array by splitting the profiles active string by “,”
    6. Foreach %PACTIVETMP AS %MISNOTTMP – loop through each item in the array, assigning it to variable %MISNOTTMP
      1. Variable Add %MISNOTCOUNTTMP, 1 IF %MISNOTTMP ~ “Missed Notification -*” – add to our profile counter variable if the profile is a missed notification profile
    7. End For
    8. IF %MISNOTCOUNT != %MISNOTCOUNTTMP – if our counters don’t match, IE a different profile is also now active
      1. Variable Add %MISNOT, 1
      2. Variable Set %MISNOTCOUNT, %MISNOTCOUNTTMP – store our new count value to compare against
    9. END IF
    10. Variable Clear %MISNOTTMP
    11. Variable Clear %MISNOTCOUNTTMP
    12. Array Clear %PACTIVETMP
  5. Missed Notification Decrement
    1. Variable Subtract %MISNOT, 1
    2. Variable Clear %MISNOT IF %MISNOT < 1
    3. IF %MISNOT_INSTANT Is Set
      1. Variable Search Replace – remove the value of %MISNOT_INSTANT from %MISNOT_INSTANT_STORE
      2. Variable Clear %MISNOT_INSTANT
  6. Anonymous #3
    1. Variable Set %MISNOT_INSTANT, ‘Missed Notification – Google Voice’
    2. Perform Task ‘Missed Notification Increment’
  7. Anonymous #4
    1. Variable Set %MISNOT_INSTANT, ‘Missed Notification – Google Voice’
    2. Perform Task ‘Missed Notification Decrement’
  8. Anonymous #5
    1. Variable Set %MISNOT_INSTANT, ‘Missed Notification – Calendar’
    2. Perform Task ‘Missed Notification Increment’
  9. Anonymous #6
    1. Variable Set %MISNOT_INSTANT, ‘Missed Notification – Calendar’
    2. Perform Task ‘Missed Notification Decrement’

XML to import

The following XML file can be imported directly into Tasker.  It will create a new tab (Project) where all of the profiles and tasks will be stored, and will import all of the necessary profiles, tasks and variables for it to work.  You may need to tweak a few settings, but it will handle the majority of the setup for you.

Note: to enable monitoring other application notifications, a setting in Android must be changed.  This can be accomplished using 1 of 2 methods:

  1. Changing the setting directly:
    1. Navigate to System Settings
    2. Scroll to the bottom and open “Accessibility”
    3. Under the “Services” section, make sure “Tasker” is set to On
  2. Allowing tasker to show you where the setting is:
    1. Edit the “Missed Notification – Google Voice” profile
    2. Open the context “Notification Voice”
    3. Re-selecct the “Owner Application” (in this case, re-select the “Google Voice” app
    4. Tasker will now prompt you to enable the setting, and if you choose Ok it will open the appropriate android settings window for you to make the change.
    5. Under the “Services” section, make sure “Tasker” is set to On

Without making the above settings change, other application notification monitoring will not work, so the notification reminder profile won’t work.

Missed_Notify.prj

Optional phone use addition

In order to prevent notification reminders from occurring when the phone is in use (causing annoying vibrations or sounds mid-call), the following additional profiles can be used to set the %PHONE_USE variable referenced above.

Profiles

  1. Incoming Call
    1. Contexts:
      1. Phone Ringing *
    2. Tasks:
      1. |> Set Phone In Use
  2. Outgoing Call
    1. Contexts:
      1. Phone Offhook
    2. Tasks:
      1. |> Set Phone In Use
  3. Phone Hung Up
    1. Contexts:
      1. Phone Idle
      2. Variable %PHONE_USE = 1
    2. Tasks:
      1. |> Set Phone Hung Up

Tasks

  1. Set Phone In Use
    1. Variable Set %PHONE_USE=1
  2. Set Phone Hung Up
    1. Variable Clear: %PHONE_USE

XML to import

The following XML file can be imported directly into Tasker.  It will create a new tab (Project) where all of the profiles and tasks will be stored, and will import all of the necessary profiles, tasks and variables for it to work.  You may need to tweak a few settings, but it will handle the majority of the setup for you.

Note: you must disabled “Beginner mode” in order to be able to import this configuration.

Phone_Use.prf

  • Moe

    Excellent post! But have you observed any impact on the battery life? I tried this today and found that my phone stops goes into deep sleep.. Still thinking which profile / task I should blame. Could it be the ever cycling notification reminder task?

    • gjanes

      I wonder if Tasker itself consumes some extra battery life when you enable Tasker in Accessibility services for monitoring other app’s notifications.

      Otherwise, I don’t know that the “Notification Reminder” task would consume any extra, because it only cycles *while* the “Missed Notification Reminder” profile is active. Once you clear the notification, the reminder task exits. I suppose if you let a notification reminder run for several hours, the slow 5-minute loop *could* draw some power, but it shouldn’t do too much extra work since the majority of the time its sleeping (waiting).

      I haven’t noticed a significant drain, at least that I could attribute to any one profile or task in Tasker. I’ve even attempted disabling the Tasker service in the past to track down battery drain issues, and in the past for me its never ended up being Tasker’s fault, always another rogue app.

  • Guest

    Hi Goeff. Can’t seem to open the profiles in Tasker v4.0u1. Can you update it to this version?
    Thanks

    • Rob

      With a bit more investigation, I figured out how to do this.
      In ver 4, you must disable beginner mode and then click on the house icon at the bottom left of the main tasker screen. This allows you to import project files. Works fine now..

      • gjanes

        Thanks for letting me know about the issue, I haven’t been in beginner mode in years. 🙂

        I’ll try to update all of my posts to mention the requirement of disabling beginner mode.

  • Rob

    Hi Geoff.. Can’t seem to import this into the latest version of Tasker, 4.0u1. Can you update the script to include this version?
    Thanks

  • ttdww

    loading this this deleted all my profiles. fortunately i had backed up first. how do i only ‘merge’ this into my profiles instead of wiping them out?

  • Timothy Barton

    I had to change the extension to be able to select it from the import menu, but then I got the same “more than 1 profile” error mentioned below