OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › How To: Push notifications for OpenSprinkler
Tagged: qu
- This topic has 54 replies, 1 voice, and was last updated 4 years, 6 months ago by Tygerr.
-
AuthorPosts
-
June 26, 2015 at 12:57 pm #38743
PatParticipantI received my OpenSprinkler just a couple of days ago and love it. I created a quick Python script that runs on the Raspberry Pi and it monitors the OpenSprinkler API every 5 seconds for station status. When it finds that a station is open, it will send a push notification to my phone (via Instapush).
Currently it only sends a push when a station begins (since that was all I wanted notifications for).
If you’re interested in setting this up yourself, here’s the link with a brief how-to. https://github.com/drsprite/OpenSprinkler-Push-Notifications
June 26, 2015 at 9:35 pm #38754
RpackParticipantVery cool. Excited to try it.
June 26, 2015 at 11:27 pm #38756
RayKeymasterCool. Thanks for sharing!
June 27, 2015 at 12:02 pm #38767
PatParticipantThanks guys!
June 29, 2015 at 8:10 pm #38821
joeParticipantAny way to use this with Pushover?
June 30, 2015 at 9:12 am #38835
PatParticipantI didn’t have a Pushover account, but I signed up for the 7 day trial for Pushover and was able to get it working. The name of my app is “OpenSpinkler” which is what is used for the title of the push notification.
In the script you need to define your App token, and user key, in addition to selecting “pushover” on line 24, for the pushService variable.
Then it should be good to go after the rest of the items are configured.
June 30, 2015 at 11:17 am #38841
joeParticipantVery cool. I figured out how to clone your repository and i checked out the scripts.
Do I need to modify this line
ospiStationStatus = urllib2.urlopen(“http://localhost:8080/js?pw=” + ospiApiPasswordHex).read()
If i changed the port of my open sprinkler?
June 30, 2015 at 11:46 am #38843
PatParticipantYou got it, if it’s running on another port, just change the :8080 to your port.
If you’re running it on port 80, you can just delete :8080 since port 80 is the default for http and doesn’t need to be explicitly defined.
June 30, 2015 at 1:31 pm #38845
joeParticipantWhere do I get this
ospiApiPasswordHex = “YOUR_OSPi_PASSWORD_IN_HEX”
?
June 30, 2015 at 1:33 pm #38846
PatParticipantOops, I said HEX there, and meant hash. You can use an online tool like this: http://www.miraclesalad.com/webtools/md5.php – Type in your password and it’ll hash it for you.
For example, hello is 5d41402abc4b2a76b9719d911017c592
You would then put 5d41402abc4b2a76b9719d911017c592 in as the opsiApiPasswordHex.
I’m going to change the script to say “Hash” instead of “Hex” for clarity in the future.
June 30, 2015 at 1:34 pm #38847
joeParticipantFigured it out. I used this to convert the ascii text to MD5 Hash
June 30, 2015 at 1:36 pm #38848
PatParticipantGlad you got it!
June 30, 2015 at 1:47 pm #38849
joeParticipantYeah, getting close. I modified per the instructions and I am getting this error:
sudo python ospi_push_notifications.py
Traceback (most recent call last):
File “ospi_push_notifications.py”, line 14, in <module>
import urllib2, json, requests
ImportError: No module named requestsSooo I did this
sudo apt-get update
sudo apt-get install python-requestsJune 30, 2015 at 2:03 pm #38851
PatParticipantTry typing
sudo easy_install requests
June 30, 2015 at 2:17 pm #38853
joeParticipantGot it all working , thanks.
One note for the installers. If you checkout the package with GIT it drops the software in /home/pi/OpenSprinkler-Push-Notifications
You ether need to modify the ospi-notifications script
from
DAEMON=/home/pi/ospi_push_notifications.py
to
DAEMON=/home/pi/OpenSprinkler-Push-Notifications/ospi_push_notifications.py
or move it to /home/pi or the service with not work.
Pat: Thanks!!!!
June 30, 2015 at 2:41 pm #38855
PatParticipantGreat! Glad you got it working 🙂 You were the first that I know of to use it.
I enjoy knowing when my sprinklers are going when I’m away from the house. Sometimes it’s a reminder to me to turn them off (if the rain sensor doesn’t kick in or something) 🙂
June 30, 2015 at 2:49 pm #38857
joeParticipantMe too! Going away on vacation and like to know things are running well too.
I have a Vera for home automation but the Opensprinkler plugin isn’t working for me and that plugin doesn’t do notifications for the OpenSprinkler.
June 30, 2015 at 4:42 pm #38864
RayKeymasterThe Vera plug-in is not written by us and I think it only works for an earlier version of the firmware (2.0.9 or earlier).
July 1, 2015 at 9:50 pm #38932
AnonymousInactiveOK, I must be dense! I cannot for the life of me determine where in the script to put the pertinent information?
Disregard. I am dense. I downloaded the html link to the file. I’ll git now…:confused:
July 2, 2015 at 9:19 am #38942
PatParticipantWere you able to figure this out?
July 2, 2015 at 9:20 am #38943
PatParticipantI’ve updated the script to include notifications for when the rain sensor is activated and when it clears.
https://github.com/drsprite/OpenSprinkler-Push-Notifications
July 2, 2015 at 9:32 am #38944
AnonymousInactiveWere you able to figure this out?
Think so. Had to go to work, so had to stop playing. :thumbup:
July 2, 2015 at 11:29 am #38947
joeParticipantGot it working!
Sweet addiiton
Now there is two spots for the port, lol.Maybe a variable added in the future?
July 2, 2015 at 11:34 am #38951
joeParticipantSeems like I will learn a little python here….
July 2, 2015 at 12:00 pm #38952
PatParticipantGlad you figured it out! The port variable isn’t a bad idea either. I’ll work it into an update
-
AuthorPosts
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › How To: Push notifications for OpenSprinkler