Bash Hooks?

Has anybody written an interface to Rachio in bash? I run a home automation server that’s just an Ubuntu box and would love to be able to trigger some watering via bash.

Specifically, I’d like to write a cron job that polls the temperature at 4PM and if it’s above 80 degrees F, it waters two of my zones for five minutes each.

I’m open to alternate suggestions, as well!

Thanks!

Rob

API documentation is at


Your bash script can simply call curl to start the watering sequence – see

1 Like

Hi Rob, sorry didn’t get back to your via your email. Seen it, but got sidetracked with other projects prior to being able to answer. For your original question via the email, sorry I didn’t have any code ready that would allow you to do something similar to what you are asking.

@Stewart has given you good advice as to how you can go about accomplishing what you are asking. Unfortunately you have two requirements for when you schedule should be ran, time and temperature. I do not know any ready way that can complete both out of the box (feedback from wider community is welcome).

Bash is a very limited language to setup what you’re asking for. Because of this I can’t recommend any existing integrations for weather data or Rachio. That being said you can setup a python, javascript or php runtime and search https://github.com/ for libraries supporting WU / Rachio. Combining them into one program should not be too hard, though feel free to ask for help here.

I’ve been fiddling with the web API and curl for the last hour or so and I can now start zones with bash! Yay!

However, I’m finding that zone/start_multiple is just returning this:

{
    "code": "301",
    "error": "No zones found"
}

I’m trying in bash with curl, but also in Postman - sending the default data except my zone IDs in there instead of the defaults. I validated my zone IDs by calling them one at a time with zone/start. Am I missing something obvious with that call?

The exact code I’m using, with my zone IDs redacted in case it’s sensitive information:

  [
	{
		"id": "zone id one",
		"duration" : 60,
		"sort_order" : 1
	},
	{
		"id": "zone id two",
		"duration" : 60,
		"sort_order" : 2
	}
]
1 Like

I think you need a complete object as in

{ “zones” : [
{
“id”: “zone id one”,
“duration” : 60,
“sort_order” : 1
},
{
“id”: “zone id two”,
“duration” : 60,
“sort_order” : 2
}
] }

Awesome! That did it. The API pulled in to Postman without the zones wrapper, and being a Postman noob, I didn’t realize I needed to add it.

@Gene Where do your talents end?!@#$

:cheers: