OpenHab + Insteon - ISY i994

Hi Everybody,
I’m very new to OpenHAB but had been usinf Insteon devices with ISY i994 controller. Not very happy with ISY. T programming feels complex and i dont see a full picture of the rules.

I’m thinking about removing all internal links between devices and let the OpenHAB to receive the signal from devices, run the logic and act accordingly. I understand that this would introduce some delay, compared with the case when devices can talk to each other in parallel. So my question is whether the lag would be that much noticeable? Any other issues i might see when using Insteon USB PLM modem with the OpenHAB 2?

Also, which bindings should i use to make this work?

Thanks,
Ruben

It all depends on the Insteon comms between devices. I don’t think you will find openHAB is the bottleneck. I have many Z-Wave devices which are all interconnected via openHAB - i.e. no direct associations or linkages. Added to this are countless other devices and protocols, all routing through openHAB.

This design works very well IMO, I have a complete view of everything in the house, both physical and virtual (e.g. sunset/sunrise times and presence detection) and can write rules using all these as inputs.

And I don’t see any noticeable lag either. For example, when I hit pause whilst watching a movie in Kodi, all the lights in my living room turn on instantly (via Zwave).

I am using Insteon with a PLM on OpenHAB 2. I feel it’s very responsive, even more so than OpenHAB 1.

I’m confused about this comment. do you mean between ISY i994 <-> devices? If so, no need to remove it, you just need link the devices you want OpenHAB to control with the PLM.

Sounds good. I have the openHab running, but yet to configure the Insteon PLM…

Well, I was hoping that OpebHAB can completely replace the ISY i994 and also replace device <-> device communication. Is there anything with ISY that OpenHAB cannot replace? With ISY I am not using anything beyond basic programming.

Another question is regarding the setup. I have the OpenHAB running. From the web interface installed the Insteon PLM Add-on. Not sure how to proceed forward. Would appreciate some hints. So as of right now it is the second PLM connected to my network. The first serial PLM is connected to the ISY, and the second usb PLM is connected to OpenHAB (running on Raspberry PI 3).

Thanks,
Ruben

@rubenhak

I’ve been using OpenHAB with Insteon for some time now and can advise you to familiarize yourself with the Intsteon Terminal developed by berndpfrommer.

No matter what, you’ll never get away form the linking process built into Insteon. With OpenHAB you can create a group, place all the devices (Insteon or Other) in there and just switch that group. No need to link the devices.

However keep this in mind, if you have a three way switch configuration , you’ll need to create the links between the two devices to ensure that when one is triggered the other responses by lighting up the display. That being said, the binding info along with Insteon Terminal will allow you to master this quickly.

I had already installed the Insteon Terminal, but couldn’t make it work with the PLM usb modem. I have uncommented the modem line in “init.py” and specified the modem address like this:
modem = Modem2413U("tesmt_modem", "41.ec.8e")
But, when i try to execute some action I receive “Not connected exception”:

>>> modem.getid()

Traceback (most recent call last):
File “”, line 1, in
File “python/modem2413U.py”, line 115, in getid
self.querier.sendMsg(msg)
File “python/querier.py”, line 56, in sendMsg
iofun.writeMsg(msg)
File “python/iofun.py”, line 77, in writeMsg
console.writeMsg(msg)
at us.pfrommer.insteon.terminal.IOFun.writeMsg(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)

java.io.IOException: java.io.IOException: Not connected

@rubenhak

Ok here’s a serries of questions that will help me get an understading of your current set-up with Insteon Terminal.

  1. What OS are you running Inteon Terminal on?

  2. Have you installed the most current version of Oracle Java SDK?

  3. Can you share (with your identifying info replaced) your init.py?

I had a tough time getting started with Insteon Terminal but after the steep learning curve I was able to use it to make all the necessary links i needed. I no longer play the insteon paring dance around the house now. But be warned, Insteon is slow and some times you’ll need to send some commands multiple times before the changes take effect. But don’t let that daunt you, you’ll really enjoy OpenHAB.

