Jump to content

Need help turning insteon device "off" with REST


satwar

Recommended Posts

Posted

After a very painful process I finally got REST to change a status variable value in ISY

 

Program: c:\program files\internet explorer\iexplore.exe

Parameters: "http://admin:password@192.168.0.xx:9091/rest/vars/set/2/5/0"

 

I'm now trying to turn an insteon device off in ISY using REST

 

Program: c:\program files\internet explorer\iexplore.exe

Parameters: "http://admin:password@192.168.0.xx:9091/rest/nodes/xx xx xx 1/cmd/DOF"

 

Can anyone see why the command line doesn't work ?

Posted

I don't know how to directly turn a device off with a REST command.

 

But you can quite easily program the ISY to respond to the change in the variable (executed by REST) by programmatically creating an "off" command.

 

If
       $sTest is "x"

Then
       Set Scene 'Test Light' Off

Else
  - No Actions - (To add one, press 'Action')


Posted
Without the actual Insteon device address hard to tell. No leading zeros 0A 0B 0C 1, should be A B C 1

 

No leading zeros: 17 A7 73 1

 

It's a insteon 2466S device, and I'm trying to turn the load off.

Posted

The REST command was accepted. That suggests the issue is not REST but the ability of the ISY to control the specific device. Use the Admin Console to turn the device On and Off. The Admin Console uses the same Insteon commands as the REST DON and DOF requests.

 

Run Tools | Diagnostics | Event Viewer with Level 3 while the Admin Console On and Off commands (or the REST DOF) are being executed. If it is only an Off issue that is generally the load being controlled is generating interference when On to prevent the Off command from being received.

Posted

Well I did some thinking and came within reach of victory but the ISY reacts oddly to my solution. Explanation is very difficult, but I'll do my best.

 

I use mControl for high level control of ISY. I finally realized that I don't need to create REST commands in mControl macros to turn insteon devices off and on, I can use built-in mControl "ISY Automation" commands. Turning insteon devices off and on now works like a charm. So I've solved my initial problem, but...........

 

I still need to use mControl macros to send REST commands to ISY state variables changing their values between 0 and 1. I use these ISY state variables to control whether or not programs held in ISY folders will run. Unfortunately, the ISY state variables stop being changable by the mControl REST commands if I manually turn a insteon device off, which was on. Strangely if I run the REST command line for changing ISY state variables directly from internet explorer, the ISY state variables change their value as instructed. The only way I've been able to get the mControl macros for changing the ISY state variable values working again is to reboot the computer hosting mControl.

 

I seem to have stumbled into a problem way beyond my expertise. I don't understand why IE command line always works but mControl macro with same command ( "http://admin:password@192.168.0.xx:9091/rest/vars/set/2/5/0") stops working.

Posted

Hi satwar,

 

I am so very sorry to hear. I think the problem is definitely in mControl software. Have you tried contacting their tech support?

 

In short - and the answer to your question - there should be no difference between issuing commands from mControl vs. IE or any other browser. Do you get any errors in mControl?

 

With kind regards,

Michel

Posted

Okay, I finally got something to work.

 

I went back to my original plan of executing the device off command using REST in a mControl macro. It indeed does work :)

 

Also as long as I "manually" toggle the status of the Insteon devices using ISY, I have no problems.

 

Problems with mControl writing to the State Variable only occur if I use the mControl "ISY Automation" macros for "manually" toggling the status of the Insteon device.

 

Conclusion: Strange things can happen when you use mControl "ISY Automation" macros for devices that are also controlled by ISY programs

Posted

Sorry, I spoke too soon, eventually IE seems to stop writing to the ISY REST interface. Is there an application that specializes in sending http urls to a server, that supports command line usage ?

Posted

Not sure what platform you are on but "wget" may be the answer for CLI usage.

 

-Xathros

Posted
Not sure what platform you are on but "wget" may be the answer for CLI usage.

 

-Xathros

 

Wow, was that a great idea, seems to work well. Wget seems to be robust enough to carry on no matter what I throw at it.

 

Thank you :)

Posted

Happy to help.

 

-Xathros.

Guest
This topic is now closed to further replies.

  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

  • Forum Statistics

    • Total Topics
      37k
    • Total Posts
      371.5k
×
×
  • Create New...