kvj / hass_nuki_ng

Better support for Nuki devices in the Home Assistant
MIT License
176 stars 33 forks source link

battery drain after last updates #58

Open PetrMa opened 2 years ago

PetrMa commented 2 years ago

Hello,

after some of last updates my Nuki batterry was discharged after few days (about 2 weeks). It is not very good. Is there any change which can do it?

There is a situation after I made the upgrade of Nuki integration: image

Thanks, Petr

PetrMa commented 2 years ago

Hmmm, today I´am on 18% of battery after 5 days. It is not really good. I´am going back to 0.2.1 and waiting if it will be better. with this version there was no problem.

For info. I have Nuki 3.0 Pro without bridge and latest version of HA and other components.

PetrMa commented 2 years ago

OK, Now I can confirm, that the issue started after version 0.3.0 was installed 23 days ago. After that the battery is drained on all 0.3.x versions for Nuki 3.0 Pro lock image

Aviv943 commented 2 years ago

I have the same issue, battery drain from 100% to 10% in like 2-3 days after the last updates. Version 0.3.4 is installed now.

PetrMa commented 2 years ago

@Aviv943 Thanks for your confirmation. I am happy that it's not my individual issue. After I made downgrade to 0.2.1 the battery is OK. After 5 days is on 95%. @kvj could you please help us?

Thanks

kvj commented 2 years ago

hmm, I will take a look. There was only one change that could potentially affect the performance - the re-order of callbacks. Nuki NG tries to put itself to the top of the callbacks lists, to improve reliability. But it only applies to setups where callbacks are being used for something else.

alexdelprete commented 2 years ago

I didn't notice anomalies in battery consumption after last update.

PetrMa commented 2 years ago

Hi @alexdelprete,

thanks for your questions, but they are not relevant as I already wrote that I have Nuki 3.0 Pro not Nuki 3.0 with bridge. PRO version has built-in Wi-Fi modul but there is no external bridge so this not allow me to install Official Nuki integration because Nuki 3.0 can´t communicate directly with HA and I´am not able to provide any logs etc. because there are no logs in PRO version. https://nuki.io/en/smart-lock-pro/ The only one I can provide is information about the battery and it says that the battery drain stared after upgrade to 0.3.x version and stopped after downgrade back to 0.2.1.

alexdelprete commented 2 years ago

Hi,

I read the first post, and you didn't write there what product you used. My fault not reading the second post, sorry.

So you're working in polling mode. The only thing I can think that can drain the battery is if the device gets polled too frequently, default is 30s, did you change the default value? I don't recall changes in that regard in latest version of nuki_ng.

PetrMa commented 2 years ago

Hi Alex,

that´s my fault with the device identification.

No, I didn´t changed the default 30s value. How the integration plugin works? Because in this situation the Nuki integration asks every 30s for last status only WEB API but not directly the Nuki lock, true? Can the integration call current status via WEB API or not? I know that I´am able to call status of the Nuki lock from web https://web.nuki.io/#/pages/smartlocks but I´am not sure if this action can be called directly by HA integration.

alexdelprete commented 2 years ago

The integration can use the bridge to interface the lock, and in case you don't have the bridge, it leverages the Web API. So it uses all the available apis while providing the switches/sensors/services in HA to use the Lock. The advantage of having the bridge is that you can use callbacks instead of constantly polling. It means that the bridge sends info to the integration when there's an update, so it's faster and more efficient.

In your case, the integration uses nuki's cloud services to query the lock or send commands. Did you read the documentation on github? it's the repo page.

image

I wonder if you configured the integration correctly, since you asked if the integration supports the Web API. How did you install/configure it?

PetrMa commented 2 years ago

@alexdelprete there is Nuki configuration. Nothing else is configured image

The configuration is OK. Another configuration is not needed and allowed with Nuki 3.0 PRO. I hope that problem is somewhere in callbacks as said KVJ. There are 2 people with the same issue after last updates were installed. But I can´t to help with investigation as there are no information which can help with debug.

alexdelprete commented 2 years ago

To answer your question regarding Web API support of the integration: You understand what the Web API token in that config is used for? It's used by the integration to communicate with Nuki Web API that communicates with the lock. I didn't ask to do another configuration, I only wondered how you configured it since you didn't know it supported the Nuki Web API.

Regarding callbacks: it has nothing to do with your case, callbacks are made by the bridge, and you don't have it.

So the only thing that can potentially drain the battery too fast is if the lock is queried by the web api too frequently: by the integration, the Nuki mobile app, etc.

Jasonthefirst commented 2 years ago

I am not sure if this issue is fitting but my power graph looks pretty similar. After may 3th it takes one or two weeks to be completly empty. Before that it took a few month. I am using the first nuki door opener with the nuki bridge. It should be connected locally but if I read this thread right, if I added the nuki web token it will use the web api (for everything?). Is there anything I should log or add to this thread so you could look into this (if it is a bug?).

djfanatix commented 2 years ago

I have the same issue with battery drain with a nuki 2.0

I will revert to 0.2.1 and check again

djfanatix commented 1 year ago

Do some people still have this issue? I still have a battery drain of 2-3% a day. I put the polling on 600s

circa1665 commented 1 year ago

Am also having this issue, also have the Nuki 3.0 PRO but am using the external bridge to attempt to improve battery life. Power pack has to be charged every 2 weeks currently.

Idan37S commented 1 year ago

I'm having this issue as well. Using Nuki 3.0 Pro with a bridge, both Web API and bridge API have been configured. Every 2 weeks i have to charge my Nuki power pack.

neuroverflow commented 10 months ago

Same for me, Nuki 1 with bridge, needs to charge it every week.

d307473 commented 3 weeks ago

Same issue with my Nuki Smart Lock 3.0 (Standard), Nuki Bridge and hass_nuki_ng 0.5.2. Conenction is via local (Bridge) Web API only. Bridge is on firmware version 2.18.0 and the Nuki Smart Lock on 3.9.5 (both latest).

Any chance to debug this? Thanks