1 Like

Also, make sure the user is also a part of the dialout group:

$ ls -l /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Mar 10 14:42 /dev/ttyUSB0

@wdesponts, Please see the answers inline below:

Linux OpenHAB 4.4.0-1-rpi2 #1 SMP Debian 4.4.6-1+rpi14 (2016-05-05) armv7l GNU/Linux

I’m running open jdk instead. Here is the version:
openjdk version "1.8.0_112"
OpenJDK Runtime Environment (Zulu Embedded 8.19.0.31-linux-aarch32hf) (build 1.8.0_112-b31)
OpenJDK Client VM (Zulu Embedded 8.19.0.31-linux-aarch32hf) (build 25.112-b31, mixed mode, Evaluation)

Sure, here it is. I’ve removed the comments to save some space.

from console_commands import *
from keypad2487S import *
from thermostat2441TH import *
from modem2413U import *
from switch2477S import *
from dimmer2477D import *
from ledBulb2672 import *

def connectToMyHub():
    """connects to my insteon hub modem at pre-defined address"""
    connectToHub("insteonhub", 25105, 1000, "MyHubLogin", "MyHubPassword")

def connectToMyLegacyHub():
    """connects to my insteon hub modem at pre-defined address"""
    connectToLegacyHub("insteonhub", 9761) # syntax is address, port (generally 9761)
    

def connectToMySerial():
    """connects to my modem on pre-defined serial port"""
    connectToSerial("/dev/insteon")

# Example device definitions
modem       = Modem2413U("tesmt_modem", "41.ec.8e")
light = Switch2477S("BackYardLight", "29.5a.75")

I’m totally comfortable writing python script to link devices. But need to get it working for the basic case. In regards with retries, are they configurable?

One more question, in regards with insteon-terminal I have not specified which USB device to use for communication. Should I specify it somewhere in the configuration file, or it is smart enough to identify the PLM automatically?

Yeah, it seems like correct:

[22:31:24] openhabian@OpenHAB:~$  ls -l /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Mar 10 06:54 /dev/ttyUSB0

Sorry I wasn’t clear enough, the user needs to be a part of the dialout group:

$ id
uid=1000(foo) gid=1000(foo) groups=1000(foo),20(dialout),27(sudo)

I think it is, right?

[22:37:07] openhabian@OpenHAB:~$ id
uid=1000(openhabian) gid=1000(openhabian) groups=1000(openhabian),5(tty),20(dialout),27(sudo),113(openhab)

I’ve found the /etc/openhab2/services/insteonplm.cfg file. Uncommented the port_0=/dev/ttyUSB0 line and added a light switch definition like this:
Switch BackYardLight "Back Yard Light" {insteonplm="29.5A.75:F00.00.02#switch"}

Though, still don’t see the light switch in the web ui.

What do you see in userdata/logs/openhab.log? InsteonPLM logs all sorts of info. It will also show how you’ve got the devices linked with the PLM:

2017-03-06 20:30:20.716 [INFO ] [nding.insteonplm.InsteonPLMActivator] - Insteon PLM binding has been started.
2017-03-06 20:30:21.134 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - dead device timeout set to 3000s
2017-03-06 20:30:21.148 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - config: port_0 -> /dev/ttyUSB0
2017-03-06 20:30:21.149 [INFO ] [b.core.service.AbstractActiveService] - InsteonPLM has been started
2017-03-06 20:30:21.204 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - devices:   0 configured,   0 polling, msgs received:     0
2017-03-06 20:30:21.327 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - config: service.pid -> org.openhab.insteonplm
2017-03-06 20:30:28.755 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - modem database has 61 entries!
2017-03-06 20:30:28.776 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - device 23.9F.C9 found in the modem database and the modem controls groups [0xFE] and responds to groups [0x01].
2017-03-06 20:30:28.886 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - device 24.33.F7 found in the modem database and the modem controls groups [0xFE] and responds to groups [0x01].

