Talk About the Latest in Home Automation/Home Electronics
Home Automation Forum

Smarthome Forum
Login or Register
 
Home | Profile | Register | Active Topics | Search | FAQ | Smarthome
 All Forums
 General Discussion
 INSTEON
 2412N SmartLinc web automation solved
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

chadwackerman
New Member

16 Posts

Posted - 12/28/2009 :  4:48:55 PM  Show Profile  Reply with Quote
Digging through the source of the SmartLinc v2, I spotted how to send INSTEON and X10 commands directly to the powerline. This is an alternate method to accessing the funky URLs for rooms and scenes discussed in this thread: http://www.smarthome.com/forum/topic.asp?TOPIC_ID=5943

To do it, use a URL of the form:

http://[smartlinc address]/3?[custom command]=I=3

Custom command formats are documented here:

http://wiki.smarthome.com/index.php?title=Using_Custom_Commands_in_SmartLinc_%28v2.0%2B%29

Some examples:

Turn on INSTEON scene 1:
/3?0261011101=I=3

Turn on INSTEON unit AB.CD.EF at 75%:
/3?0262ABCDEF0F11BF=I=3

Turn off AB.CD.EF:
/3?0262ABCDEF0F13FF=I=3

Turn on X10 A1:
/3?02636600P102636280=I=3

Turn off X10 A1:
/3?02636600P102636380=I=3

I believe this requires a V2 SmartLinc but haven't tested to see if the /3 endpoint is on the V1 unit.

Also don't forget that you can create your own web pages for the SmartLinc as well.

Download the kit here:
http://www.openlinc.com

Good luck!

jdale
Advanced Member

USA
1171 Posts

Posted - 12/28/2009 :  8:12:24 PM  Show Profile  Visit jdale's Homepage  Reply with Quote
Just out of curiousity, can you send other commands besides the ones listed on the custom command page? I noticed that the command numbers and format are the same as the command format for Insteon messages you would send by other means, and wonder if the SmartLinc does any filtering or if you could use this more generally.

If you have a LampLinc that is version 4.1 or newer, an easy test would be to send command 2E F7 (turn on at ramp rate, to 100% but taking 38 seconds). (This wasn't supported in earlier LampLincs, and I don't know what other dimmers support it.)

Turn on INSTEON unit AB.CD.EF at 100% but take 38 seconds to do it:
/3?0262ABCDEF0F2EF7=I=3


Insteon FAQ: http://goo.gl/qNTNr
Go to Top of Page

chadwackerman
New Member

16 Posts

Posted - 12/28/2009 :  9:14:46 PM  Show Profile  Reply with Quote
I tried that on an ICON dimmer 4.2 and it worked.

Playing with some other commands now -- seem to be working.
You can grab status too.

Edited by - chadwackerman on 12/28/2009 9:22:37 PM
Go to Top of Page

jdale
Advanced Member

USA
1171 Posts

Posted - 12/29/2009 :  07:09:30 AM  Show Profile  Visit jdale's Homepage  Reply with Quote
Cool. For anyone interested, Turn On At Ramp Rate is command 2E, and Turn Off At Ramp Rate is 2F. I have a chart of values for the second parameter (and notes) at http://www.madreporite.com/insteon/ramprate.htm

Insteon FAQ: http://goo.gl/qNTNr
Go to Top of Page

xlurkr
Junior Member

42 Posts

Posted - 02/22/2010 :  7:33:38 PM  Show Profile  Reply with Quote
FYI

I just tried this on a V1 SmartLinc and it works just fine. Anyone know if there are any differences between the two other than the memory? I don't mean the built-in compiled code, but the hardware. If there aren't any, they're probably the same as far as these direct commands go. I bet they just get sent straight to the PLM.

-Tom
Go to Top of Page

scoobz
Starting Member

USA
1 Posts

Posted - 07/20/2010 :  06:01:47 AM  Show Profile  Reply with Quote
I tried running a bat script the opens ie or firefox and opent the link to turn on the switch or off. The problem is it opens the page but does not always work. But if I hit refresh it completes the command. I want to put buttons in my sage tv to run these scripts but until it is more reliable I cant...

