OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) How To: Push notifications for OpenSprinkler

Tagged: 

Viewing 25 posts - 1 through 25 (of 55 total)
  • Author
    Posts
  • #38743

    Pat
    Participant

    I 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

    #38754

    Rpack
    Participant

    Very cool. Excited to try it.

    #38756

    Ray
    Keymaster

    Cool. Thanks for sharing!

    #38767

    Pat
    Participant

    Thanks guys!

    #38821

    joe
    Participant

    Any way to use this with Pushover?

    #38835

    Pat
    Participant

    I 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.

    #38841

    joe
    Participant

    Very 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?

    #38843

    Pat
    Participant

    You 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.

    #38845

    joe
    Participant

    Where do I get this

    ospiApiPasswordHex = “YOUR_OSPi_PASSWORD_IN_HEX”

    ?

    #38846

    Pat
    Participant

    Oops, 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.

    #38847

    joe
    Participant

    Figured it out. I used this to convert the ascii text to MD5 Hash

    http://www.stringfunction.com/md5-hash.html

    #38848

    Pat
    Participant

    Glad you got it!

    #38849

    joe
    Participant

    Yeah, 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 requests

    Sooo I did this

    sudo apt-get update
    sudo apt-get install python-requests

    #38851

    Pat
    Participant

    Try typing

    sudo easy_install requests

    #38853

    joe
    Participant

    Got 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!!!!

    #38855

    Pat
    Participant

    Great! 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) 🙂

    #38857

    joe
    Participant

    Me 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.

    #38864

    Ray
    Keymaster

    The 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).

    #38932

    Anonymous
    Inactive

    OK, 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:

    #38942

    Pat
    Participant

    Were you able to figure this out?

    #38943

    Pat
    Participant

    I’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

    #38944

    Anonymous
    Inactive

    Were you able to figure this out?

    Think so. Had to go to work, so had to stop playing. :thumbup:

    #38947

    joe
    Participant

    Got it working!
    Sweet addiiton
    Now there is two spots for the port, lol.

    Maybe a variable added in the future?

    #38951

    joe
    Participant

    Seems like I will learn a little python here….

    #38952

    Pat
    Participant

    Glad you figured it out! The port variable isn’t a bad idea either. I’ll work it into an update

Viewing 25 posts - 1 through 25 (of 55 total)
  • You must be logged in to reply to this topic.

OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) How To: Push notifications for OpenSprinkler