nuki_hub icon indicating copy to clipboard operation
nuki_hub copied to clipboard

MQTT Entities in HA remain when lock not connected

Open DaveTiff opened this issue 11 months ago • 3 comments

Hi, juts got my Nuki 4 Pro yesterday and just found your code and installed on an ESP32.

I took the battery out overnight to fully charge it, but before inserting the battery this morning I looked at HA and you would not know that the lock was unpowered. If you log onto the Hub the only clue is "Nuki Lock State = undefined"

Can this state be reflected in HA so one knows there might be a problem?

DaveTiff avatar Mar 19 '24 09:03 DaveTiff

The lock state undefined is the way this is reflected. You can create an automation to signal you when this MQTT state is detected.

iranl avatar Mar 19 '24 19:03 iranl

Hi, thanks, but the "undefined" state shows up on the Hub webpage but not in HA, still says Locked or Unlocked (Last state)

DaveTiff avatar Mar 20 '24 19:03 DaveTiff

That behaviour is expected. HA does not have a "undefined" state for locks.

You can research how to use MQTT topics as triggers or conditions for automations in Home Assistant via the HA community (e.g. https://community.home-assistant.io/t/automation-based-on-mqtt-topic-solved/278674)

Use the nuki/lock/state topic as the MQTT topic.

iranl avatar Mar 25 '24 18:03 iranl

Closing as completed with answer provided.

iranl avatar May 17 '24 17:05 iranl