Shawn
Go to Top of Page

Reikes
Starting Member

USA
9 Posts

Posted - 10/17/2010 :  5:38:39 PM  Show Profile  Reply with Quote



Hi JDALE and all lurkers who will gain from this ridiculous amount of knowledge...

I have no idea what I'm doign but I actually got the Smartlinc Custom Direct Commands to work for Ram Rate command. jdale's perfectly clear (0262ABCDEF0F2EF7) string is what finally got me there. Thank you jdale...

However, both of my keypadlincs (v5.2) will not continue ramping past 1 minute...

Ahhh, I think I've got it figured it out. Remember I'm a complete dummy here about this stuff. I was an airline pilot now IN finance--a nerd at heart, just not familiar with the concepts; hex, etc.

Trying to make sense of the chart of values at
http://www.madreporite.com/insteon/ramprate.htm " target="_blank"> http://www.madreporite.com/insteon/ramprate.htm
I thought the F as they applied to the string, I thought F referred to the F in what's probably the Hex Code version (in Ramp Rate column).

Apparently the 'F' is Full, and '7' is for 38 sec's? I'm totally confused by the Smartlinc codes vs. HEX vs Bits, etc.

My goal is to have the bedroom lights ramp on over 9-minutes at 7:00 AM

Joshua R. Reikes
Go to Top of Page

jdale
Advanced Member

USA
1171 Posts

Posted - 10/18/2010 :  09:56:36 AM  Show Profile  Visit jdale's Homepage  Reply with Quote
F7 is hex for 247... usually it would be written 0xF7 if you're just talking about it as a number. That said, this parameter combines two settings: brightness and ramp rate. If we look at it in binary it's

11110111

The first part of that is brightness (1111) and the second part is the ramp rate (0111).

Now if you go from binary to hex you find that four binary digits correspond to one hex digit. So if you have a 8-digit binary number (like 11110111) it will be a 2-digit hexadecimal number (like 0xF7). The binary number 1111 = the hexadecimal number F. So in a sense you are correct, F in this string does mean "full", not because it is an abbreviation, but because it represents the maximum possible value for brightness.

In other words, when you are trying to figure out the hexadecimal value for this parameter that is brightness + ramp rate, the first hexadecimal digit will be the brightness part (ranging from 0-F with F being the brightest), and the second hexadecimal digit will be the ramp rate part (ranging from 0-F with F being the fastest).

