Change schedule rule based on local water restrictions

Hello Community,

I live in an area where water restrictions can be enforced based on how much rain the area has received. This means, when we’re in a drought, we can only water our yards 1x per week on a specific day. Due to this restriction, I’ve setup 2 watering schedules.

What I’d like to accomplish is, use an AWS lambda function to scrape the current restriction, and change my Rachio scheduling rules via API call based on the current restriction.

I’ve successfully pulled down the current water restriction from my local utility company, but I don’t see any Rachio API documentation that allows me to disable or enable my watering schedules I’ve created.

I have tried to POST to the watering rule ID with json data for the specific field I’m trying to edit, but that was a fail.

Let me know if anyone else has tried to do similar and how you’ve accomplished this.

Thanks you!

Clicking the Enabled switch for a schedule sends a PUT to schedule/updateSchedule with many (though not all) of the schedule’s parameters.

You might try sending a PUT with only ‘enabled’ and ‘schedule_id’, but I suspect that it would either butcher the schedule or be rejected. However, if true, it’s not that serious – read the current settings, change the value of enabled and PUT the result.

1 Like

Hey Stewart,

Thanks for the suggestion! That worked!

I just changed the endpoint to what was referenced in the developer tools and passed the basic “enabled” flag along with the schedule ID.

curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" -d '{"enabled": true,"schedule_id": "$SCHEDULE_ID"}'