Hi,
with all this weather around lately, I thought it would be nice to have my RPi weather station send me updates. Initially I thought of twitter (very public), wechat (because I have it and it's a great service, but I would have needed a public facing webserver), but then someone mentioned a service called PushBullet.
I had never heard of that one. It so easy though. In 10-15min. you can setup an PB account (uses Facebook or Google to login), generate an API key, and start sending your mobile device some messages. I wrote up a bit of info here: https://www.raspberrypi.org/forums/viewtopic.php?f=41&t=133039&sid=65a056a660e1bdfc0e21f098c6204b9b&p=886852#p886852
You can push out Weather info, graphs, photos, RPi boot up IP Address, Bootup/shutdown notifications, status info, security notifications, Octoprint print notifications... this list is endless!
Need a push notification service?
Re: Need a push notification service?
Note: if you want to run a PushBullet bash/python script at boot up, you will need to sleep, or pause the script for 10 seconds so the network can properly establish.
Here is a bash script that uses curl (something different) to push out a notification to a PB account:
I call it from: /etc/rc.local so it kicks off at boot up. It can also be called from the root crontab.
Here is a bash script that uses curl (something different) to push out a notification to a PB account:
Code: Select all
#!/bin/bash
#
# sends out a pushbullet notification to an account
cd /home/pi/pushbullet
sleep 10
API="add-pushbullet-api-here"
DATETIME=`date "+ %Y-%m-%d %H:%M:%S: "`
HOSTNAME=`hostname | tr '[:lower:]' '[:upper:]' `
IPADD=$(/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
MSG=" '$HOSTNAME' $IPADD has booted up at: $DATETIME!"
curl -u $API: https://api.pushbullet.com/v2/pushes -d type=note -d title="RPi Booted up:" -d body="$MSG" >/tmp/BOOT.out 2>/tmp/BOOT.err
I call it from: /etc/rc.local so it kicks off at boot up. It can also be called from the root crontab.
Re: Need a push notification service?
Example Screenshot of a PushBullet notification:
Re: Need a push notification service?
I must give this a go, even for work I see it would be nice
BLOG: https://my.makeraddiction.com/
Thingiverse: https://www.thingiverse.com/seaton/
Github: https://github.com/madeinoz67
Thingiverse: https://www.thingiverse.com/seaton/
Github: https://github.com/madeinoz67