Hello,
I have an IOLinc hooked up to my garage door, with magnetic sensor, and when I open and close the door, it sends the proper contact status (“OPEN” when I open the door, “CLOSED” when I close the door), so this aspect of it works great.
However, as soon as the device is polled, it returns a different status, which is interpreted as “OPEN” even when the door is closed. So, after I close it, it switches (properly) to CLOSED state, but the next time it’s polled, it reverts to OPEN even though the door is still closed.
Here is a log (with non-relevant lines removed) showing what I mean:
(3D.CC.81 is the Insteon address of my IOLinc)
2017-01-08 13:31:48.533 [DEBUG] [.internal.device.RequestQueueManager] - device queue for 3D.CC.81 is empty!
2017-01-08 13:33:02.512 [DEBUG] [g.insteonplm.InsteonPLMActiveBinding] - got msg: IN:Cmd:0x50|fromAddress:3D.CC.81|toAddress:00.00.01|messageFlags:0xCF=ALL_LINK_BROADCAST:3:3|command1:0x11|command2:0x00|
2017-01-08 13:33:02.520 [DEBUG] [lm.internal.device.MessageDispatcher] - all link message: IN:Cmd:0x50|fromAddress:3D.CC.81|toAddress:00.00.01|messageFlags:0xCF=ALL_LINK_BROADCAST:3:3|command1:0x11|command2:0x00|
2017-01-08 13:33:02.556 [DEBUG] [lm.internal.device.MessageDispatcher] - 3D.CC.81:IOLincContact->OpenedContactHandler cmd1:0x11 group 1/1:IN:Cmd:0x50|fromAddress:3D.CC.81|toAddress:00.00.01|messageFlags:0xCF=ALL_LINK_BROADCAST:3:3|command1:0x11|command2:0x00|
2017-01-08 13:33:02.560 [DEBUG] [eonplm.internal.device.DeviceFeature] - 3D.CC.81:IOLincContact publishing: OPEN
2017-01-08 13:33:02.571 [DEBUG] [lm.internal.device.MessageDispatcher] - all link message: IN:Cmd:0x50|fromAddress:3D.CC.81|toAddress:00.00.01|messageFlags:0xCF=ALL_LINK_BROADCAST:3:3|command1:0x11|command2:0x00|
2017-01-08 13:33:02.581 [DEBUG] [lm.internal.device.MessageDispatcher] - 3D.CC.81:IOLincSwitch->NoOpMsgHandler cmd1:0x11 group 1/1:IN:Cmd:0x50|fromAddress:3D.CC.81|toAddress:00.00.01|messageFlags:0xCF=ALL_LINK_BROADCAST:3:3|command1:0x11|command2:0x00|
2017-01-08 13:33:02.587 [DEBUG] [eonplm.internal.device.DeviceFeature] - 3D.CC.81:GenericLastTime publishing: 2017-01-08T13:33:02
2017-01-08 13:33:02.950 [DEBUG] [g.insteonplm.InsteonPLMActiveBinding] - got msg: IN:Cmd:0x50|fromAddress:3D.CC.81|toAddress:3C.4C.6D|messageFlags:0x45=ALL_LINK_CLEANUP:1:1|command1:0x11|command2:0x01|
2017-01-08 13:33:02.955 [DEBUG] [lm.internal.device.MessageDispatcher] - all link message: IN:Cmd:0x50|fromAddress:3D.CC.81|toAddress:3C.4C.6D|messageFlags:0x45=ALL_LINK_CLEANUP:1:1|command1:0x11|command2:0x01|
2017-01-08 13:33:02.960 [DEBUG] [lm.internal.device.MessageDispatcher] - all link message: IN:Cmd:0x50|fromAddress:3D.CC.81|toAddress:3C.4C.6D|messageFlags:0x45=ALL_LINK_CLEANUP:1:1|command1:0x11|command2:0x01|
2017-01-08 13:33:02.966 [DEBUG] [eonplm.internal.device.DeviceFeature] - 3D.CC.81:GenericLastTime publishing: 2017-01-08T13:33:02
2017-01-08 13:33:03.134 [DEBUG] [g.insteonplm.InsteonPLMActiveBinding] - got msg: IN:Cmd:0x50|fromAddress:3D.CC.81|toAddress:11.02.01|messageFlags:0xCF=ALL_LINK_BROADCAST:3:3|command1:0x06|command2:0x00|
2017-01-08 13:33:03.139 [DEBUG] [lm.internal.device.MessageDispatcher] - all link message: IN:Cmd:0x50|fromAddress:3D.CC.81|toAddress:11.02.01|messageFlags:0xCF=ALL_LINK_BROADCAST:3:3|command1:0x06|command2:0x00|
2017-01-08 13:33:03.143 [DEBUG] [lm.internal.device.MessageDispatcher] - all link message: IN:Cmd:0x50|fromAddress:3D.CC.81|toAddress:11.02.01|messageFlags:0xCF=ALL_LINK_BROADCAST:3:3|command1:0x06|command2:0x00|
2017-01-08 13:33:03.148 [DEBUG] [eonplm.internal.device.DeviceFeature] - 3D.CC.81:GenericLastTime publishing: 2017-01-08T13:33:03
2017-01-08 13:33:29.243 [DEBUG] [g.insteonplm.InsteonPLMActiveBinding] - got msg: IN:Cmd:0x50|fromAddress:3D.CC.81|toAddress:00.00.01|messageFlags:0xCF=ALL_LINK_BROADCAST:3:3|command1:0x13|command2:0x00|
2017-01-08 13:33:29.258 [DEBUG] [lm.internal.device.MessageDispatcher] - all link message: IN:Cmd:0x50|fromAddress:3D.CC.81|toAddress:00.00.01|messageFlags:0xCF=ALL_LINK_BROADCAST:3:3|command1:0x13|command2:0x00|
2017-01-08 13:33:29.272 [DEBUG] [lm.internal.device.MessageDispatcher] - 3D.CC.81:IOLincContact->ClosedContactHandler cmd1:0x13 group 1/1:IN:Cmd:0x50|fromAddress:3D.CC.81|toAddress:00.00.01|messageFlags:0xCF=ALL_LINK_BROADCAST:3:3|command1:0x13|command2:0x00|
2017-01-08 13:33:29.279 [DEBUG] [eonplm.internal.device.DeviceFeature] - 3D.CC.81:IOLincContact publishing: CLOSED
2017-01-08 13:33:29.299 [DEBUG] [lm.internal.device.MessageDispatcher] - all link message: IN:Cmd:0x50|fromAddress:3D.CC.81|toAddress:00.00.01|messageFlags:0xCF=ALL_LINK_BROADCAST:3:3|command1:0x13|command2:0x00|
2017-01-08 13:33:29.308 [DEBUG] [lm.internal.device.MessageDispatcher] - 3D.CC.81:IOLincSwitch->NoOpMsgHandler cmd1:0x13 group 1/1:IN:Cmd:0x50|fromAddress:3D.CC.81|toAddress:00.00.01|messageFlags:0xCF=ALL_LINK_BROADCAST:3:3|command1:0x13|command2:0x00|
2017-01-08 13:33:29.313 [DEBUG] [eonplm.internal.device.DeviceFeature] - 3D.CC.81:GenericLastTime publishing: 2017-01-08T13:33:29
2017-01-08 13:33:29.683 [DEBUG] [g.insteonplm.InsteonPLMActiveBinding] - got msg: IN:Cmd:0x50|fromAddress:3D.CC.81|toAddress:3C.4C.6D|messageFlags:0x45=ALL_LINK_CLEANUP:1:1|command1:0x13|command2:0x01|
2017-01-08 13:33:29.688 [DEBUG] [lm.internal.device.MessageDispatcher] - all link message: IN:Cmd:0x50|fromAddress:3D.CC.81|toAddress:3C.4C.6D|messageFlags:0x45=ALL_LINK_CLEANUP:1:1|command1:0x13|command2:0x01|
2017-01-08 13:33:29.692 [DEBUG] [lm.internal.device.MessageDispatcher] - all link message: IN:Cmd:0x50|fromAddress:3D.CC.81|toAddress:3C.4C.6D|messageFlags:0x45=ALL_LINK_CLEANUP:1:1|command1:0x13|command2:0x01|
2017-01-08 13:33:29.697 [DEBUG] [eonplm.internal.device.DeviceFeature] - 3D.CC.81:GenericLastTime publishing: 2017-01-08T13:33:29
2017-01-08 13:33:29.878 [DEBUG] [g.insteonplm.InsteonPLMActiveBinding] - got msg: IN:Cmd:0x50|fromAddress:3D.CC.81|toAddress:13.02.01|messageFlags:0xCF=ALL_LINK_BROADCAST:3:3|command1:0x06|command2:0x00|
2017-01-08 13:33:29.883 [DEBUG] [lm.internal.device.MessageDispatcher] - all link message: IN:Cmd:0x50|fromAddress:3D.CC.81|toAddress:13.02.01|messageFlags:0xCF=ALL_LINK_BROADCAST:3:3|command1:0x06|command2:0x00|
2017-01-08 13:33:29.889 [DEBUG] [lm.internal.device.MessageDispatcher] - all link message: IN:Cmd:0x50|fromAddress:3D.CC.81|toAddress:13.02.01|messageFlags:0xCF=ALL_LINK_BROADCAST:3:3|command1:0x06|command2:0x00|
2017-01-08 13:33:29.894 [DEBUG] [eonplm.internal.device.DeviceFeature] - 3D.CC.81:GenericLastTime publishing: 2017-01-08T13:33:29
2017-01-08 13:36:48.034 [DEBUG] [eonplm.internal.device.InsteonDevice] - qe taken off direct: IOLincContact(1:1:4) OUT:Cmd:0x62|toAddress:3D.CC.81|messageFlags:0x0F=DIRECT:3:3|command1:0x19|command2:0x01|
2017-01-08 13:36:48.040 [DEBUG] [ding.insteonplm.internal.driver.Port] - writing (500): OUT:Cmd:0x62|toAddress:3D.CC.81|messageFlags:0x0F=DIRECT:3:3|command1:0x19|command2:0x01|
2017-01-08 13:36:48.371 [DEBUG] [g.insteonplm.InsteonPLMActiveBinding] - got msg: IN:Cmd:0x50|fromAddress:3D.CC.81|toAddress:3C.4C.6D|messageFlags:0x2F=ACK_OF_DIRECT:3:3|command1:0x03|command2:0x00|
2017-01-08 13:36:48.375 [DEBUG] [lm.internal.device.MessageDispatcher] - 3D.CC.81:IOLincContact DIRECT_ACK: q:QUERY_PENDING cmd: 80
2017-01-08 13:36:48.381 [DEBUG] [lm.internal.device.MessageDispatcher] - changing key to 0x19 for msg IN:Cmd:0x50|fromAddress:3D.CC.81|toAddress:3C.4C.6D|messageFlags:0x2F=ACK_OF_DIRECT:3:3|command1:0x03|command2:0x00|
2017-01-08 13:36:48.386 [INFO ] [onplm.internal.device.MessageHandler] - ContactRequestReplyHandler: set contact 3D.CC.81 to: OPEN
2017-01-08 13:36:48.390 [DEBUG] [eonplm.internal.device.DeviceFeature] - 3D.CC.81:IOLincContact publishing: OPEN
2017-01-08 13:36:48.396 [DEBUG] [lm.internal.device.MessageDispatcher] - defdisp: 3D.CC.81:IOLincContact set status to: QUERY_ANSWERED
2017-01-08 13:36:48.403 [DEBUG] [eonplm.internal.device.DeviceFeature] - 3D.CC.81:GenericLastTime publishing: 2017-01-08T13:36:48
2017-01-08 13:36:48.533 [DEBUG] [.internal.device.RequestQueueManager] - device queue for 3D.CC.81 is empty!
your code goes here
At the beginning of the log, I open the door, and the log shows that the IOLIncContact->OpenedContactHandler receives the cmd1:0x11 and correctly published status as OPEN. (at 13:33:02.556 in the timestamp).
At 13:33:29, I close the garage door, and the IOLincContact->ClosedContactHandler receives the cmd1:0x13, and publishes the correct status as CLOSED.
Now, where the problem begins: at 13:36:48 (which is the next polling interval) the device is polled regarding contact status, and appears to return a command1:0x19. At 13:36:48.386, the ContactRequestReplyHandler changes the status of the contact to OPEN, even though it is still physically closed and nothing at the hardware side (the door, the magnetic contact etc) has changed.
I suspect this has to do with the device sending a different command (0x19) when polled about it’s status, rather than the open (0x11) or closed (0x13) commands it sends when something actually changes.
Is there a way to fix this? As it stands currently, my contact status only shows “CLOSED” correctly as soon as the door is closed, until the next polling interval, when the door status becomes OPEN regardless, forever after, until the next manual closing.
I am certainly not an expert in this stuff, though I have been using insteon for many years (new to Openhab, though) and I don’t know enough about Java to delve into the code and try and sort this out myself. If anyone can provide any suggestions to work around this, I would be glad to hear them. Is this a bug in the ContactRequestReplyHandler?
Thanks for any input,
Sean