Door locks that support open/close detection

The only thing I can think of is possibly this -:

I’ll take a look.

The change looks good, but there’s one thing I’m a little confused about.

The sensor_door channel is defined as type Contact, and I have my item defined as a Contact as well. And I see you’re setting OPEN/CLOSED in the code. But when I look at the event log, I see the item changing between ON and OFF.

Is this the expected behavior?

Contact Door_Sensor "Door Sensor [%s]" { channel="zwave:device:zstick:node94:sensor_door"}
2018-10-20 07:22:28.360 [vent.ItemStateChangedEvent] - DoorSensor changed from OFF to ON
2018-10-20 07:22:37.450 [vent.ItemStateChangedEvent] - DoorSensor changed from ON to OFF

No, and in my tests it was open/closed… Can you check the log - there’s not a lot logged, but there should be this message -:

        logger.debug("NODE {}: Handle door lock event {} endpoint {}", event.getNodeId(), event.getType());

It should be there twice with different event types - it would be interesting to check this… The code can really only return open/closed for this channel…

One other thing - are you able to differentiate between the lock state and door state? eg can you lock the door with it open, and ensure the door_sensor channel still shows open?

Good point. I’ll try that.

I see this in the log. You’re missing an argument in your log statement.

2018-10-20 07:22:37.599 [DEBUG] [ng.zwave.internal.converter.ZWaveDoorLockConverter] - NODE 94: Handle door lock event DOOR_LOCK_STATE endpoint {}
2018-10-20 07:22:37.599 [DEBUG] [ng.zwave.internal.converter.ZWaveDoorLockConverter] - NODE 94: Handle door lock event DOOR_LOCK_STATE endpoint {}
2018-10-20 07:22:37.599 [DEBUG] [ng.zwave.internal.converter.ZWaveDoorLockConverter] - NODE 94: Handle door lock event DOOR_CONDITION endpoint {}
2018-10-20 07:22:37.599 [DEBUG] [ng.zwave.internal.converter.ZWaveDoorLockConverter] - NODE 94: Handle door lock event DOOR_CONDITION endpoint {}

Thanks. I’ll remove the “endpoint {}” part - it’s not needed.

In any case, this shows both reports - I can’t see how to get an ON/OFF with door_sensor as the channel :confounded:

Are there state updates also logged between these messages?

Here’s the full log. You’re clearly setting OPEN/CLOSED.

2018-10-20 07:22:37.598 [DEBUG] [.openhab.binding.zwave.internal.protocol.ZWaveNode] - NODE 94: Incoming command class COMMAND_CLASS_DOOR_LOCK, endpoint 0
2018-10-20 07:22:37.598 [DEBUG] [e.internal.protocol.commandclass.ZWaveCommandClass] - NODE 94: Received COMMAND_CLASS_DOOR_LOCK V1 DOOR_LOCK_REPORT
2018-10-20 07:22:37.598 [DEBUG] [al.protocol.commandclass.ZWaveDoorLockCommandClass] - NODE 94: Door-Lock state report - lockState=Unsecured, handlesMode=1, doorCondition=3, timeoutMinutes=254, timeoutSeconds=254
2018-10-20 07:22:37.599 [DEBUG] [rg.openhab.binding.zwave.handler.ZWaveThingHandler] - NODE 94: Got an event from Z-Wave network: ZWaveCommandClassValueEvent
2018-10-20 07:22:37.599 [DEBUG] [rg.openhab.binding.zwave.handler.ZWaveThingHandler] - NODE 94: Got a value event from Z-Wave network, endpoint = 0, command class = COMMAND_CLASS_DOOR_LOCK, value = 0
2018-10-20 07:22:37.599 [DEBUG] [ng.zwave.internal.converter.ZWaveDoorLockConverter] - NODE 94: Handle door lock event DOOR_LOCK_STATE endpoint {}
2018-10-20 07:22:37.599 [DEBUG] [ng.zwave.internal.converter.ZWaveDoorLockConverter] - NODE 94: Handle door lock event DOOR_LOCK_STATE endpoint {}
2018-10-20 07:22:37.599 [DEBUG] [rg.openhab.binding.zwave.handler.ZWaveThingHandler] - NODE 94: Updating channel state zwave:device:zstick:node94:lock_door to OFF [OnOffType]
2018-10-20 07:22:37.599 [DEBUG] [rg.openhab.binding.zwave.handler.ZWaveThingHandler] - NODE 94: Got an event from Z-Wave network: ZWaveCommandClassValueEvent
2018-10-20 07:22:37.599 [DEBUG] [rg.openhab.binding.zwave.handler.ZWaveThingHandler] - NODE 94: Got a value event from Z-Wave network, endpoint = 0, command class = COMMAND_CLASS_DOOR_LOCK, value = 3
2018-10-20 07:22:37.599 [DEBUG] [ng.zwave.internal.converter.ZWaveDoorLockConverter] - NODE 94: Handle door lock event DOOR_CONDITION endpoint {}
2018-10-20 07:22:37.599 [DEBUG] [rg.openhab.binding.zwave.handler.ZWaveThingHandler] - NODE 94: Updating channel state zwave:device:zstick:node94:sensor_door to CLOSED [OpenClosedType]
2018-10-20 07:22:37.599 [DEBUG] [ng.zwave.internal.converter.ZWaveDoorLockConverter] - NODE 94: Handle door lock event DOOR_CONDITION endpoint {}

Interesting. I’m not sure what’s changing this then, but it’s not the binding :slight_smile:

I think that this is probably ok then and I can probably merge this (I’ll fix the log message)?

Me either. But I’ll look into it more closely.

Yes, this is working as expected.

Yep.

1 Like

Thanks.

I’ll bet this is it. When you set the Thing online without a detailed status, it cleared out whatever detailed status might’ve been set (e.g. Request NIF). By removing that updateStatus call, the detailed status is not cleared.

Yep - I’ll make a change in this PR that will hopefully fix it. I’ll just add an update status in the Done state - that ought to sort it out (should really have been there anyway I think).

Ok, nevermind, it’s reporting OPEN/CLOSED just fine. It was my brain that was not working correctly this morning. :man_facepalming:

1 Like

Confirming that this fixed the issue with the “Request NIF” node status not being cleared after initialization completes.

Thanks!!!

1 Like