Device configuration for ISY99i
Device configuration for ISY99i
Hi,
I've been able to get the 'Send data to website' action working with a button to control a light switch using the following syntax: http://username:password@ipaddress/rest ... id/cmd/DON . The syntaxin this example will turn the light on.
Demopad support suggested to use the http Get requests in connection with a device to get feedback from the ISY. There is also an article here which describes this http://www.demopad.com/forum/viewtopic.php?f=7&t=66
I have set up a Demopad device as I thought it should be done (see example in attached graphic) and configured a corresponding action which should turn off the light but still have had no success getting it to work. Any guidance appreciated. Obviously this example does not need feedback but it should still work.
Many thanks, Wayne
I've been able to get the 'Send data to website' action working with a button to control a light switch using the following syntax: http://username:password@ipaddress/rest ... id/cmd/DON . The syntaxin this example will turn the light on.
Demopad support suggested to use the http Get requests in connection with a device to get feedback from the ISY. There is also an article here which describes this http://www.demopad.com/forum/viewtopic.php?f=7&t=66
I have set up a Demopad device as I thought it should be done (see example in attached graphic) and configured a corresponding action which should turn off the light but still have had no success getting it to work. Any guidance appreciated. Obviously this example does not need feedback but it should still work.
Many thanks, Wayne
You do not have the required permissions to view the files attached to this post.
Re: Device configuration for ISY99i
[Note: see next post to set up ISY event subscriptions, its a much better way to receive device status changes. Some info in this post is still useful so I will leave it up.]
With some direction from Demopad support I was able to get Demopad talking with ISY. This enables us to retrieve status information from ISY using a Demopad device, use feedback to retrieve ISY device status information and poll the ISY if required. It would be great if we could subscribe to ISY for automatic status update but I haven't worked out how to do that or even whether it can be done without new features in Demopad. When I find out one way or another I'll post an update.
One thing you need to setup two-way feed back is a response terminator. Unfortunately the xml strings returned from ISY do not have a null terminator but I have found what appears to be a unique sequence of characters which so far has worked to determine the end of the feedback data.
Here is the string you need to paste into the response terminator text box,the character representation is /nodeInfo>
The example below uses admin:admin for the user name and password which when encoded translates to YWRtaW46YWRtaW4=
Obviously you would need to encode your own user name and password and replace this one which you can do from this website: http://www.opinionatedgeek.com/dotnet/t ... se64encode
One thing to keep in mind is that if you intend to use this remotely you should use secure protocol (https) because the user name and password will be visible and readable once decoded.
The ISY device id used is 12.60.B7.1 which translates to 12%2060%20B7%201 in the example, just replace it with one of your own Switchlincs.
Here is a sample command which turns on an Insteon Switchlinc, there is no device status returned in this case:
This is what the formatted get request and header response looks like:
To retreive the status for that Switchlinc the following command should to be used, the return string contains the ISY device id which can be used to create a match in the two-way feedback dialogue box.
Here is the formatted get request and header for the above command:
This is the regex you could use to retrieve the status from the return xml:
Hope this helps newbies and if anyone has any better approaches to doing any of this please just add to this thread with the improvements.
Many thanks.
Wayne
With some direction from Demopad support I was able to get Demopad talking with ISY. This enables us to retrieve status information from ISY using a Demopad device, use feedback to retrieve ISY device status information and poll the ISY if required. It would be great if we could subscribe to ISY for automatic status update but I haven't worked out how to do that or even whether it can be done without new features in Demopad. When I find out one way or another I'll post an update.
One thing you need to setup two-way feed back is a response terminator. Unfortunately the xml strings returned from ISY do not have a null terminator but I have found what appears to be a unique sequence of characters which so far has worked to determine the end of the feedback data.
Here is the string you need to paste into the response terminator text box,the character representation is /nodeInfo>
Code: Select all
\x2F\x6E\x6F\x64\x65\x49\x6E\x66\x6F\x3E
Obviously you would need to encode your own user name and password and replace this one which you can do from this website: http://www.opinionatedgeek.com/dotnet/t ... se64encode
One thing to keep in mind is that if you intend to use this remotely you should use secure protocol (https) because the user name and password will be visible and readable once decoded.
The ISY device id used is 12.60.B7.1 which translates to 12%2060%20B7%201 in the example, just replace it with one of your own Switchlincs.
Here is a sample command which turns on an Insteon Switchlinc, there is no device status returned in this case:
Code: Select all
GET rest/nodes/12%2060%20B7%201/cmd/DON HTTP/1.1\x0D\x0AHost: 192.168.1.105\x0D\x0AAuthorization: Basic YWRtaW46YWRtaW4=\x0D\x0A\x0D\x0A
Code: Select all
GET rest/nodes/12%2060%20B7%201/cmd/DON HTTP/1.1
Host: 192.168.1.105
Authorization: Basic YWRtaW46YWRtaW4=
HTTP/1.1 200 OK
Content-Length: 104
Connection: Keep-Alive
WWW-Authenticate: Basic realm="/"
Content-Type: text/xml
Cache-Control: no-cache
EXT: UCoS, UPnP/1.0, UDI/1.0
Last-Modified: Tue, 4 Dec 2012 14:40:4 GMT
<?xml version="1.0" encoding="UTF-8"?><RestResponse succeeded="true"><status>200</status></RestResponse>
Code: Select all
GET rest/nodes/12%2060%20B7%201 HTTP/1.1\x0D\x0AHost: 192.168.1.105\x0D\x0AAuthorization: Basic YWRtaW46YWRtaW4=\x0D\x0A\x0D\x0A
Code: Select all
GET rest/nodes/12%2060%20B7%201 HTTP/1.1
Host: 192.168.1.105
Authorization: Basic YWRtaW46YWRtaW4=
HTTP/1.1 200 OK
Content-Length: 528
Connection: Keep-Alive
WWW-Authenticate: Basic realm="/"
Content-Type: text/xml
Cache-Control: no-cache
EXT: UCoS, UPnP/1.0, UDI/1.0
Last-Modified: Wed, 5 Dec 2012 20:16:13 GMT
<?xml version="1.0" encoding="UTF-8"?><nodeInfo><node flag="128"><address>12 60 B7 1</address><name>Furnace Room SL</name><parent type="3">18259</parent><type>1.1.55.0</type><enabled>true</enabled><pnode>12 60 B7 1</pnode><ELK_ID>D09</ELK_ID><property id="ST" value="0" formatted="Off" uom="%/on/off"/></node><properties><property id="OL" value="255" formatted="100" uom="%/on/off"/><property id="RR" value="31" formatted="0.1 " uom="seconds"/><property id="ST" value="0" formatted="Off" uom="%/on/off"/></properties></nodeInfo>
Code: Select all
<address>12 60 B7 1.*ST.*formatted="(.*)" uom.*</nodeInfo>
Many thanks.
Wayne
Last edited by wwat on Fri Dec 07, 2012 3:46 pm, edited 1 time in total.
Re: Device configuration for ISY99i
How to subscribe to ISY events for automatic device status changes
As suggested in the above post subscribing to ISY events is a better approach (much less resource intensive) and I was able to get this working which makes most of the methods in the above post redundant.
Below is the connection details to get Demopad/ISY users up and running without too much effort.
This is the response terminator:
You will need to create a Demopad command using the following POST string and run the command from an application startup action: (Replace the encoded authorization string and IP address/Port to suit)
An example of regex code to pattern match device status, this can be run from the two-way feedback action (change device id to one of your own):
This example will match humidity changes if you have a Venstar thermostat:
This is a way better approach to getting status changes and its relatively easy to set up. Please feel free to improve further on any of this and post to this thread.
Regards,
Wayne
As suggested in the above post subscribing to ISY events is a better approach (much less resource intensive) and I was able to get this working which makes most of the methods in the above post redundant.
Below is the connection details to get Demopad/ISY users up and running without too much effort.
This is the response terminator:
Code: Select all
\x3C\x2F\x45\x76\x65\x6E\x74\x3E
Code: Select all
POST /services HTTP/1.1 \x0D\x0AAuthorization: Basic YWRtaW46YWRtaW4= \x0D\x0AHost: 192.168.1.105:80 \x0D\x0AContent-Length: 192 \x0D\x0AContent-Type: text/xml; charset="utf-8" \x0D\x0ANT:upnp:event \x0D\x0ASOAPACTION:"urn:udi-com:service:X_Insteon_Lighting_Service:1#Subscribe" \x0D\x0A\x0D\x0A<s:Envelope><s:Body><u:Subscribe xmlns:u="urn:udi-com:service:X_Insteon_Lighting_Service:1"><reportURL>REUSE_SOCKET</reportURL><duration>infinite</duration></u:Subscribe></s:Body></s:Envelope>
Code: Select all
ST.*<action>(.*)</action><node>12 60 B7 1</node>
Code: Select all
CLIHUM.*<action>(.*)</action><node>11 BD 72 1</node>
Regards,
Wayne
Re: Device configuration for ISY99i
Below are two more commands that will retrieve the initial load of integer and state variables. You need to execute these seperately because variables are not loaded like all the other ISY device/scene etc status information when you initially subscribe to ISY. All further variable *updates* do however come by way of the subscription connection.
The other thing you will have to setup in Demopad is a second Demopad device (connection to ISY). The first device should be used solely for event subscriptions and will remain open until he app closes. The second device should be used for everything else, like retrieving these variables and all further commands.
Note: don't forget to change the encoded user name and password, and IP address/port number to your own. Also make sure that when you copy and paste these strings, that they are all pasted as a single line without any newline or additional spaces etc.
Retrieves integer variables
Retrieves state variables
The response terminator for the second device </s:Envelope> represented in Hex as follows:
Here is a regex code sample to retrieve state variable with and ID of 1, and which matches either 0 or 1 in value:
Here is a good site to test your regex code http://www.regextester.com/
another good site for looking up the Hex representation of ASCII characters http://www.asciitable.com/
The other thing you will have to setup in Demopad is a second Demopad device (connection to ISY). The first device should be used solely for event subscriptions and will remain open until he app closes. The second device should be used for everything else, like retrieving these variables and all further commands.
Note: don't forget to change the encoded user name and password, and IP address/port number to your own. Also make sure that when you copy and paste these strings, that they are all pasted as a single line without any newline or additional spaces etc.
Retrieves integer variables
Code: Select all
POST /services HTTP/1.1 \x0D\x0AHost: 192.168.1.105:80 \x0D\x0AAuthorization: Basic YWRtaW46YWRtaW4= \x0D\x0AContent-Length: 152 \x0D\x0AContent-Type: text/xml; charset="utf-8" \x0D\x0A\x0D\x0A<s:Envelope><s:Body><u:GetVariables xmlns:u="urn:udi-com:service:X_Insteon_Lighting_Service:1"><option>1</option></u:GetVariables></s:Body></s:Envelope>
Code: Select all
POST /services HTTP/1.1 \x0D\x0AHost: 192.168.1.105:80 \x0D\x0AAuthorization: Basic YWRtaW46YWRtaW4= \x0D\x0AContent-Length: 152 \x0D\x0AContent-Type: text/xml; charset="utf-8" \x0D\x0A\x0D\x0A<s:Envelope><s:Body><u:GetVariables xmlns:u="urn:udi-com:service:X_Insteon_Lighting_Service:1"><option>2</option></u:GetVariables></s:Body></s:Envelope>
Code: Select all
\x3C\x2F\x73\x3A\x45\x6E\x76\x65\x6C\x6F\x70\x65\x3E
Code: Select all
<var type="2" id="1"><init>.</init><val>(0|1)</val>
another good site for looking up the Hex representation of ASCII characters http://www.asciitable.com/
Re: Device configuration for ISY99i
Thanks for the great information. I have successfully duplicated your efforts when using demopad on my local network and it works great. What I have not been able to do, however, is subscribe utilizing SSL and a host name (either locally or remotely). I am trying to use demopad to control the ISY and it is essential that I have the ability to do this remotely.
It appears that the Demopad designer does not like to accept "https://" (or "http://" for that matter) in the ip address of the device properties. I have been able to use the host name locally (without the "http://" on the front) to setup a subscription, but this is the closest I have been able to get.
Can anyone offer any advice in setting up a device utilizing SSL? Thanks for the assistance.
Andy
It appears that the Demopad designer does not like to accept "https://" (or "http://" for that matter) in the ip address of the device properties. I have been able to use the host name locally (without the "http://" on the front) to setup a subscription, but this is the closest I have been able to get.
Can anyone offer any advice in setting up a device utilizing SSL? Thanks for the assistance.
Andy
Re: Device configuration for ISY99i
Hello all -
Thank you for the great post. I have this setup now and working with my ISY994 (4.0.5). Works like a charm. I am wanting to do a little more here and I'm hoping you can help:
1. When I get the feedback, I am able to update a label with the value of any of my dimmers, switches, etc.. The problem is; The number that is returned is the actual value (e.g, 128), not the 'formatted' value (eg., 50%). For example:
When I query my media room dimmer, I may get: <property id="ST" value="198" formatted="78" uom="%/on/off"/> back, which in turn sets my label at "198". What I want is the the label to reflect the 'formatted=' value of "78" - make sense?
I've tried doing this by setting up another number PERCENT with a value of: [*]0.3921568629[/]100 and setting a third number SHOWPERCENT to [MediaLights][PERCENT], but it shows the label as: "198*.03921568629/100".
Any ideas?
2. In addition to getting the number right, I also want to be able to input a number and have the dimmer/thermostat/etc... set to that number. So, I would like to (via keypad numbers or otherwise) type in "1","2","8" and have that appended to a REST or POST command. So, for instance, if the REST command is:
http://admin:[email protected]/rest/node ... DON/[b]xxx[/b]
I would like to be able to enter "1","2","8" for example and have the command above appended to be:
http://admin:[email protected]/rest/node ... DON/[b]128[/b]
is that possible? Any help is much appreciated. Thank you!
Thank you for the great post. I have this setup now and working with my ISY994 (4.0.5). Works like a charm. I am wanting to do a little more here and I'm hoping you can help:
1. When I get the feedback, I am able to update a label with the value of any of my dimmers, switches, etc.. The problem is; The number that is returned is the actual value (e.g, 128), not the 'formatted' value (eg., 50%). For example:
When I query my media room dimmer, I may get: <property id="ST" value="198" formatted="78" uom="%/on/off"/> back, which in turn sets my label at "198". What I want is the the label to reflect the 'formatted=' value of "78" - make sense?
I've tried doing this by setting up another number PERCENT with a value of: [*]0.3921568629[/]100 and setting a third number SHOWPERCENT to [MediaLights][PERCENT], but it shows the label as: "198*.03921568629/100".
Any ideas?
2. In addition to getting the number right, I also want to be able to input a number and have the dimmer/thermostat/etc... set to that number. So, I would like to (via keypad numbers or otherwise) type in "1","2","8" and have that appended to a REST or POST command. So, for instance, if the REST command is:
http://admin:[email protected]/rest/node ... DON/[b]xxx[/b]
I would like to be able to enter "1","2","8" for example and have the command above appended to be:
http://admin:[email protected]/rest/node ... DON/[b]128[/b]
is that possible? Any help is much appreciated. Thank you!
Re: Device configuration for ISY99i
Ok - I got question #1 out of the way. I did that by creating a number: RawDataValue with a "Maximum Value" of 255, then assigning the GET output to that number. Then, I created a label Percentage. Next, in the two way feedback of the ISY I assigned two actions to the RawDataValue number:
1. Action: Set a Number [RawDataValue] - Data:[*]0.3921568629
2. Action: Set a Label [Percentage] - Data: [RawDataValue]
Then I just presented the label "Percentage" in a text box. Works like a charm!
Now, Can someone help with the second question? [see above post].
Thanks!
1. Action: Set a Number [RawDataValue] - Data:[*]0.3921568629
2. Action: Set a Label [Percentage] - Data: [RawDataValue]
Then I just presented the label "Percentage" in a text box. Works like a charm!

