I’m in the process of porting over the 1.x InsteonPLM binding to a new 2.5+ Insteon binding. My goal is to use as much of the InsteonPLM code as possible, with little or no modification. The new binding can send updates to channels and receive commands from channels. There’s more work to do, but wanted to share the progress I’ve made so far. I only have a plm, and will need eventually work with somebody to test with Insteon hubs, along with other supported Insteon devices that I don’t own.
To show how the new binding works. Here’s an 1.x InsteonPLM example of an items file with two Insteon devices that are using the feature dimmer:
Dimmer dining "Dining Room Lights" {insteonplm="23.9F.82:F00.00.11#dimmer}
Dimmer living "Living Room Lights" {insteonplm="23.9F.F0:F00.00.11#dimmer}
The new Insteon binding uses a bridge to define the Insteon PLM or hub. Things are used to describe the Insteon devices. Using the above example, here’s how the Insteon devices it’s described in the things file:
Bridge insteon:plm:2413U [port="/dev/ttyUSB0"] {
Thing device 239F82 [address="23.9F.82", productKey="F00.00.11"]
Thing device 239FF0 [address="23.9F.F0", productKey="F00.00.11"]
}
Features for a Insteon device are represented as channels. Using the above example, here’s the updated items file:
Dimmer dining "Dining Room Lights" {channel="insteon:device:2413U:239F82:dimmer"}
Dimmer living "Living Room Lights" {channel="insteon:device:2413U:239FF0:dimmer"}
Currently the binding can send updates for channels and receive commands from a plm. Here’s an example from events.log:
2020-01-12 20:57:46.833 [vent.ItemStateChangedEvent] - dining changed from NULL to 100
2020-01-12 20:58:06.340 [vent.ItemStateChangedEvent] - living changed from NULL to 100
2020-01-12 20:58:21.953 [ome.event.ItemCommandEvent] - Item 'living' received command 0
2020-01-12 20:58:22.083 [nt.ItemStatePredictedEvent] - living predicted to become 0
2020-01-12 20:58:22.116 [vent.ItemStateChangedEvent] - living changed from 100 to 0
2020-01-12 20:58:28.765 [ome.event.ItemCommandEvent] - Item 'living' received command 100
2020-01-12 20:58:28.782 [nt.ItemStatePredictedEvent] - living predicted to become 100
2020-01-12 20:58:28.817 [vent.ItemStateChangedEvent] - living changed from 0 to 100
2020-01-12 20:58:33.453 [ome.event.ItemCommandEvent] - Item 'dining' received command 0
2020-01-12 20:58:33.483 [nt.ItemStatePredictedEvent] - dining predicted to become 0
2020-01-12 20:58:33.528 [vent.ItemStateChangedEvent] - dining changed from 100 to 0
2020-01-12 20:58:36.061 [ome.event.ItemCommandEvent] - Item 'dining' received command 100
2020-01-12 20:58:36.088 [nt.ItemStatePredictedEvent] - dining predicted to become 100
2020-01-12 20:58:36.182 [vent.ItemStateChangedEvent] - dining changed from 0 to 100
2020-01-12 21:13:36.470 [ome.event.ItemCommandEvent] - Item 'dining' received command 46
2020-01-12 21:13:36.582 [nt.ItemStatePredictedEvent] - dining predicted to become 46
2020-01-12 21:13:36.619 [vent.ItemStateChangedEvent] - dining changed from 100 to 46
And here’s an example of whats logged to openhab.log:
2020-01-12 20:57:36.434 [INFO ] [nsteon.internal.InsteonBridgeHandler] - device 23.9F.82 found in the modem database and the modem controls groups [0xFE] and responds to groups [0x01].
2020-01-12 20:57:36.455 [INFO ] [nsteon.internal.InsteonBridgeHandler] - device 23.9F.F0 found in the modem database and the modem controls groups [0xFE] and responds to groups [0x01].
2020-01-12 20:57:46.659 [INFO ] [steon.internal.device.MessageHandler] - DimmerRequestReplyHandler: set device 23.9F.82 to level 100
2020-01-12 20:58:06.324 [INFO ] [steon.internal.device.MessageHandler] - DimmerRequestReplyHandler: set device 23.9F.F0 to level 100
2020-01-12 20:58:22.010 [INFO ] [nsteon.internal.InsteonDeviceHandler] - Channel dimmer for device insteon:device:2413U:239FF0 triggered with command 0
2020-01-12 20:58:22.037 [INFO ] [steon.internal.device.CommandHandler] - PercentHandler: sent msg to set 23.9F.F0 to zero by switching off
2020-01-12 20:58:22.042 [INFO ] [nsteon.internal.InsteonBridgeHandler] - found binding config for channel insteon:device:2413U:239FF0:dimmer
2020-01-12 20:58:22.381 [INFO ] [steon.internal.device.MessageHandler] - DimmerRequestReplyHandler: set device 23.9F.F0 to level 0
2020-01-12 20:58:28.815 [INFO ] [nsteon.internal.InsteonDeviceHandler] - Channel dimmer for device insteon:device:2413U:239FF0 triggered with command 100
2020-01-12 20:58:28.823 [INFO ] [steon.internal.device.CommandHandler] - PercentHandler: sent msg to set 23.9F.F0 to 255
2020-01-12 20:58:28.827 [INFO ] [nsteon.internal.InsteonBridgeHandler] - found binding config for channel insteon:device:2413U:239FF0:dimmer
2020-01-12 20:58:29.161 [INFO ] [steon.internal.device.MessageHandler] - DimmerRequestReplyHandler: set device 23.9F.F0 to level 100
2020-01-12 20:58:33.488 [INFO ] [nsteon.internal.InsteonDeviceHandler] - Channel dimmer for device insteon:device:2413U:239F82 triggered with command 0
2020-01-12 20:58:33.499 [INFO ] [steon.internal.device.CommandHandler] - PercentHandler: sent msg to set 23.9F.82 to zero by switching off
2020-01-12 20:58:33.502 [INFO ] [nsteon.internal.InsteonBridgeHandler] - found binding config for channel insteon:device:2413U:239F82:dimmer
2020-01-12 20:58:33.827 [INFO ] [steon.internal.device.MessageHandler] - DimmerRequestReplyHandler: set device 23.9F.82 to level 0
2020-01-12 20:58:36.118 [INFO ] [nsteon.internal.InsteonDeviceHandler] - Channel dimmer for device insteon:device:2413U:239F82 triggered with command 100
2020-01-12 20:58:36.126 [INFO ] [steon.internal.device.CommandHandler] - PercentHandler: sent msg to set 23.9F.82 to 255
2020-01-12 20:58:36.144 [INFO ] [nsteon.internal.InsteonBridgeHandler] - found binding config for channel insteon:device:2413U:239F82:dimmer
2020-01-12 20:58:36.454 [INFO ] [steon.internal.device.MessageHandler] - DimmerRequestReplyHandler: set device 23.9F.82 to level 100
2020-01-12 21:02:46.616 [INFO ] [steon.internal.device.MessageHandler] - DimmerRequestReplyHandler: set device 23.9F.82 to level 100
2020-01-12 21:03:06.299 [INFO ] [steon.internal.device.MessageHandler] - DimmerRequestReplyHandler: set device 23.9F.F0 to level 100
2020-01-12 21:05:04.600 [INFO ] [steon.internal.device.MessageHandler] - LightOnDimmerHandler: device 23.9E.9D was turned on REGULAR. Sending poll request to get actual level
2020-01-12 21:05:05.948 [INFO ] [steon.internal.device.MessageHandler] - DimmerRequestReplyHandler: set device 23.9E.9D to level 100
2020-01-12 21:06:12.634 [INFO ] [steon.internal.device.MessageHandler] - LightOffDimmerHandler: device 23.9E.9D was turned off REGULAR.
2020-01-12 21:07:29.396 [INFO ] [nsteon.internal.InsteonBridgeHandler] - devices: 60 configured, 60 polling, msgs received: 158
More to come later…