MQTT Lock customization and "unknown" lock state

I recently bought a Schlage ZWave plus lock which I have connected to SmartThings and working with HA via MQTT.

Often, when the the lock is locked manually (via key or deadbolt) smartthings will set the state to “unknown”. Maybe we have a defective lock, I’d be curious if anyone else experiences this.

I also have an open/closed sensor on the door, and it seems like a reasonably simple software fix to me—if the state ever flips to “unknown” and the door is closed I would just like to send a “lock” signal.

But, Home Assistant interprets “uknown” state as “unlocked”, which makes sense to me since we’re talking about security. Is there any way to override the default MQTT lock functionality, so it can understand “unknown” as truly “unknown”, then I can write an automation to automatically lock it if it is unknown for x seconds?


1 Like

edit: Finally found a way to solve this that works for me. Instead of trying to fix anything I really just want it to display that the lock is jammed if it reports “UNKNOWN”.

I created an automation that looks for the “UNKNOWN” payload and then publishes a payload on the same topic of “JAMMED”. The lock reports jammed right away.

  - platform: mqtt
    topic: ring/< home id>/alarm/<lock id>/lock/state
    payload: UNKNOWN
  condition: []
  - service: mqtt.publish
      topic: ring/<home id>/alarm/<lock id>/lock/state
      payload: JAMMED
      qos: '0'
      retain: true
  mode: single

Hope that helps anyone that comes across this thread.

Interesting, thank you for the solution sswany.

FWIW, the problem went away for me. I made two changes, one was to stop locking the deadbolt from the outside with the key, which seemed to be what triggered this scenario. The second was to move my hub closer to the deadbolt, as I read other places (and you probably did as well) the schlage locks can be finicky about using repeaters.

Anyway, it’s been rock solid for me for months now after those changes.