Removing bad entries from modem db

Is there a way to remove old devices from the 2012 hub modem db? I tried insteon terminal, but it does not look like it work wish 2012 hub. Ideally the insteonplm would allow for some basic add/delete functionality.

I had some rudimentary add/delete functionality in the insteonplm binding but it was hard to use so I removed it eventually.

@dan_pfrommer and I wrote the InsteonTerminal for exactly that purpose. I will send him a note to add the 2012 hub. Should be easy since the InsteonTerminal uses the same connectivity layer as openhab.


I’ve added (untested) support for the 2012 hub to the terminal. You can connect either by configuring connectToMyLegacyHub() in the or using connectToLegacyHub(host, port) through the command line.

The addition and removal of links in the modem database can be done through the commands in the Modem2413U class.
For a list of methods in the class use


The legacy hub support has not been tested (as I have no legacy hub to test it on). If you encounter any difficulties, please let me know.

[root@marge insteon-terminal]# ./insteon-terminal
Insteon Terminal
Python interpreter initialized…

connectToLegacyHub(“”, 9761)

16:14:14.232 [Thread-2] ERROR u.pfrommer.insteon.cmd.msg.MsgReader - incoming message does not start with 0x02, searching for start

I can get the id(), just not the db()

sent msg: OUT:Cmd:0x60|

getid got msg: IN:Cmd:0x60|IMAddress:25.DC.72|DeviceCategory:0x03|DeviceSubCategory:0x37|FirmwareVersion:0x9C|ACK/NACK:0x06|


I think I know what’s going on. The insteon terminal uses an ancient version of the binding’s parsing code, which is rather unrobust to bytes being dropped. Unfortunately, the old hub has a tendency to drop bytes mid-message, which is probably the cause of the error. I’ll put updating that on my to-do list and try to get to it as soon as possible (probably today or tomorrow).

Do you get the error every time you try to access the database?

Also, for debugging purposes you can monitor the messages sent and received from the PLM using trackPort() (requires a graphical display, unfortunately). That might help track down what exactly is going wrong.


Updated the message reading code. It should’ve fixed the issue, as the messaging code should now be up-to-date with the binding’s.

Just a heads up: After pulling, make sure you run

ant jar

or the insteon-terminal executable will still be using the old version.

Any idea how to cut and paste from that? A bunch of data went in/out when I typed modem.getdb(), but then it froze, last thing I saw was:

IN: 02 6A 06
IN: 02 57 E2 F7 28 A5 DD 01 00 F7
OUT: 02 6A
IN: 02 6A 06

I think it may have to do with the size of my db and getting a bad command. I connected another 2012 hub to the internet (, 9761). Sometimes I can do a modem.getdb(), but if I hit up arrow and enter a few times it will lock up. I also tried to do a modem.nukeDB() and it locks up every time.

Feel free to play with it, its a hub that I am not using so you can do whatever you want to it.

Have you pulled and used the new code? (don’t forget to re-run ant jar)

I connected to your modem and pulled the database seven times times. With the new code, it only gave a bad message error once, and even then still correctly pulled the database.

Note that I didn’t test nuking the database, as didn’t want to mess around with your insteon network.

Try nuking the db, its a test hub, not related to my network.

nuking 16 records
Traceback (most recent call last):
File “”, line 1, in
File “/root/insteon-terminal/./python/”, line 260, in nukeDB
File “/root/insteon-terminal/./python/”, line 212, in nukeDB
modem.deleteFirstRecord(rec[“addr”], rec[“group”])
AttributeError: Modem2413U instance has no attribute ‘deleteFirstRecord’

This seems like a bug in the scripted part of the insteon terminal. I’ll take a look at it as soon as I finish some re-writing of parts of the terminal.