Earlier this week, I stumbled upon an iPhone app that allowed users to receive push notifications on XBMC.
When a notification is received in XBMC, it appears in the lower right corner of the screen.
Pretty cool.

This made me think it would be nice to see incoming phone calls there.

So I took out the Ovolab Phlink device I had sitting on a shelf, and created a small ‘ring’ script for it. That (Apple)script checks for the caller ID when the phone rings (and for a matching entry in my address book), and if it is available, calls an external PHP script that handles the network-wide notifications.

That script takes in parameters:

  • the message to send
  • a title
  • the list of recipients (computers)
  • the image to use for the Growl notifications (XBMC notifications don’t show any images, just a title and the message).
    So, before calling this PHP script, the ring script will create the message to send, and if there’s a picture for that person in my address book, it will save that picture to a shared directory on the local computer. Remote computers all have that shared directory mounted all the time, so they instantly have access to the caller photo, if any. :)

The notification PHP script then loop on all recipient computers, and depending on what they are will either:

  • Call growlnotify remotely using SSH
  • Make a HTTP call to the remote XBMC process, to send the notification
  • Make a HTTPS call to the Boxcar API, to send a Push notification on iPhone / iPad devices
    This worked really well. But I wanted to go one step further.

On the XBMC running on the Mac Mini that we use as home theater, I wanted to pause whatever was playing when the phone rang. Luckily, there’s also a HTTP call available to do that. Sadly, I soon realized that the “Paused” graphic appeared over any notifications! If I paused the video, the notification would simply not be readable.
I fixed that by using Growl on that computer. The Growl notifications appear over everything, and the currently playing videos is paused. Hooray!


Notification using Growl + paused XBMC


Notification using XBMC on Apple TV

Here’s my scripts:
ring.scpt automate_notification.php