How can we help?


How to temporarily pause/resume a running program

Comments

6 comments

  • Official comment
    Avatar
    RainMachine Nicholas (Edited )

    The correct syntax would be:

     

    curl -k --request POST  --data '{"rainDelay": 1}' https://192.168.12.131:8080/api/4/restrictions/raindelay?access_token=....

     This will set Rain Delay/Snooze for 1 day.

    The Rain Delay(Snooze) can also be set more precise:

    curl -k --request POST  --data '{"rainDelayStartTime": 1489494018, "rainDelayDuration": 86400}' https://192.168.12.131:8080/api/4/restrictions/global?access_token=....

    where rainDelayStartTime is the start time as unix timestamp ( see www.unixtimestamp.com)

    and 

    rainDelayDuration is in seconds

    Comment actions Permalink
  • Avatar
    dexterdom

    I think I can accomplish a pause by setting a rain delay using the /restrictions/raindelay POST method, but I'm not able to figure out the correct syntax to pass the parameter for the number of days. Also, I'm assuming I can set the # days to 0 to cancel the rain delay (is this correct)?

    Here is the curl command I am trying, can someone please help identify where I'm going wrong? I'm getting HTTP 400 Bad Request error.

    Thanks in advance

    curl -m 10 -k --include -d "{\"raindelay\":1}" https://192.168.0.20:8080/api/4/restrictions/raindelay?access_token=etc.

    0
    Comment actions Permalink
  • Avatar
    dexterdom

    I ran a GET command for raindelay and based on that output I updated my curl command to the following. I'm still getting HTTP 400 error, so my parameters are not correct. Any advice would be appreciated. Thanks

    curl -m 10 -k --include -d "{\"delayCounter\":1}" https://192.168.0.20:8080/api/4/restrictions/raindelay?access_token=etc.

    0
    Comment actions Permalink
  • Avatar
    dexterdom

    I'm hoping someone from Rainmachine will read this and help? 

    0
    Comment actions Permalink
  • Avatar
    dexterdom

    Thanks Nicholas,

    I was tired of having a conversation with myself and gave up on this :-) However, since you responded - is this the correct approach to my problem (posed in my first post)? Would you recommend another way?

    Also - based on my reading - the HD-12 doesn't even support rain sensors, so would this approach work?

     

     

    0
    Comment actions Permalink
  • Avatar
    RainMachine Nicholas

    Hi,

    For HD12/16 we're adding rainsensor support. Actually it's already on available beta version and you can read about connecting it here: https://support.rainmachine.com/hc/en-us/articles/227832747-Rain-Sensor

    Snooze (which was initially called Rain Delay) it's software and doesn't require a rain sensor but it will just remove everything from watering queue. The only restriction that reschedules the watering queue is the hourly restriction (meaning it moves the zones after the restriction finishes).

    To create a hourly restriction you need to POST /api/4/restrictions/hourly with the body :

    {
    start: 360 //<4AM day start minute (hour * 60)>
    duration: 60 //<in minutes>
    weekdays: "1111111" // 1 enabled for this week day (MTWTFSS)
    }

     

    0
    Comment actions Permalink

Please sign in to leave a comment.