REST interface & Remote Display checkbox

Posted on
Thu Feb 27, 2014 4:13 pm
dstrickler offline
User avatar
Posts: 340
Joined: Oct 08, 2010
Location: Boston, MA

REST interface & Remote Display checkbox

I can't say this is a bug, as I get the logic, but it seems that if an Action Group is unchecked for Remote Display, using the REST interface to Indigo doesn't return the Action Group - it's just left out of the returned result list.

Does anyone know how to override this checkbox setting when I am using the REST interface? There are commands like "All Lights Off" that I feel are a little dangerous for my fat fingers in the Indigo Touch app, so I have removed them from the display. However, I'd like to still have access to them with the REST interface.

I am using the REST interface like:
/usr/bin/curl -s --digest -u {user:pass} http://{indigo_dns}:8176/actions.txt

TIA

Dave

Posted on
Thu Feb 27, 2014 4:43 pm
jay (support) offline
Site Admin
User avatar
Posts: 18256
Joined: Mar 19, 2008
Location: Austin, Texas

Re: REST interface & Remote Display checkbox

Nope - remote is remote regardless of whether its IT or REST (or web, etc)…

You're still using the Actions list in IT instead of pretty custom control pages?? :shock:

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Feb 27, 2014 5:05 pm
dstrickler offline
User avatar
Posts: 340
Joined: Oct 08, 2010
Location: Boston, MA

Re: REST interface & Remote Display checkbox

Jay,

Nope - I am coding something special, a voice controlled (NLP) interface into Indigo. It's working well when I state a Device name or it's alias ("Turn on Kitchen lights"), but when I want to say "Turn off all lights", I really need it to access an Action Group rather than do a big loop through all Devices.

So, I poll Indigo via REST and pull down all the Action Groups. Then I translate the voice command into Indigo commands. If I see "All Lights" as the command, I see if there is a Group Action called "Turn Off All Lights", and run it.

If I can't be sure the Action Group called "Turn Off All Lights" will show up via a REST call because it's not shown in the Remote Display, then I'm a bit stuck. Instead, I think I can get all the Action Groups via a Python script, so perhaps that's a better way. I just have all the functions for the REST calls already coded, so I was hoping to use them.

Dave

Posted on
Thu Feb 27, 2014 5:09 pm
matt (support) offline
Site Admin
User avatar
Posts: 21427
Joined: Jan 27, 2003
Location: Texas

Re: REST interface & Remote Display checkbox

Possible hack: create an Indigo Variable "turnOffAllLights" and create a Trigger Action that when it becomes "execute" (or "1", etc) it executes the group you want, then resets the variable state back to an empty string. Then you can from the restfulAPI just set the variable value when you need to execute. A hack, but it should work...

Image

Posted on
Thu Feb 27, 2014 5:56 pm
dstrickler offline
User avatar
Posts: 340
Joined: Oct 08, 2010
Location: Boston, MA

Re: REST interface & Remote Display checkbox

A clever hack to be sure!

I need to have this solution completely flexible as it will (if it comes to market) connect to lots of indigo systems, so I think (reluctantly), I'll need to write it in Python. I'll investigate the SQL Logger plugin as I bet I can morph that into what I need.

Thanks,

Dave

Posted on
Thu Feb 27, 2014 6:10 pm
jay (support) offline
Site Admin
User avatar
Posts: 18256
Joined: Mar 19, 2008
Location: Austin, Texas

Re: REST interface & Remote Display checkbox

dstrickler wrote:
There are commands like "All Lights Off" that I feel are a little dangerous for my fat fingers in the Indigo Touch app


That's what I was referring to in this comment:

You're still using the Actions list in IT instead of pretty custom control pages??


And I wholeheartedly agree - if this is to become something that you distribute - a plugin is definitely the way to go.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Feb 27, 2014 6:39 pm
dstrickler offline
User avatar
Posts: 340
Joined: Oct 08, 2010
Location: Boston, MA

Re: REST interface & Remote Display checkbox

Ah - sorry - I didn't understand.

And yes, I still use the Indigo Touch "lists" more than the Graphic UI. Force of habit I suppose. ;-)

Dave

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests