Hypercharging push notifications with Pushover (and others)

oZoneDev
zmNinja
Published in
4 min readMar 8, 2020
Photo by Lopez Robin on Unsplash

Starting ES 5.9.9, I now support a mechanism were you can deliver push notifications via 3rd party push systems. I’ve been asked to support it for a while now but never got around to doing it. To be honest, I never quite saw a value, since zmNinja already supports push. However, I realized much later that there are many use-cases for push notifications that zmNinja/ES does not support today, that users want, which include:

  • Critical Notifications
  • Quiet Times
  • Dekstop Notifications
  • and lots more

Github user tarheele recently wrote a script to support pushover (a popular 3rd party push server) for his own needs which motivated me to take a look at why people really use pushover. There are many 3rd party push solutions, but when I actually tried pushover, I was impressed:

  • It’s pricing (yeah it is not free) is very attractive. It is a one time cost of USD 5 per platform. No more fees. This gets you 7500 messages a month which is a lot.
  • What it does is it has its own mobile client, that receives push. It is not a fancy client, it’s intended just to receive pushes and view them. The good part is the client can be customized for many things on how pushes are delivered.
  • The part that I found super useful is it also provides a desktop solution. Basically, it delivers push notifications to your desktop as well if you want. Furthermore, if you are using MacOS (which I do), it can deliver push notifications without your browser being open. For other platforms, your browser needs to be loaded.

So I promptly bought two license for pushover, one for my iOS platform (so I can install it on my iPad and iPhone) and one for my desktop. I really only needed desktop, but wanted to try out both.

Desktop Notifications

First, my real usecase — desktop notifications.

Desktop notifications

That is my desktop, showing notifications of all my alarms. This is my zmeventnotification.ini config to support pushover:

[fcm]
# Use FCM for messaging (default: yes).
enable = yes
[push]
use_api_push = yes
api_push_script = /var/lib/zmeventnotification/bin/pushapi_pushover.py
[hook]
event_start_notify_on_hook_success = all
event_end_notify_on_hook_success = api

Let’s parse the above:

  • I’ve enabled FCM — this means the ES will send pushes via FCM to the zmNinja app. You can choose to disable this and only use 3rd party push, but then you’ll lose the ability to preview events on tap etc.
  • I’ve also enabled API push via pushover (Note that you need to run sudo ./install.sh to get the push scripts installed). So yes, I get duplicate notifications, one via FCM and one via Pushover for now. It’s fun.
  • Next up, I’ve also enabled notifications for event end, but for api (pushover) but not fcm

What this means is when new events happen, they will be delivered to zmNinja and pushover. When new events finish, they will be delivered to pushover.

Pushover Configuration

If you see, in pushover, I’ve defined two clients, my iPhone and my Macbook. By default, if you send notifications via pushover, both of them will get it.

Note however, you don’t have to deliver it everywhere. You should customize param_dict in the pushover script to include/exclude what you need. For example, if I only wanted to deliver this to my iPhoneX, I’d add a device:"iphoneX" to that dictionary (because that is what I’ve named my phone above). There are many more options. See here.

Customizing notifications

As I mentioned, there are many customization options, including quiet time, ctitical notification support etc. Here are some options you can specify:

Caveats

  • Remember, pushover is a standalone system. So when you tap on notifications delivered by pushover, they get handled by pushover’s client, NOT zmNinja. For example, this is what happens when I tap on notifications from pushover — their client interface is loaded.
  • If you are using OSX, and opt for the browser less notification (that is notification tray integration), then the notifications will not include images. It is a platform limitation, based on what the pushover folks told me. Tapping on it will show images because the browser client opens up.
  • If you are using Windows/Linux and want push notifications to desktop, your browser needs to be open, but I believe you will get images as well.

Beyond Pushover

The entire concept of this new plugin is just to demonstrate what can be done. I provided a script for pushover. Feel free to add your own.

--

--

oZoneDev
zmNinja

A breath of fresh air for security and surveillance software