Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Taking Control of Insteon Devices


mclass

Question

I have a comprehensive collection of Insteon devices used prior to my discovery of Fibaro that I would like to employ.

Using the information on Insteon hub API:

Please login or register to see this link.

and the work done on the Hue bulb on this forum at:

Please login or register to see this link.

together with my limited (non-existent!!) knowledge/skills of LUA, I have succeeded in gaining control of an Insteon plugin dimmer and plugin switch via an Insteon 2242 hub.

For the dimmer, I have created a virtual device with 4 buttons (off, 25%, 50% and on). The LUA code for each of the buttons is similar, changing only the portion containing the specific Insteon command (see the link for details of the commands for the dimmer)

For example, the code for dimmer on with ramp is:

InsteonHub = Net.FHttp("192.168.178.35",80)

InsteonHub:GET('3?02620010490f11ff=i=3')

Issues that I am now investigating are:

- there is a delay (approx 3 seconds) in the Insteon device responding to commands from the HC2

- obtaining and displaying the status of these (and other) Insteon devices. Two calls are required to do this (see link). I have been able to do this from a browser, but have no idea how to manage and display this in HC2 using LUA!

- use of an HC2 slider to adjust dimmer.

Future issues will be to detect (and use!) status of Insteon detectors (door, flood, movement, etc).

Any assistance/guidance/suggestions from more experienced users would be appreciated!

[ Added: 2014-02-16, 17:34 ]

Since my last post, I have continued with some success to control and integrate Insteon devices via an Insteon Hub (a PLM hidden behind an HTTP interface) as HC2 Virtual Devices

However, I am now at the stage of attempting to determine the status of devices (including their lower cost, battery operated wall switches).

This is proving to be beyond my (very limited) Lua abilities, and I am seeking some guidance (or even a full blown solution!) from mebers with the necessary knowledge.

To obtain the status of Insteon devices, it is necessary to:

- Send a "status" command to the device (I got to here, OK)

- The device then loads the status message into its buffer, and it is necessary to then send a buffer request (I can do this!)

- The buffer request returns an XML response that looks a bit like this:

02620EA7220F117F0602500EA72216A9442B117F (I can receive this in a browser, OK)

- The "level" of the device is returned in this response on a scale of 0 to 255 in the last two (hex) characters prior to the end wrapper (in this example "7F")

My dilemma now is how to:

(a) Load the XML response into Lua, and then

(b) Parse the response to determine the value of the status part, and then

© Adjust a virtual device slider to represent the level returned by the device

I would like to simply check the length of the message to make sure it's not a garbage response, and then look at the last two characters to get the level.

Any assistance/guidance references, would be greatly appreciated!

Mclass

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...