GreenIQ Irrigation Plugin

Posted on
Fri Mar 31, 2017 12:07 pm
AndyVirus offline
Posts: 257
Joined: Mar 18, 2014
Location: Newport Pagnell, UK

GreenIQ Irrigation Plugin

Hello,

I may be the only one with this (looking at the search results for GreenIQ) but if someone with any spare time and knowledge about writing a plugin could assist, many beers would be owed.

Basically there is a Python module already created and a sample script found here: https://bitbucket.org/greeniqrd/gardenkit-python-sdk
It uses oAuth to authenticate to their rest API.

What I would like is a plugin that would allow me to turn on a zone for a specified amount of time. Thats it.
GreenIQ has only 6 zones. I just want to be able to turn a zone on for x.
I can then use triggers or schedules to determine when to turn on zone y for x.

Anyone have any spare time that knows how to write what looks to be a simple plugin?

The Story: GreenIQ supports the use of FlowerPower sensors. It only supports 1 per zone though. I have 14 FlowerPower sensors. GreenIQ waters on a schedule, and does not if flower power says there is enough water. I want to water when the soil is too dry (trigger) not on a schedule.
I already have my irrigation system set up and is fed from water butts (mains powered pump), and if the buts drop too low (float switch) the mains water is used (solenoid valve).]

Posted on
Fri Mar 31, 2017 1:30 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: GreenIQ Irrigation Plugin

Alas, a plugin is problematic since the library requires Python 3 and plugins run in Python 2. Doable, but certainly more work. And with that, let the other developers chime in.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sat Apr 01, 2017 2:59 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: GreenIQ Irrigation Plugin

I'm not familiar with these devices, but I thought there was already support for FlowerPower by another plugin?


Sent from my iPhone using Tapatalk

Posted on
Sat Apr 01, 2017 3:35 am
AndyVirus offline
Posts: 257
Joined: Mar 18, 2014
Location: Newport Pagnell, UK

Re: GreenIQ Irrigation Plugin

FlowerPower yes, GreenIQ no. So i can get the plants data from the sensors but i cant tell greeniq to irrigate based on that data. GreenIQ will be sending my clientid and secret for oauth tomorrow with sample scripts so hopefully they will make the process simpler (hopefully python 2 and not using the above library)


Sent from my iPhone using Tapatalk

Posted on
Sat Apr 01, 2017 6:43 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: GreenIQ Irrigation Plugin

Ah right, got you.


Sent from my iPhone using Tapatalk

Posted on
Sat Apr 01, 2017 1:42 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: GreenIQ Irrigation Plugin

AndyVirus wrote:
FlowerPower yes, GreenIQ no. So i can get the plants data from the sensors but i cant tell greeniq to irrigate based on that data. GreenIQ will be sending my clientid and secret for oauth tomorrow with sample scripts so hopefully they will make the process simpler (hopefully python 2 and not using the above library)


FYI, you can do oauth1 and oauth2 with Python 2.7 with a few additional Python libraries - notably requests-oauthlib which also depends on the oauthlib library (it just so happens that I'm working with those right now). It's basically the excellent requests library (which we include in the installation) extended to work using oauth authentication. It's pretty likely that we'll be including both requests-oauthlib and oauthlib (and potentially other libs as well) in the next minor (7.x) release though it's not yet guaranteed. That's about as far as I can help, but the docs and examples are all there.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Apr 09, 2017 4:25 am
AndyVirus offline
Posts: 257
Joined: Mar 18, 2014
Location: Newport Pagnell, UK

Re: GreenIQ Irrigation Plugin

So i received some info from the GreenIQ support guys:

One is a Python 2.7 example script: https://greeniq.zendesk.com/attachments/token/SIJuyXl1uaRBCsaMRplrjrm2e/?name=api_demonstration_2.py
This is a description of the API calls (though is not exhaustive): https://greeniq.zendesk.com/attachments/token/Q4eiOnoBcEyMOEVXlyhZMlOtk/?name=GardenKitAPI-V2+%281%29.pdf
And the below was a reply to the question: How do you turn a zone on for x mins manually i.e. not scheduled. This is not in the above API docs and example. This is basically what I need to do as i want Indigo to determine when to turn the zone on or off based on a trigger from the flower power(s) in the zone.

Yes, there is a way to turn on manual irrigation (and yes, I realize it's not documented in our API reference so don't worry, it's us, not you :-) )

It's done using set_port_state_and config.php API call, and you need to pass all the data of your configuration when you call it, you can see it in our reference.

What's not mentioned there, is that for a port item in the "ports" array, you can change the "configuration" field from "Auto" to "On" and add a "Duration" number field with the amount of minutes to water,

an example port for a zone named "Lawn", zone number 1, to water for 5 minutes:

{
"number": 1,
"name": "Lawn",
"configuration": "On",
"shown": "True",
"presentation_index": "0",
"duration": 5
}


I dont have a clue on plugins so any help would be good. I have my client id and secret now. I will try and get a zone to turn on and off via a python script as that might be something i can achieve.

Does anyone else have one of these or am I the only one? :-)

Posted on
Thu Dec 14, 2017 12:44 am
agame offline
Posts: 514
Joined: Jul 13, 2017
Location: Melbourne, Australia

Re: GreenIQ Irrigation Plugin

did anyone have any joy with GreeniQ :?:

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests

cron