To do a 8-minute ramp to full brightness, you would send F0. You can't actually do 9-minute using this command, because with only 16 possible values (0-F) there are not enough to correspond to every possible ramp rate (since there are 32 rates). So you'd have to settle for 8-minute. (Or take a different approach, like linking the device instead of using a custom command. But that may not work anyway because new Switchlincs don't have a 9-minute setting.)


Insteon FAQ: http://goo.gl/qNTNr
Go to Top of Page

Reikes
Starting Member

USA
9 Posts

Posted - 10/18/2010 :  1:55:00 PM  Show Profile  Reply with Quote
Aha! Now I get it. So Hex is just abbreviated binary...

Cool. F0 is what I used and what finally worked. Unfortunately I didn't think to ask you until I had spent about 3 hours with a stop watch...

You are correct about linking. The slowest ramp rate I could eek out via tap-link was about 1 min.

Joshua R. Reikes
Go to Top of Page

jdale
Advanced Member

USA
1171 Posts

Posted - 10/18/2010 :  2:54:14 PM  Show Profile  Visit jdale's Homepage  Reply with Quote
Yes, hex is abbreviated binary - that's why programmers find it so useful. Going from decimal to binary is much more awkward.

Glad you got it working!

Insteon FAQ: http://goo.gl/qNTNr
Go to Top of Page

doogledb
Average Member

USA
90 Posts

Posted - 10/27/2010 :  08:17:58 AM  Show Profile  Reply with Quote
I am wanting to control Insteon with another remote that can issue network commands from. I have Authentication turned on in SmarLinc. Is there a way to include the ID and PW in the command? Can I include my ID and PW in this url? http://[smartlinc address]/3?[custom command]=I=3

Doug

Edited by - doogledb on 10/27/2010 08:34:07 AM
Go to Top of Page

jonsmirl
Junior Member

USA
43 Posts

Posted - 10/27/2010 :  4:50:58 PM  Show Profile  Visit jonsmirl's Homepage  Reply with Quote
user/pw can be embedded in URLs like this:
http://username:password@hostname/url

But this is a function of the device sending the url, not of the one receiving it. So your remote will need to support the embedded user/pw feature.
Go to Top of Page

stusviews
Moderator

USA
11393 Posts

Posted - 10/27/2010 :  5:56:57 PM  Show Profile  Visit stusviews's Homepage  Reply with Quote
Thanks. I found it also works with some other devices that require a user name and password.

Stu's Views is Education and Fun. What do YOU want to VIEW today?
MathLandia High school mathematics learning fun.
Both Stu's Views and MathLandia are free websites that do not sell anything.
Saving energy is not always free. Be a world saver.
Go to Top of Page

doogledb
Average Member

USA
90 Posts

Posted - 10/27/2010 :  6:16:19 PM  Show Profile  Reply with Quote
I get a windows cannot find Error when add my username:password@[ip and port of SmarLinc]

Doug
Go to Top of Page

stusviews
Moderator

USA
11393 Posts

Posted - 10/27/2010 :  6:47:26 PM  Show Profile  Visit stusviews's Homepage  Reply with Quote
You are correct I found it works with Firefox, Safari, and Opera, but not Internet Explorer.

Stu's Views is Education and Fun. What do YOU want to VIEW today?
MathLandia High school mathematics learning fun.
Both Stu's Views and MathLandia are free websites that do not sell anything.
Saving energy is not always free. Be a world saver.
Go to Top of Page

doogledb
Average Member

USA
90 Posts

Posted - 10/27/2010 :  6:56:31 PM  Show Profile  Reply with Quote
Thanks - I was trying it in Chrome and IE... Works in Safari.. Thanks again

Doug
Go to Top of Page

diar
Junior Member

53 Posts

Posted - 10/28/2010 :  07:05:41 AM  Show Profile  Reply with Quote
Some screenshots of Chad's custom openlinc would be very nice. Before I tinker with It I'd like to see a visual cost/benefit.
Go to Top of Page

RichCini
Starting Member

USA
2 Posts

Posted - 12/14/2010 :  06:14:37 AM  Show Profile  Visit RichCini's Homepage  Reply with Quote
quote:
Originally posted by chadwackerman

I tried that on an ICON dimmer 4.2 and it worked.

Playing with some other commands now -- seem to be working.
You can grab status too.




I'm thinking about writing a small custom app that will poll the 2412N for the status of an I/O-Linc connected to a water leak sensor (and then send an SMS or email to my phone). I'm still in research mode, but how is the HTML response string formatted? I've done a bit of searching in the forums but most discussions talk about sending commands rather than polling for responses.

Any pointers would be appreciated. Thanks!

Rich
Go to Top of Page

cyphers72
Starting Member

USA
4 Posts

Posted - 12/26/2010 :  10:12:18 PM  Show Profile  Reply with Quote
Bump to get some eyes on the last poster's question. I'm similarly trying to hookup a 2412 (central controller) to a 2450 (contact closure). No luck so far. I've tried using a direct command like

0262 - ABCDEF - 0F - 11 - FF

That would theoretically be "turn on the contact closure at ABCDEF". Just tapping the Set button on the 2450 works fine, but the 2412 doesn't seem to understand how to talk to the 2450 yet...

Another issue not really covered in this thread is how to get status. I've tried sniffing the line, but the default web pages are using Ajax and it's very dirty. Presumably there is a nice clean REST command like the direct command API to just retrieve status of a light for instance. Why this is not all properly documented is a bit frustrating.
Go to Top of Page

LeeG
Advanced Member

USA
2244 Posts

Posted - 12/27/2010 :  08:46:49 AM  Show Profile  Reply with Quote
cyphers72

There is a Developer Subscription that can be purchased if you want programmer level information. That also provides access to a developer forum.

0262 xxyyzz 0F1102

will turn On the I/O Linc Relay.

Lee G
Go to Top of Page

jdale
Advanced Member

USA
1171 Posts

Posted - 12/27/2010 :  08:58:43 AM  Show Profile  Visit jdale's Homepage  Reply with Quote
There's a lot of info about the SmartLinc but you may need to search the boards, no one has gone through and organized it all. See the beginning of this thread for discussion about getting status from a device using the SmartLinc:
http://www.smarthome.com/forum/topic.asp?TOPIC_ID=7431

Sometimes custom commands don't work from one room, try moving the scene to another room.

There also needs to be communication between the IOLinc and the SmartLinc. E.g. access points if they are on different legs, etc.

IOLinc responses to status requests depend on the version. I believe V1.0 responds with the status of the relay, while V1.1+ responds with the status of the sensor.



Insteon FAQ: http://goo.gl/qNTNr
Go to Top of Page

pakratt
Starting Member

Canada
3 Posts

Posted - 02/19/2011 :  11:13:42 AM  Show Profile  Reply with Quote
quote:
Originally posted by scoobz

I tried running a bat script the opens ie or firefox and opent the link to turn on the switch or off. The problem is it opens the page but does not always work. But if I hit refresh it completes the command. I want to put buttons in my sage tv to run these scripts but until it is more reliable I cant...



I had the same issue. Could read every 10 minutes but anything quicker would fail. It was the browser caching the page. I had to add a unique parameter (like date/time) after the url to get it to work each time. Even though I had caching in IE turned off. Something like ?1 or ?2 would work manually but I use the date.getTime() javascript function to tack it onto the URL from my web app and I'm successfully reading every 5 seconds now.
Go to Top of Page

pakratt
Starting Member

Canada
3 Posts

Posted - 02/28/2011 :  4:42:48 PM  Show Profile  Reply with Quote
Has anyone created a javascript function they'd like to share for sending a smartlinc command to a 2412N controller and reading back the buffer using the XMLHttpRequest object?
Are there other ways currently in use to accomlish this asynchronously via javasript without just waiting x seconds and assuming the response from the controller is ready?

I'm thinking something like response=SmarlincCommand("url:port/commandstring"); would be extremely useful to those trying to create thir own web based interface.

Thanks.
Go to Top of Page

jdale
Advanced Member

USA
1171 Posts

Posted - 02/28/2011 :  9:25:28 PM  Show Profile  Visit jdale's Homepage  Reply with Quote
You may want to see this thread if you have not already: http://www.smarthome.com/forum/topic.asp?TOPIC_ID=7722

Insteon FAQ: http://goo.gl/qNTNr
Go to Top of Page

andyf0
Junior Member

USA
43 Posts

Posted - 03/01/2011 :  06:39:29 AM  Show Profile  Visit andyf0's Homepage  Reply with Quote
quote:
Originally posted by pakratt

Has anyone created a javascript function they'd like to share for sending a smartlinc command to a 2412N controller and reading back the buffer using the XMLHttpRequest object?
Are there other ways currently in use to accomlish this asynchronously via javasript without just waiting x seconds and assuming the response from the controller is ready?

I'm thinking something like response=SmarlincCommand("url:port/commandstring"); would be extremely useful to those trying to create thir own web based interface.

Thanks.



Yes! Using XMLHttpRequest means the XML file you're reading has to be on the same server as the web page you're using. However, I have found that if you run the web page locally on your computer you can access the XML file.

I have a small page at http://home.comcast.net/~andyf0/SLCControl.htm . If you bring it up and save the source on your local computer and run it from there you should be OK.

Things to note:

1. This will crash if you are not authenticated on the SmartLinc which is why I have tried to make sure you push the LOGIN button.

2. The URL:Port will be saved in a Cookie so you don't have to enter it each time.

3. I hardcoded some of my device IDs into it. They can be overridden or you can modify the source.

I'd like to see any improvements if you make any but otherwise feel free to use it at will. It'd be nice to get more folks working on this kind of stuff for the SmartLinc controller.

Andy
Go to Top of Page

Mike Berro
Average Member

USA
124 Posts

Posted - 03/01/2011 :  11:17:51 AM  Show Profile  Visit Mike Berro's Homepage  Reply with Quote
Andy,

Your web page is cool. However, I get an error when clicking the status button. I get "Access is denied" on this line:
httpRequest.open("GET", URL, false);

This happens whether I run from your site, or locally. I'm using Win7/IE8.

---Mike
Go to Top of Page

andyf0
Junior Member

USA
43 Posts

Posted - 03/01/2011 :  11:37:54 AM  Show Profile  Visit andyf0's Homepage  Reply with Quote
Hmm! It worked for me. You have to run it on a local computer or you will get this message. (darn security!) The only other time I got this error was when "URL" was invalid. I also tried it on a friends system at work and it worked OK so nothing special on my system. Check your URL field does not contain http:// on the input line. I add that automatically. You can add an "alert(URL);" statement before the call to verify what "URL" contains.

Edit: you have to allow ActiveX. But you wouldn't have gotton this far without it. You can try http://home.comcast.net/~andyf0/SLCBuffer.htm

This can be run from my server and will show the response string in an iFrame. Repeatedly if you want. Leave duration blank for a snapshot. If this doesn't work (it doesn't use any security restricted stuff) then you may have a network connection problem.

