kvj / hass_nuki_ng

Better support for Nuki devices in the Home Assistant
MIT License
185 stars 36 forks source link

Support more lock states #35

Open ZzetT opened 2 years ago

ZzetT commented 2 years ago

When I open or close the door, I can see that the state of my Nuki is either "locked" or "unlocked". However, according to https://developer.nuki.io/page/nuki-bridge-http-api-1-13/4/#heading--lock-states also other states like "unlatched" are support, but I don't see this in HA.

Could you please add this?

kvj commented 2 years ago

It's already supported, you just need to use the right sensor. binary_sensor.nuki_<...>_locked has only two states: locked and unlocked, but sensor.nuki_<...>_state has more (all supported) states.

ZzetT commented 2 years ago

Hi @kvj , my lock is called "zuhause" and this is the log of the sensor sensor.nuki_zuhause_state:

hascreenshot

Here, I can only see the states "locked" and "unlocked".

Inferi0r commented 2 years ago

It's already supported, you just need to use the right sensor. binary_sensor.nuki_<...>_locked has only two states: locked and unlocked, but sensor.nuki_<...>_state has more (all supported) states.

I can confirm after 1 month of usage that the state sensor only publishes locked and unlocked states, while my door is unlatched every day a few times. Both via Nuki, Homekit and even via Nuki_NG HAS.

Without Unlatch my door won't even open.

alexdelprete commented 2 years ago

@ZzetT @Inferi0r: the unlatched state is an intermediate state, the lock is unlatched and then unlocked (final state), the callback by the bridge to HA is triggered only on final states, no intermediate states can be reflected by HA sensors because they get updated by callback of the bridge and polling.

This is the way the bridge firmware works, as described by Nuki devs in their forum:

image

image

There's a FR open that you can vote for.

Hope it's clear how this works now.

kvj commented 2 years ago

Yeah, I also have an integration relying on the unlatched state change, and it's not super-reliable.

ZzetT commented 2 years ago

Thanks for the clarification.

alexdelprete commented 2 years ago

Yeah, I also have an integration relying on the unlatched state change, and it's not super-reliable.

I'm very upset about the bridge and its implementation, they didn't do a very good job. When I spoke to the product manager I told him about this...but...they look at the big numbers, and we're less than 0.5% of their average user unfortunately. 99.5% of users don't have a clue of what we're talking about...they simply use the mobile with the web interface, etc.

alexdelprete commented 2 years ago

Thanks for the clarification.

my pleasure. I spent days building my Nuki Card, so I spent days on their forum trying to overcome issues. I understand how you feel, but unfortunately the bridge is a badly designed solution, and I discussed with them on their forum and also in video conference with product management. But I don't expect anything good coming from those conversations, they are focused on the vast majority of users....and we're not part of them with our requirements.

Please close the issue if you're ok now. :)

alexdelprete commented 2 years ago

@kvj you can close this one.