Creating a sprinkler device

Posted on
Thu Mar 09, 2023 5:55 pm
siclark offline
Posts: 1961
Joined: Jun 13, 2017
Location: UK

Creating a sprinkler device

I'm struggling a bit with trying to create and update a sprinkler device. I've got my relay and sensors working but hit a block now.
How can I update the zoneCount and zoneNames which I want to do programmatically based on the results of the API (along with some other details)
However the instructions say they aren't writable and dev.replaceOnServer() doesn't work as I get error on dev.zoneCount"12

I'm sure I'm needing something obvious but I'm new to this.

Cheers. Simon

Posted on
Fri Mar 10, 2023 9:58 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Creating a sprinkler device

Just to confirm/close this, you figured this one out by looking at the Rachio plugin, right?

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Mar 10, 2023 10:19 am
siclark offline
Posts: 1961
Joined: Jun 13, 2017
Location: UK

Re: Creating a sprinkler device

Yes. Many other questions about the Rachio plugin as without a Rachio API key it's a bit hard to step through and understand, bit solved this question.
Thanks

Posted on
Tue Mar 21, 2023 5:16 pm
siclark offline
Posts: 1961
Joined: Jun 13, 2017
Location: UK

Re: Creating a sprinkler device

Hi Jay.
Could you help with how to add onState to a sprinkler. I see your toggleStandbyMode method uses if dev.onState: but I can’t get my sprinkler device to accept supporting it and I think testing the rachio plug-in with json code from the rachio API docs, the rachio errors on that line too.
I can use setstandbyMode for my purposes but trying to understand more.

Thanks. Simon

Posted on
Wed Mar 22, 2023 12:05 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Creating a sprinkler device

Sprinkler devices have no onState, so that action will not work correctly (it's a bug). Looking at the github commit log, it was added after I stopped working on it.

In terms of how your plugin works, you'll need to evaluate other states that your sprinkler device can be in to determine if it's on or off, then do the appropriate thing based on those factors. You can add it as a custom state that you manage whenever other state changes are made which would change your custom on status state.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Mar 22, 2023 12:57 pm
siclark offline
Posts: 1961
Joined: Jun 13, 2017
Location: UK

Re: Creating a sprinkler device

Haha and there was I thinking that because it was a plug-in by you that it had to be something that worked!
Yes I am using a custom state for standby now.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 15 guests

cron