Andy

Edited by - andyf0 on 03/01/2011 12:06:47 PM
Go to Top of Page

andyf0
Junior Member

USA
43 Posts

Posted - 03/02/2011 :  12:40:56 PM  Show Profile  Visit andyf0's Homepage  Reply with Quote
quote:
Originally posted by Mike Berro

Andy,

Your web page is cool. However, I get an error when clicking the status button. I get "Access is denied" on this line:
httpRequest.open("GET", URL, false);

This happens whether I run from your site, or locally. I'm using Win7/IE8.

---Mike



I have duplicated this error on another system. It's obviously a security setting somewhere, there's just so many. (:.

Anyway, I'm trying to figure it out.


Andy

Edited by - andyf0 on 03/02/2011 12:41:54 PM
Go to Top of Page

Mike Berro
Average Member

USA
124 Posts

Posted - 03/02/2011 :  12:54:35 PM  Show Profile  Visit Mike Berro's Homepage  Reply with Quote
I appreciate your efforts. I plan to drop in a nice (I hope) UI, including labelling the devices and perhaps some icons.
Go to Top of Page

andyf0
Junior Member

USA
43 Posts

Posted - 03/03/2011 :  07:14:15 AM  Show Profile  Visit andyf0's Homepage  Reply with Quote
Well, I fixed it, but it remains unexplainable. It appears there was something wrong with the file it saved locally.

1. Execute the page online. View Source/File/Save Source. Save original HTML file to a local file and try executing again. When it first comes up it should ask permission to execute scripts and ActiveX. Right click and allow. If it doesn't do this, that is where the problem lies.

OR

2. Right click on the HTM you saved previously, select Copy. Right click where you want the file and select Paste. It will create a copy, rename it to something else. It should work the same as "1" above. (at least it did for me).

Let me know.

Andy
Go to Top of Page

Mike Berro
Average Member

USA
124 Posts

Posted - 03/03/2011 :  6:21:53 PM  Show Profile  Visit Mike Berro's Homepage  Reply with Quote
I tired the 2nd technique, and it works. Very bizarre! Right now it asks me permission to run the scripts, which is two clicks, but I'm hoping I can figure out how to tell IE8 to always allow it on that page.

Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Smarthome Forum © 2000-2014 SmartLabs, Inc Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07