Ok, did some more troubleshooting with: “openhab> log:set trace org.openhab.bindg.insteon” to get more info. What I’ve found is that Open and Close immediate events are actually reversed, but that when the 300s query checks the contact, it is correcting things.
I noticed there was not status update when I opened the door. Then found the Open status update when the door closed that I had noted before in the typical console log. I eventually found the following query after some waiting with the door closed:
2022-11-30 21:13:32.135 [DEBUG] [ding.insteon.internal.InsteonBinding] - got msg: IN:Cmd:0x50|fromAddress:45.31.0C|toAddress:31.34.98|messageFlags:0x21=ACK_OF_DIRECT:1:0|command1:0x02|command2:0x01|
2022-11-30 21:13:32.137 [DEBUG] [nsteon.internal.device.InsteonDevice] - ----- applying message to feature: IOLincContact
2022-11-30 21:13:32.139 [DEBUG] [on.internal.device.MessageDispatcher] - 45.31.0C:IOLincContact DIRECT_ACK: q:QUERY_PENDING cmd: 80
2022-11-30 21:13:32.141 [DEBUG] [on.internal.device.MessageDispatcher] - changing key to 0x19 for msg IN:Cmd:0x50|fromAddress:45.31.0C|toAddress:31.34.98|messageFlags:0x21=ACK_OF_DIRECT:1:0|command1:0x02|command2:0x01|
2022-11-30 21:13:32.142 [DEBUG] [steon.internal.device.MessageHandler] - ContactRequestReplyHandler: set contact 45.31.0C to: CLOSED
2022-11-30 21:13:32.144 [DEBUG] [nsteon.internal.device.DeviceFeature] - 45.31.0C:IOLincContact publishing: CLOSED
2022-11-30 21:13:32.146 [TRACE] [nternal.device.DeviceFeatureListener] - old state: OpenClosedType:OPEN=?CLOSED
2022-11-30 21:13:32.148 [TRACE] [nsteon.internal.device.DeviceFeature] - IOLincContact set query status to: QUERY_ANSWERED
2022-11-30 21:13:32.152 [DEBUG] [on.internal.device.MessageDispatcher] - defdisp: 45.31.0C:IOLincContact set status to: QUERY_ANSWERED
2022-11-30 21:13:32.154 [TRACE] [nsteon.internal.device.InsteonDevice] - handled reply of direct: IOLincContact(1:1:4)
I’d read this similar post a few times. Bernd explains the query command 2 is the returned state of the contact. It also gave me the idea that the on an off might be switched.
This site has some good info on commands. 0x11 is ON, and 0x13 is OFF on the group command “toAddress:00.00.01”.
It seems that, as Bernd put it, Command2 = 0x01 = CLOSED, and Command2 = 0x00 = OPEN for the query. Conversely the binding is interpreting as 0x11 = ON = OPEN, and 0x13 = OFF = CLOSED when the group message is received.
It now seems obvious, looking back at my first post, that the event is backwards. The Closed to Open transition occurred 10ms after the 0x11 message at the start of manually closing the garage door.
So, the sequence is not delayed. It is actually incorrect. The door is closed initially, thanks to the query getting it right. However, when it first opens, the triggered event status is also closed, and therefore not reported. When the door closes again, an Open Status is immediately triggered. In reality the door just closed. Eventually, the query runs again and sets the status correctly back to closed.
This explains why I was seeing immediate updates outside of the query. The kicker is that the query is correctly reading the status. Thus giving it the appearance of being correct.
It looks like the device itself can send different updates depending on what state the sensor is in when it is initially linked to the hub.
So… I unlinked and re-linked the IOlinc the low-tech way of pressing the button and holding. When I linked the IOlinc to the hub again the door was open. Now the contact switches immediately with the sensor!
The note below (from the binding documentation) mentions the “polling” being off when in reality it looks like its the status change event not the polling/query:
NOTE: If the I/O Linc returns the wrong value when the device is polled (For example you open the garage door and the state correctly shows OPEN, but during polling it shows CLOSED), you probably linked the device with the PLM or hub when the door was in the wrong position. You need unlink and then link again with the door in the opposite position. Please see the Insteon I/O Linc documentation for further details.
This didn’t point me in the right direction as polling/queries were returning correctly. The instructions from Insteon it recommends you refer to also show linking the device with the sensor input on (contacts together), which deos not work for the binding.
From what I can tell, the status from the query is true to the sensor input: 01 = ON = CLOSED & 00 = OFF = OPEN, whereas the messages the binding expects are 0x11 = ON = OPEN & 0x13 = OFF = CLOSED. I see a case for not updating now, to avoid messing up current users, but probably a good idea to document that the input needs to be OFF when the IO Linc is linked to the hub for the binding to work correctly.
TLDR; The contact wasn’t slow, the status events were actually inverted and eventually getting corrected by the query in 5 minute intervals. The IO Linc device can be configured to send matching or inverted messages based on the sensor input. This is determined by the state of the sensor when the IOLinc is linked to the responder (the hub in my case). Linking the IOlinc to the hub again with the garage door open (contacts apart for me) solved the issue.