Page 2 of 2

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

PostPosted: Fri Apr 10, 2020 4:00 pm
by nexx
Hi, I've been using the applescript interface (the command below) for years, since you guys told me how in this thread. But now it isn't working anymore....

Now I'm using current indigo (7.4.1).

It always fail with the following message:

nexx-Mac-mini-5:~ nexx$ osascript -e 'tell application "IndigoServer" to status request "office-central"'
35:63: execution error: IndigoServer got an error: "office-main" doesn’t understand the “status request” message. (-1708)

device looks good, check it out (output of http://192.168.0.100:8176/devices/office-central.xml):

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<device>
<name>office-central</name>
<address>1539134</address>
<addressStr>17.7C.3E</addressStr>
<brightness>0</brightness>
<classID>2</classID>
<devProtocol>1</devProtocol>
<displayInUI>True</displayInUI>
<displayLongState>0%</displayLongState>
<displayRawState>0</displayRawState>
<folderID>1620952984</folderID>
<hasStateToDisplay>True</hasStateToDisplay>
<id>1513923450</id>
<isOn>False</isOn>
<lastChanged>639859949</lastChanged>
<lastChangedDateStr>2020-04-10</lastChangedDateStr>
<lastChangedRFC3339>2020-04-10T21:52:29Z</lastChangedRFC3339>
<lastChangedRFC822>Fri, 10 Apr 2020 21:52:29 GMT</lastChangedRFC822>
<lastChangedTimeStr>06:52:29 PM</lastChangedTimeStr>
<type>In-LineLinc Dimmer</type>
<typeFlags>1055</typeFlags>
<typeIsDimmer>True</typeIsDimmer>
<typeIsHVAC>False</typeIsHVAC>
<typeIsLock>False</typeIsLock>
<typeIsMultiIO>False</typeIsMultiIO>
<typeIsOpenClose>False</typeIsOpenClose>
<typeIsSensor>False</typeIsSensor>
<typeIsSpeedControl>False</typeIsSpeedControl>
<typeIsSprinkler>False</typeIsSprinkler>
<typeSupportsDim>True</typeSupportsDim>
<typeSupportsEnergyMeter>False</typeSupportsEnergyMeter>
<typeSupportsHVAC>False</typeSupportsHVAC>
<typeSupportsIO>False</typeSupportsIO>
<typeSupportsOnOff>True</typeSupportsOnOff>
<typeSupportsSensorValue>False</typeSupportsSensorValue>
<typeSupportsSpeedControl>False</typeSupportsSpeedControl>
<typeSupportsSprinkler>False</typeSupportsSprinkler>
<versByte>56</versByte>
</device>


Any clues?

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

PostPosted: Fri Apr 10, 2020 5:08 pm
by nexx
(I'm not a particular fan of using Applescript, but spawning an insteon python API for that it's way slower)

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

PostPosted: Sun Apr 12, 2020 10:47 am
by matt (support)
The Indigo 7.4 server does not support AppleScript commands anymore as discussed here.

I would suggest using the indigo-host command line. Note that Indigo now automatically installs it inside /usr/local/bin/indigo-host.

If performance is an issue (you are needing to executing multiple status requests back-to-back), then there are a few ways you could work around it. One approach would be to create an Indigo Variable, like statusRequestDevName, then use the RESTful API to update that variable value value. Inside Indigo you would then create a Trigger on Variable Value Changed that would execute an embedded python script (embedded will execute much faster than spawning a new indigo-host) that retrieves that variable value and uses it for the status request command.

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

PostPosted: Sun Apr 12, 2020 12:19 pm
by nexx
Great.

I checked the restful api documentation, did not find a call that do status request on a device. Would you point me to the right call?

Thanks

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

PostPosted: Sun Apr 12, 2020 12:32 pm
by matt (support)
There isn't one. That is why my suggestion above is more involved. You'll use the RESTful API to modify a variable value, then have Trigger logic in Indigo defined to take it from there.