Linking devices without physically pressing the Set button

495 views
Skip to first unread message

tbir...@gmail.com

unread,
Jan 26, 2017, 4:47:14 AM1/26/17
to insteon-terminal
Hi all,

I'm a bit of a lurker and tinkerer, but I think I've figured out how to link from the modem to a Insteon device without doing the button-dance.

First off, thank you Bernd Pfrommer for making the insteon-terminal. It is incredibly powerful.

A bit of background. I've been using MisterHouse to manage my Insteon network, but since I'm slowly transitioning to OpenHab, I needed something else that could do the management. I thought about keeping MisterHouse on since it does a lot of the gruntwork, but having it talk to the Insteon Hub V2 via networking is above my capabilities at this point. insteon-terminal fulfills that role, albeit it being a bit more low-level.

One thing that MisterHouse offers is the ability to link up a device given it's address. This is quite convenient, especially if there are a bunch of devices scattered throughtout the house that have been installed at once, or a modem goes belly-up.

I figured that if MisterHouse could do it, there had to be a way to make insteon-terminal do the same. After searching around on the Internet, poking through Bernd's code and MisterHouse's libraries, reading some of the leaked documentation, and a lot of trial and error, I've come up with this.

NOTE: This is protocol-level stuff. Deciphering some of this may be difficult without digging into the Insteon protocol. Also, I've only tested this on ONE I2CS device. Supposedly, older I2 devices and others are even easier to link up, but I have not tested at this time.

1. Import in the python libraries we'll need:
import message
import querier


2. Set up the messages:
# devAddr is set to the device we wish to add
devAddr
= "AA.AA.AA"
# This sets up a communication channel to the device in question
devSend
= Querier(InsteonAddress(devAddr))
# This is used to generate effectively a "hello world" message.
helloMsg
= message.createStdMsg(InsteonAddress(devAddr),0x0F,0x0d,0x00,-1)
# The magic command, that triggers linking on the device.
linkMsg
= message.createExtendedMsg(InsteonAddress(devAddr),0x09,0x01,[])


3. Send the helloMsg to confirm that this is a I2CS device and that we don't have a modem entry at this time.
modem.startWatch()
# We need this to see our response.
devSend
.sendMsg(helloMsg)
# You should get a "NACK_OF_DIRECT" response from a unlinked I2CS device. Other devices will respond, according to what I've seen.
modem
.stopWatch()



4. Initiate Linking mode on the Modem side, and trigger the linking sequence
modem.linkAsEither(01)
# Put the modem in linking mode
devSend
.sendMsg(linkMsg)
#There will be some beeping, and then the device will now be linked.
# You can verify by typing modem.getdb() or <device>.getdb()


5. Continue with manually manipulating the databases as described in the README.

I hope this may help someone. Have fun, and don't nuke your databases! :)

Bernd Pfrommer

unread,
Jan 26, 2017, 6:52:00 PM1/26/17
to insteon-terminal, tbir...@gmail.com
Thanks for the positive feedback, and for posting what you learned in general. It's always good to see how tools are being used.
On a side note: it was actually my son Daniel who started the project and wrote the core backend. I did however write most of the higher level, device specific python code.

Couple of thoughts:
- there is a method at the device level ( in "python/device.py") that should do the same: enterLinkingMode(0x01), but I don't think I ever used it. It also uses std message, you are using extended... hmm.
- With your ext2 message, can you link the modem to a device that does not have the modem in its linkdb yet? I was never able to do that, and always resorted to creating the first link via set button.

tbir...@gmail.com

unread,
Jan 26, 2017, 7:20:03 PM1/26/17
to insteon-terminal, tbir...@gmail.com
You're very welcome. I've just started playing with insteon-terminal, and am still learning all the functions it can do.
Ahh. Daniel's code is excellent! It made poking through the source code quite easy, and tracking down the necessary functions. :)

In regards to your thoughts:

1. I believe that method uses the old way of triggering a link from a device to a modem. I think it will work on the older Insteon devices, but nothing newer. The extended method is required for I2CS devices. In fact, looking at this code snippet from MisterHouse's Insteon Library, you can see the Insteon linkup workflow, which is what I modeled my code on. MisterHouse Insteon Library

2. I think that's what the ext2 message is doing. I can link to a leaked document where they discuss triggering a link to the I2CS without a prior linkup with the set button id you'd like. Also, on some of the higher-level devices (e.g. ISY99), it's possible to set up links without ever touching the set button. I know that's how I would set up new devices with MisterHouse, without ever needing to touch the set buttons. I'll re-verify tonight though, by factory-resetting both devices and trying it again.

Bernd Pfrommer

unread,
Dec 17, 2017, 11:30:29 AM12/17/17
to insteon-terminal
Last weekend my modem died, and no amount of soldering new capacitors in would bring it back to life. I have some 100+ devices to relink to the new modem!
So I thought I'd give your method a go, and by golly, it works! Awesome!

br...@ragon.org

unread,
Dec 10, 2018, 11:19:16 PM12/10/18
to insteon-terminal
Resurrecting an old post.  But just wanted to say that this non-dance linking method still works and has been a huge time saver!
Reply all
Reply to author
Forward
0 new messages