Python Wrapper

From a contributor, enjoy!

Since my favorite programming language is Python and thus my complete home automation consists of Python scripts etc. and Rachio didn’t currently have a Python hook to the API I decided to write my own. This first version consists of all public API calls that are currently possible and I’m looking forward to add new features as they are introduced. See GitHub - rfverbruggen/rachiopy: Python client for Rachio Irrigation controller for the Python API implementation, hopefully other people can use this to.

:cheers:

3 Likes

Thanks for sharing!

If there is a need for a API hook in another language please let me know

thanks for this wrapper… pardon my ignorance… perhaps I’m not setting this up properly… I downloaded it all to a directory, then python setup.py install

from rachiopy import Rachio

worked fine, but when I tried to do

r = Rachio(…

I got this:

File “”, line 1, in
File “build/bdist.macosx-10.3-x86_64/egg/rachiopy/init.py”, line 22, in init
self.flexschedulerule = FlexSchedulerule(self)
NameError: global name ‘FlexSchedulerule’ is not defined

What is happening?

and one more question:

I’m not quite sure how web hooks work… I’m trying to post a run time per zone to ThingSpeak, which can be done with the ThingSpeak API

https://api.thingspeak.com/update?key=apikey&field1=zonenumber,field2=controller,field3=runtime

just how do make this happen?

thanks for any assistance

Found the problem, is fixed!

See: https://github.com/rfverbruggen/rachiopy/commit/1cdbc77629939f5c9561ed1a318f3c1a1c86dcd4

I have no experience with Thingspeak, hopefully someone else can help you with that!

1 Like

thank you very much.

I’ve gotten your wrapper to work - it’s great to have that in scripts that I can play with to see the data structures… So the read operations work fine. When I try to update something (turn on a zone, set a webhook), nothing happens… Have you gotten the wrapper to work for all APIs?

The thing here is that the api isn’t providing something back. See: https://rachio.readme.io/docs/publiczoneid

Is your zone turned on when you start a zone?

Same problem here: https://github.com/rfverbruggen/rachiopy/issues/2

Maybe I should send the response and content back with every request so that we can see what the http response message is. So every request will respond with:

return (resp, content)

Instead of:

return content

On github some more issues where reported.

These are all sanitised in the latests version.

Thanks for the library. I was able to download it and can generally figure out what’s going on. I’m looking for some suggestions on WebHooks. Basically I already have a nginx server running that is forwarding requests from Alexa to a series of custom python skills running in the Alexandra python framework.

This is all working well. I have another python system that is running datalogging for my home automation system. What I am looking for advice on is a simple python framework that I can incorporate in my system that will allow me to forward the WebHook callbacks from my nginx server to my python script. I am trying to log when the sprinkler zones turn on and off so I can measure how much water I am using for that zone. I am in the process of incorporating a water meter into my home automation system.

Any suggestions for an easy python framework that I could use to process the WebHooks once I forward them from my nginx server?