If you have the PLM configured to respond to devices, when you flip the switch you should also see messages showing up in the log, along with when you make changes from the UI.

Thanks, I’ve got one step forward. My first mistake was the extra “(Linux, usb plm modem)” in the end of the port_0=/dev/ttyUSB0. I removed it and now can get the modem connected got some entries from the modem database. Though, I had to restart the device for the changes to take effect. Is there a better way of reloading changes? So now, this is what I see in the logs:

2017-03-11 21:20:51.129 [INFO ] [nding.insteonplm.InsteonPLMActivator] - Insteon PLM binding has been started.
2017-03-11 21:20:51.376 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - refresh interval set to 600s
2017-03-11 21:20:51.390 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - poll interval set to 300000 per config file
2017-03-11 21:20:51.395 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - dead device timeout set to 3000s
2017-03-11 21:20:51.411 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - config: poll_interval -> 300000
2017-03-11 21:20:51.413 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - config: port_0 -> /dev/ttyUSB0
2017-03-11 21:20:51.414 [INFO ] [b.core.service.AbstractActiveService] - InsteonPLM has been started
2017-03-11 21:20:51.455 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - devices:   0 configured,   0 polling, msgs received:     0
2017-03-11 21:20:51.512 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - config: Switch officeLight "office light" {insteonplm -> "xx.xx.xx:F00.00.02#switch"}
2017-03-11 21:20:51.514 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - config: refresh -> 600000
2017-03-11 21:20:51.516 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - config: Switch BackYardLight "Back Yard Light" {insteonplm -> "29.5A.75:F00.00.02#switch"}
2017-03-11 21:20:51.517 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - config: service.pid -> org.openhab.insteonplm
2017-03-11 21:20:51.648 [INFO ] [onplm.internal.driver.SerialIOStream] - successfully opened port /dev/ttyUSB0
2017-03-11 21:20:52.088 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - modem database has 2 entries!
2017-03-11 21:20:52.092 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - device **29.5A.75** found in the modem database, but is not configured as an item and the modem controls groups [0x00] and responds to groups [0x01].

In the /etc/openhab2/services/insteonplm.cfg I only have a single device:
Switch BackYardLight "Back Yard Light" {insteonplm="29.5A.75:F00.00.02#switch"}
From where does the officeLight switch come from?

So I have this 29.5A.75 device in the modem database which I have added using HomeLinc, how do I configure it as an item to make the OpenHab happy?

The insteonplm.cfg file should only contain binding configuration info. items need to go in the items directory with the extension .item (see http://docs.openhab.org/configuration/items.html). For example you could create an items/insteonplm.items with:

Switch BackYardLight "Back Yard Light" {insteonplm="29.5A.75:F00.00.02#switch"}

As for the officeLight switch, is it in the items directory?

You’ll also need to create a sitemap, check out http://docs.openhab.org/configuration/sitemaps.html for more info on how to create sitemaps.

Ta-dam, it takes quite an effort, but eventually I managed to get this working. Now I see the two test switches in the sitemap, and could control them.

Though, there are few issues. I still see some ghost devices identified that are not part of the items. Not sure where do they come from. Would appreciate help in identifying them.

Another issue I have is to make insteon-terminal work. It still gives me Not Connected exception error.

Thanks!

Looking at the earlier logs: [quote=“rubenhak, post:16, topic:24690”]
2017-03-11 21:20:51.512 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - config: Switch officeLight “office light” {insteonplm -> “xx.xx.xx:F00.00.02#switch”}
[/quote]

It looks like it’s coming from the InsteonPLM config files, but that is just a guess.

As for the “Not connected” exception error, maybe @Bernd_Pfrommer has an idea. Maybe you are running OH and insteon-termial are running at the same time? You can only have one of them accessing the PLM at a time.

I’d need more data (e.g. log files) to trouble shoot the InsteonTerminal issues.