Sending alerts with Pushbullet


 

Steve_M

TVWBB Guru
Pushbullet is a pretty neat (and free!) service that works across multiple platforms (iOS, Android, Windows, Mac).

You can also have the HeaterMeter send an alert to Pushbullet and it will arrive on all of your devices that are connected to your Pushbullet account.

Update:

This is now standard in the Linkmeter Alarms configuration with the latest snapshot. HTTPS pushes coming once I validate that the ca-certs package isn't causing any other problems.

You can add the following to the "All Alarm Script" section in the HeaterMeter config.

Code:
#!/bin/sh
TYPE="Content-Type: application/json"
PB_KEY="Pushbullet_Access_Token"
PB_HOST="https://api.pushbullet.com/v2/pushes"
PB_MSG=" { \
\"type\": \"note\", \
\"title\": \"HM Alert: $pn: $pcurr\", \
\"body\": \"$pn Alert: Alarm $al_type outside threshold $al_thresh, currently $pcurr\" \
}"
curl -k -o /dev/null -s -H "$TYPE" -u "$PB_KEY": -d "$PB_MSG" $PB_HOST

Replace the contents of PB_KEY with the Access Token found in the Account Settings on the Pushbullet website.

If the above text is hard to copy/paste from, you can click here.

Feel free to play around with the title and body lines to customize the message to your liking.

All of the alarm script variables are listed on the Alarm Script Recipes wiki page.

toygR2Ol.png
 
Last edited:
I've updated the first post to split the PB_MSG line into multiple lines to make it easier to cut and paste as well as making it easier to read and edit.
 
This is now standard in the Linkmeter Alarms configuration with the latest snapshot. HTTPS pushes coming once I validate that the ca-certs package isn't causing any other problems.

Thanks for doing all the work, Steve!
 
I update and tried testing it out but something isn't working right. Even the previously working email alarm and Pit Meter alarm aren't working anymore when I try and click test alarm. I went into the sys log and I see the alarm started but then it looks like it is immediately stopped.
 
I just tried it on a fresh system, it works just fine with the default config, add the Access Key, check the Pushbullet box, Save and Apply, then hit the test button. 10 seconds later my phone bings. Maybe you've got something in one of your boxes that's messing up the script?
Code:
Sep  1 12:11:00 OpenWrt user.warn lucid[523]: Alarm 0L started ringing
Sep  1 12:11:00 OpenWrt user.notice lmalarm: Sending pushbullet notification
Sep  1 12:11:00 OpenWrt user.warn lucid[523]: Alarm stopped
 
I did the same thing. I then did a test without pushbullet ticked with the same result; previously working. The only thing I didn't try is plugging in a probe when I was testing. I didn't think this would matter, does it? I will try that later.
 
I've just tested it myself and it seems to be working ok.

I've also got some other things configured in the "All Alarm Script" section that are also firing, such as my ThingSpeak > Twitter integration.

Thanks again for baking this into LinkMeter.
 
I did the same thing. I then did a test without pushbullet ticked with the same result; previously working. The only thing I didn't try is plugging in a probe when I was testing. I didn't think this would matter, does it? I will try that later.
I did all my development with no probe plugged in and it worked ok. Just tried it with no probe and with a probe, same results. Works fine. I am not sure why it wouldn't work for you. Did you flash just the linkmeter package or the whole snapshot?
 
I did all my development with no probe plugged in and it worked ok. Just tried it with no probe and with a probe, same results. Works fine. I am not sure why it wouldn't work for you. Did you flash just the linkmeter package or the whole snapshot?
I flashed the whole snapshot. Funny thing is I tried it again this morning (Australia) and it worked, well the email and Pit Meter alerts were. I have to double check my token for pushbullet, I think I may have it entered wrong. I did have much time to mess with it this morning, it was just bugging me this morning so I plugged in a probe and tried it. I will try again this evening without the probe just to verify but as long as it works I don't really care even if I do have to have the probe in for some reason.
 
So it's working now lol. I swear I tried it like 10 times yesterday and couldn't get it to work no matter what I changed or did, so I dunno. All good now though! On a side note I just realized looking at the configuration page that I installed my LEDs upside down; red on top :-/.
 
So it's working now lol. I swear I tried it like 10 times yesterday and couldn't get it to work no matter what I changed or did, so I dunno. All good now though! On a side note I just realized looking at the configuration page that I installed my LEDs upside down; red on top :-/.

You should be able to change the color of the LEDs on the setup page, to match your soldered LEDs.
 
Nope! That's just on the TODO list but never really seemed like a priority. :-D Sorry!
When I went to add the LEDs I didn't look and just assumed I could make the colors any order I wanted in the GUI. It's not really a huge deal. Buuuuut if it's not that hard it would be handy lol :).
 
Last edited:
You can change the behaviours of the LEDs. in the dropdown list, so just swap the behaviours between green and red.
Yeah I know you can change the behavior. It's just the colors on the GUI don't match what's on the HM. I dunno OCD I guess :). Also, sorry for steering the convo way off course haha.
 

 

Back
Top