Close

Pushing beyond the local network

A project log for Monitoring washing machines

One mans quest to spend less time in the basement

lars-knudsenLars Knudsen 03/07/2016 at 20:362 Comments

After a weekend of working out why the script would only run for 2-6 hours at a time, my first hunch was that the wifi adapter had a problem as it would loose network connection when I discovered the script had stopped. After several tests (remember each one would take several hours) with powered hubs and the other usb wifi dongle I found an error in my script which would exit the script if the connection to google did not succeed. I guess the wifi dongle would disconnect after a while of inactivity leading to my false diagnostic and a weekend well spent...

Anyways, onwards and upwards! I have been looking into generating push notification for my (android) phone. My first attempt was instapush, but their service seemed to be down from sunday when I first found them, until monday when I decided that they probably weren't a stable choice, and direct my attention elsewhere. I explored RemoteAlert but quickly found that their app seemed half baked. When I pressed settings a picture of a parrot appeared, and their default notifications did not suit my liking.

I'm not sure what the RemoteAlert app is trying to tell me here...

Finally I came across PushBullet which I was quickly able to use just by writing a command in ssh, the notifications were nice and configurable so it became the weapon of choice. However it took a while to get working in python as I first tried, and was completely unable to get pushbullet.py to work. Afterwards I tried pyPushBullet and PushBulltPythonLibrary but all three libraries used the name 'pushbullet' once installed so I think they messed with each other. After trying to clean up and reinstall several times I decided to find a library which used another name, pushybullet, which worked like a charm. For future work I might have to put a bit more work into learning to install manually instead of using pip, in case I'd like to change stuff like the name.

My first notification and the simple piece of code producing it.

While pushybullet is fine for my work right now I spent a few minutes looking around the pypi database for other pushbullet libraries and I found ntfy, which has been designed to support multiple backends. I'd like to change to that in the future to make it easier to switch to another backend if my preffered goes down, like instapush.

Discussions

Lars Knudsen wrote 04/08/2016 at 13:29 point

Haven't messed with channels yet, sorry, but thanks for the heads up on ntfy :)

  Are you sure? yes | no

Jon Bolmstedt wrote 03/20/2016 at 20:04 point

Do you know how to send to any Channels the connected api hosts? 

Your example worked directly for Devices.

But forget ntfy, does not work on Python 2.x, because requires https or something. Could't get it to work with py 3 either.

  Are you sure? yes | no