OpenSprinkler Forums OpenSprinkler Unified Firmware Custome Water Restrictions

  • This topic has 4 replies, 3 voices, and was last updated 5 years ago by Ray.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #41358

    Zodiac69
    Participant

    Is there a way to add custom water restrictions?
    I am in South Africa and the city of Cape Town has implemented Stage 2 water restrictions.

    Watering (with drinking water from municipal supply) of gardens, flower beds, sports fields, parks, lawns and other open spaces allowed only on Tuesdays, Thursdays and Saturdays for a maximum of one hour per premises either before 09:00 or after 16:00. (This includes watering with buckets or automated sprinkler systems.)
    No watering will be permitted within 24 hours of rainfall that provides adequate saturation.

    #41390

    Ray
    Keymaster

    That will probably require you to host the weather script on your own server, and that way you can customize the script. The latest firmware allows you to change weather script location:
    http://demo.opensprinkler.com/su
    hence you don’t need to reflash the firmware.

    #41412

    Zodiac69
    Participant

    Hi Ray

    I am no software guru, but if you can point me to some examples of what i need to do and how the script work, i can see if i can get it to work on my local server.

    #41455

    PollieXmas
    Participant

    Don’t do what I did and delete all your old programs to cater for this 😉

    Simply create a new program and call it “CoCT Stage 2”. Then set it to start at sunrise or even at 7am (Tuesday, Thursday and Saturday). Then divide the allotted hour between all your stations and disable any old programs you had setup. This way switching back around April will be a breeze. (I altered my existing programs, realising too late that it was not required and I had quite a number of programs running independently to give me the flexibility I needed.)

    The only thing that I have not enabled is to automatically disable the program when it rained (adequately) the day before. (I think we’re fairly safe until middle March though.) If we do happen to get adequate rain it is easy enough to manually disable the program or OpenSprinkler itself the first thing in the morning or the night before and enable it again when you get back from work.

    I know there is a way to use weather predictions, but I have not had the energy to look into how to incorporate predictions. I use YR.no and find them the most accurate of all, but even they make adjustments a few hours before the current time. I’m lucky enough that they have a prediction for my neighbourhood but it still does not mean that if they predict 3mm that I will get all of it at my property. So to get this to work accurately, we’ll probably have to amend the code to use predictions in conjunction to a rain sensor and/or on-site rain meter for the lucky ones.

    #41530

    Ray
    Keymaster

    It’s kind of hard to explain how the weather script works. Here is the simplified version. First, the firmware sends a weather call in this function:
    https://github.com/OpenSprinkler/OpenSprinkler-Firmware/blob/master/weather.cpp#L126
    as you can see, it takes the weather script location (which you can modify from the /su page), attaches a bunch of parameters (notably the location, and the WUnderground API key), and issues an HTTP GET command. The script is assumed to be a python script (but you can use other scripting languages as well). Upon returning, this is the callback function that handles the return data:
    https://github.com/OpenSprinkler/OpenSprinkler-Firmware/blob/master/weather.cpp#L49
    If you write your own custom script, it just needs to return data in the format that the above function can parse. For example this is what the current script returns:
    http://weather.opensprinkler.com/weather0.py?loc=01002

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

OpenSprinkler Forums OpenSprinkler Unified Firmware Custome Water Restrictions