Tuesday, January 13, 2026

Building A Better Digital Bat Signal - Part 3 - The Phone

This is part 3 of a 3 part series on building an enhanced notification system when I have an unread urgent email. Part 1 describes the problem and Part 2 describes the server side code needed to power my solution. Part 3 implements the visual alert by having my phone react to messages sent by the server. Let's jump in.

Tasker, combined with AutoRemote, provides an elegant solution for responding to the inbox status messages that the server is issuing. Two short Tasks, and two short Profiles is all it takes to turn these messages into a hard-to-miss visual alert.

The main task is: SetInboxStatus; here's how it works:

%new_status is provided via a parameter to the Task. If the new status is unknown then the Task quits. In this case, we can't make any assumptions about what the status of my inbox is.

Otherwise, the task checks to see if %new_status matches the existing globally set status %INBOX_STATUS. If it does not, then we know we're dealing with a status-change. In this case, I invoke the SetWallpaper action with an image path that includes %new_status.

In other words, if the old status was ok and the new status is wife, then I set the wallpaper of my phone to: /storage/emulated/0/Tasker/images/inbox_status/wife.jpg.

Regardless of whether the status has changed, I note the time the status was set in %INBOX_STATUS_LAST_SET. That will come in handy in checking to see if it's been too long since my last status update.

The if condition in SetInboxStatus ensures that the phone only sets the background, a relatively expensive operation, if there's a change. This makes it safe to call SetInboxStatus with a non-changing status as often as the system wants.

The next Task is InboxStatus Watchdog. This task keeps an eye on %INBOX_STATUS_LAST_SET.

This value minus %TIMES is the number of seconds that have passed since a status was set. If this value gets to be larger than 1230 seconds (20.5 minutes), then it kicks in and sets the %INBOX_STATUS and background to unknown.

Next up, these Tasks need to be called by Tasker. This happens through two different Profiles.

The first profile depends on AutoRemote and looks for incoming messages with the regular expression ^SetInboxStatus.

There's a single action associated with this profile: run the task SetInboxStatus with the first parameter set to %arcomm. %arcomm is a magic variable that will be set to the right-hand side of the delimited message sent via AutoRemote. The server is sending messages in the format: SetInboxStatus=:=wife. In this case, %arcomm would be set to wife.

The watchdog profile is even simpler: it's set up as a Time profile that runs from 12am to 11:50pm and repeats every 5 minutes. Every time this profile runs, it invokes the task InboxStatus Watchdog.

All that remains is select the appropriate images for the different statuses. For the ok status I choose a standard background image. For the other status, I've asked Gemini for an assist, and created alert specific images.

When all is OK, my phone's home screen looks like so:

With an urgent message in my inbox, the background changes to:

The lock screen is also updated:

With nearly any interaction with my phone, an urgent alert will be painfully obvious.

I've had this system running for a little over a week now, including while we were on vacation in Hawai'i. While I have yet to receive an actual urgent message (hurray!), I did have the unknown status kick in when we were hiking in remote areas and my phone had no signal. When we returned to civilization, the ok status background would kick in. This gave me a delightful sense of assurance that even if I wasn't closely watching my email, a script I developed was.

You can grab the Tasker code for all of the above here. I'd still love to cook up a hardware based solution, but in the meantime, this Google API, AutoRemote, Tasker solution is working exceptionally well. You should give it a try!

No comments:

Post a Comment