OpenSprinkler Forums OpenSprinkler Unified Firmware Change Program Data

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

    arcanum246
    Participant

    Hi There,

    I am looking for a way to to enable/disable an existing program through the HTTP GET commands, without specifying the other variables.
    I would like to use the IFTTT service to to enable a program if the forecast for tomorrow is going to be above a certain temperature, and like wise disable it if it below

    i have been using to use /cp?pw=xxx&pid=x&v=[flag,days0,days1,[start0,start1,start2,start3],[dur0,dur1,dur2…]]&name=x

    but more specifically http://IP:Port/cp?pw=PASSWORD&pid=2&v=%5B1%5D and have tried http://IP:Port/cp?pw=PASSWORD&pid=2&v=%5B1,,] and a few more.

    But all combination i have tried writes over the program, changing station time to 0, and program name to “Program 3”.
    I want to be able to have a program called HOT DAY, where myself or my wife can make alterations to what stations we want depending on the season via the OpenSprinkler App, then have it enable/disabled via the HTTP GET function.

    Are there escape character I should be using as placeholders?

    Thanks for your time.

    #41529

    Ray
    Keymaster

    Unfortunately the API currently does not provide a way to change programs with a partial set of parameters. You have to provide all parameters, otherwise it will end up change the program incorrectly.

    What the app does is to construct an HTTP GET command with all the required parameters, and send that to the controller. Because it has to load the program data in order to display the program anyways, it knows all the required parameters.

    So if you want to use the existing API, you need to issue an /jp to obtain program data first, then /cp to change program, even if all you want to do is to set/reset program enable bit.

    Alternatively, if you don’t mind re-compiling the firmware, you can add a new HTTP GET command, say, call it /ep (enable program) which allows you to quickly enable/disable a program. It’s pretty easy to follow the existing HTTP GET command to create a new command.

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

OpenSprinkler Forums OpenSprinkler Unified Firmware Change Program Data