Now, Can someone help with the second question? [see above post].
Thanks!
Re: Device configuration for ISY99i
You can use square brackets to insert numbers or labels into commands, for example
http://admin:[email protected]/rest/node ... 1/cmd/DON/[MYLABEL]
which will substitute the current value of the label called "MYLABEL" into the command.
You therefore just need to have your number buttons, and pressing "1" for example will 'set a label' to:
[MYLABEL]1
pressing "2" will set the label to
[MYLABEL]2
ie adding "1" or "2" to the current text value of the label, until MYLABEL contains the number you want (you will need to set it to nothing at some point as well to clear it!)
http://admin:[email protected]/rest/node ... 1/cmd/DON/[MYLABEL]
which will substitute the current value of the label called "MYLABEL" into the command.
You therefore just need to have your number buttons, and pressing "1" for example will 'set a label' to:
[MYLABEL]1
pressing "2" will set the label to
[MYLABEL]2
ie adding "1" or "2" to the current text value of the label, until MYLABEL contains the number you want (you will need to set it to nothing at some point as well to clear it!)
Re: Device configuration for ISY99i
I'm not sure I understand. Let's see if I have this right:
If I insert a series of buttons onto the subpage (0-9) and "Enter", and assign each button a number label - so:
"1" = [MYLABEL]1
"2" = [MYLABEL]2
etc...
Then, punch in "224" "Enter".
I create an "action" that sends the string: "http://admin:[email protected]/rest/node ... 1/cmd/DON/[MYLABEL]1[MYLABEL]2[MYLABEL]3[MYLABEL]4[MYLABEL]5[MYLABEL]6[MYLABEL]7[MYLABEL]8[MYLABEL]9[MYLABEL]0" when I hit "Enter"
Since I entered "2","2","4", how would it know to put the "[MYLABEL]2" in twice?
Am I formatting the string right? In your example below, it seems like I could/would be setting only a single digit. Please clarify. Thanks.
If I insert a series of buttons onto the subpage (0-9) and "Enter", and assign each button a number label - so:
"1" = [MYLABEL]1
"2" = [MYLABEL]2
etc...
Then, punch in "224" "Enter".
I create an "action" that sends the string: "http://admin:[email protected]/rest/node ... 1/cmd/DON/[MYLABEL]1[MYLABEL]2[MYLABEL]3[MYLABEL]4[MYLABEL]5[MYLABEL]6[MYLABEL]7[MYLABEL]8[MYLABEL]9[MYLABEL]0" when I hit "Enter"
Since I entered "2","2","4", how would it know to put the "[MYLABEL]2" in twice?
Am I formatting the string right? In your example below, it seems like I could/would be setting only a single digit. Please clarify. Thanks.
Re: Device configuration for ISY99i
Not quite, create your 10 buttons, 0-9. Create a single label called "MYLABEL" for example.
In the actions for button 1, add an action "set a label", choose the MYLABEL label you just created and put in as the data:
[MYLABEL]1
This will put the current value of the "MYLABEL" label, and the character "1" into the (same) label "MYLABEL". Initially, "MYLABEL" will be blank, so you could just put 1 as the data, but that doesn't work if you press 1 after pressing something else first, which is why you need the [MYLABEL] first.
Similarly, on button 2, create an action "set a label", choose the same "MYLABEL" label and put as the data:
[MYLABEL]2
You will probably also want a 'clear' button which sets "MYLABEL" to nothing.
It might help you to put another button/text object somewhere on the page & assign the label "MYLABEL" to the text value of the object, so you can see what happens to the label as you press the buttons.
By using square brackets around the label name, you can use its value anywhere - in the data above, and also in your command, which would be:
http://admin:[email protected]/rest/node ... 1/cmd/DON/[MYLABEL]
As another example, lets say you had 3 labels, called "LABEL1", "LABEL2", "LABEL3", with default text values of "A", "B" and "C" respectively.
If you had another label called "ALL LABELS", and set a label equal to the data:
hello [LABEL1] world [LABEL2] this is a label [LABEL3]
then the actual value of "ALL LABELS" would then be:
hello A world B this is a label C
Hope that makes sense...
In the actions for button 1, add an action "set a label", choose the MYLABEL label you just created and put in as the data:
[MYLABEL]1
This will put the current value of the "MYLABEL" label, and the character "1" into the (same) label "MYLABEL". Initially, "MYLABEL" will be blank, so you could just put 1 as the data, but that doesn't work if you press 1 after pressing something else first, which is why you need the [MYLABEL] first.
Similarly, on button 2, create an action "set a label", choose the same "MYLABEL" label and put as the data:
[MYLABEL]2
You will probably also want a 'clear' button which sets "MYLABEL" to nothing.
It might help you to put another button/text object somewhere on the page & assign the label "MYLABEL" to the text value of the object, so you can see what happens to the label as you press the buttons.
By using square brackets around the label name, you can use its value anywhere - in the data above, and also in your command, which would be:
http://admin:[email protected]/rest/node ... 1/cmd/DON/[MYLABEL]
As another example, lets say you had 3 labels, called "LABEL1", "LABEL2", "LABEL3", with default text values of "A", "B" and "C" respectively.
If you had another label called "ALL LABELS", and set a label equal to the data:
hello [LABEL1] world [LABEL2] this is a label [LABEL3]
then the actual value of "ALL LABELS" would then be:
hello A world B this is a label C
Hope that makes sense...
Re: Device configuration for ISY99i
I think I did exactly what you said above, and got the result I thought I would - that is, each number press changes the number as opposed to adding a new digit. So, when I press "1" [MYLABEL] changes to 1. When I press "2" [MYLABEL] changes to 2, instead of changing to "12" ("1"+"2") as desired.
I've attached my files here. Can you take a look and tell me what I am missing? Thanks.
The number entry is on the "NumberTest" sub-page.
I've attached my files here. Can you take a look and tell me what I am missing? Thanks.
The number entry is on the "NumberTest" sub-page.
You do not have the required permissions to view the files attached to this post.
Re: Device configuration for ISY99i
Got it. I fat fingered the code. It works now. Thank you so much for you help.