"send status request" from web browser interface?

Posted on
Fri Sep 07, 2012 7:21 am
nexx offline
Posts: 56
Joined: Jun 27, 2010

"send status request" from web browser interface?

My application integrates with indigo through the 8176 http port interface.

Is it possible to "send status request" from this interface? how?

thanks,
Valentino

Posted on
Fri Sep 07, 2012 7:36 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: "send status request" from web browser interface?

Hi Valentino,

There isn't a direct restful API to send a status request, so I believe you'll have to create an Action Group that does the request(s) you want and then execute that group via the restful API.

Image

Posted on
Fri Sep 07, 2012 11:20 am
nexx offline
Posts: 56
Joined: Jun 27, 2010

Re: "send status request" from web browser interface?

Ohh, too bad. I have like 50 or more appliances.. need something more generic..

It seems its possible through Applescript, isn't? "status request <device>" but I didn't figured it out how to save the request into a ascript variable...

Can I do it through the "insteonhost -i"?

Posted on
Fri Sep 07, 2012 11:35 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: "send status request" from web browser interface?

Note that you shouldn't need to send status requests under normal circumstances - so if you find yourself needing to do status requests frequently then you might want to find out why devices are out of sync and fix that problem rather than just addressing the symptom...

I'm not quite sure what your AppleScript question is and how it relates to the RESTful API.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Sep 07, 2012 1:16 pm
johnpolasek offline
Posts: 911
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: "send status request" from web browser interface?

jay (support) wrote:
Note that you shouldn't need to send status requests under normal circumstances - so if you find yourself needing to do status requests frequently then you might want to find out why devices are out of sync and fix that problem rather than just addressing the symptom...


I do it from a script for a light and a lamp that are in a bedroom at the end of a long wiring run and sometimes accessed from a palmpad and X10 reciever; The switchlinc and appliancelinc that are controlling these lights are "dual coded", insteon as well as X10 (L10 and L11); Indigo and the two keypadlincs that also control them use Insteon to reach them, but the X10 reciever on a plug on the same breaker as the two devices is too weak to signal back to the Mac, so if the palmpad on the bedstand is used, INdig doesn't know that the device changed until it asks (once a minute on a schedule). Sure, I COULD get a remotelinc and dual band device to hang out there, but as long as the kludge works, why add the expense? Of course if the Insteon devices were programmed PROPERLY, they would broadcast their state change from X10 just like the switchlinc does from someone hitting the paddle, but that's a gripe for Smarthome... And I also do a request on the Garage door open IOlinc in the same schedule because every once a while; signal noise or maybe just confusion in the device, it fails to send a state change when I close the door, which means I make a trip to the garage for nothing after checking before bed.

Posted on
Fri Sep 07, 2012 1:38 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: "send status request" from web browser interface?

You can use the indigohost command line with the embedded option:

Code: Select all
indigohost -e "indigo.device.statusRequest(79187544)"

It is not super efficient since it starts a new process that has to connect to the IndigoServer, but it still might be an acceptable technique.

Image

Posted on
Fri Sep 07, 2012 2:16 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: "send status request" from web browser interface?

johnpolasek wrote:
I do it from a script for a light and a lamp that are in a bedroom at the end of a long wiring run and sometimes accessed from a palmpad and X10 reciever;

[SNIP]

And I also do a request on the Garage door open IOlinc in the same schedule because every once a while; signal noise or maybe just confusion in the device, it fails to send a state change when I close the door, which means I make a trip to the garage for nothing after checking before bed.


Which is basically my point to the OP - for a few specific scenarios like this creating an action group is an acceptable for occasional use. However, if you have 50 devices that are getting out of sync regularly then it's a completely different problem...

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Sep 07, 2012 7:40 pm
nexx offline
Posts: 56
Joined: Jun 27, 2010

Re: "send status request" from web browser interface?

jay (support) wrote:
Note that you shouldn't need to send status requests under normal circumstances - so if you find yourself needing to do status requests frequently then you might want to find out why devices are out of sync and fix that problem rather than just addressing the symptom...


There's no problem in my network. Devices get out of sync simply because my mac is not on 24x7. For example, if the mac is sleeping, and you turn on a light from a keypadlinc, it will be out of sync when the mac resumes..

jay (support) wrote:
I'm not quite sure what your AppleScript question is and how it relates to the RESTful API.


I was trying to asking if it is possible to send and get "status request" from the IndigoServer applescript interface? Would somebody please post a sample code? I think it may be faster than spawning an indigohost shell.

thanks

Posted on
Fri Sep 07, 2012 7:42 pm
nexx offline
Posts: 56
Joined: Jun 27, 2010

Re: "send status request" from web browser interface?

matt (support) wrote:
You can use the indigohost command line with the embedded option:

Code: Select all
indigohost -e "indigo.device.statusRequest(79187544)"

It is not super efficient since it starts a new process that has to connect to the IndigoServer, but it still might be an acceptable technique.


Thanks, what this number ("79187544") stand for?

Posted on
Fri Sep 07, 2012 7:51 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: "send status request" from web browser interface?

The number is the unique device ID. You can get it by right-clicking on the Device in the main window. The device name will work as well (put it in quotes), but the ID is preferred since it never changes.

To do it from AppleScript try:

Code: Select all
 status request "device name here"

(note that AppleScript only accepts the device name -- the ID won't work there)

Image

Posted on
Sat Sep 08, 2012 4:28 am
nexx offline
Posts: 56
Joined: Jun 27, 2010

Re: "send status request" from web browser interface?

matt (support) wrote:
The number is the unique device ID. You can get it by right-clicking on the Device in the main window. The device name will work as well (put it in quotes), but the ID is preferred since it never changes.

To do it from AppleScript try:

Code: Select all
 status request "device name here"

(note that AppleScript only accepts the device name -- the ID won't work there)


Ok Thanks, one last question, do this code returns anything (for error checking)?

Posted on
Sat Sep 08, 2012 5:31 am
nexx offline
Posts: 56
Joined: Jun 27, 2010

Re: "send status request" from web browser interface?

Thanks, Jay, Matt!

Here's the solution:
Code: Select all
osascript -e 'tell application "IndigoServer" to status request "office-window"'


It is much faster than launching a "indigohost" process.

Posted on
Sun Sep 09, 2012 8:44 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: "send status request" from web browser interface?

The command is queued up to be sent by the interface then returns immediately, so no return status is available.

Image

Posted on
Sat Dec 01, 2012 11:37 am
jabeard3 offline
Posts: 52
Joined: Nov 30, 2012

Re: "send status request" from web browser interface?

nexx wrote:
jay (support) wrote:
Note that you shouldn't need to send status requests under normal circumstances - so if you find yourself needing to do status requests frequently then you might want to find out why devices are out of sync and fix that problem rather than just addressing the symptom...


Jay -

Assuming my mac is on all the time, why would I have discrepancies? It's specifically outdoor appliance linc's that have been out of sync, they are only ever controlled by Indigo and while they haven't been out of sync often... I'm wondering why they were out at all.

Posted on
Sat Dec 01, 2012 11:48 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: "send status request" from web browser interface?

Signal noise is the likely culprit - Indigo will send it a command but the device won't respond with an acknowledgement because of a signal issue. The device may have responded, but Indigo won't know because it didn't receive the ACK. You may see those errors in the event log saying "no acknowledgement".

Check out the signal troubleshooting page for common causes and solutions to signal issues.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Who is online

Users browsing this forum: No registered users and 6 guests