iOS Notifications in OpenHAB using Prowl

Notifications are a great way to draw the attention, should something unexpected be detected. OpenHAB offers notifications capabilities for iOS and Android devices, but also email, twitter, etc … using bindings/actions. In this post, I’ll be focusing on iOS notifications using “Prowl”.

Prowl

Some things are required for Prowl notifications to work with openHAB:

  • a Prowl API key
  • updating openhab.cfg
  • a notification rule in OpenHAB
  • the prowl action jar in the addons folder
  • a Prowl client on the iOS device

API Key

Go to Prowl – iOS Push Notifications and register for a free account. You can then generate an API key to be used by your application.

prowl-1

openhab.cfg

There are three parameters that need to be set in the openhab.cfg file for Prowl to work.

  • the API key which was generated earlier
  • a default priority
  • API URL

prowl-2
Don’t forget to uncomment the lines by removing the “#” at the start of the line.

Note that the URL used is different than the default. I think the default value is obsolete, as the page is not accessible.

Rule

It seems there are multiple ways to define the pushNotification, so I tried them all to see which notification I would (or not) receive.

The first notification makes use of the API key and priority defined in the openhab.cfg file. The other two notifications override these values by defining the API key and or priority in the call.

What this rule does is the following:

  • when the front door is opened, start a 5 minute timer
  • if the front door is closed, abort the timer if it is still running
  • if the door is still open when the timer reaches the end, a notification is sent

Addon

The prowl jar needs to be put in the openhab addons folder for it to work.

Client

The client can be downloaded from the App Store. Unfortunately, it’s not free … But at $2.99 and for the sake of testing and being notified when something happens, I bought the app.

prowl-3

Test

As stated earlier, I defined 3 different notifications, each with a different set of parameters. I received all 3 of them, meaning that the syntax for each of them is valid, which is good to know.
The different syntaxes allow to experiment with different API keys or priorities depending on the notification.

The notifications appeared on my phone and the details could then be viewed:

prowl-4

Et voila, notifications are working!

3 thoughts on “iOS Notifications in OpenHAB using Prowl”

Leave a Reply

Your email address will not be published. Required fields are marked *