technyon / nuki_hub

Use an ESP32 as a Hub between a NUKI Lock and your smarthome.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MQTT Entities in HA remain when lock not connected

DaveTiff opened this issue · 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?

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

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

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.

Closing as completed with answer provided.