JurajNyiri / HomeAssistant-Tapo-Control

Control for Tapo cameras as a Home Assistant component
Apache License 2.0
1.03k stars 85 forks source link

Battery level won't update (TAPO C420). #376

Closed Pippo1989 closed 12 months ago

Pippo1989 commented 1 year ago

Description

For Tapo C420 cameras, "SENSOR.(NAME)_BATTERY" is stuck at a certain value (always the same) and won't change when the camera is being charged or discharged.

Reproduction Steps

Just monitor the battery level via the TAPO application and compare it to the value of the battery sensor in Home Assistant.

Expected behavior

"SENSOR.(NAME)_BATTERY" should match and update with the actual battery value.

If applicable, add error logs.

No response

Device Firmware

1.2.11 Build 20230726 rel.66682

Using stream component

Yes

Does camera work via official integrations?

Yes

Camera has all attributes filled out in developer tools

Yes

HASS Environment

HASSIO on Raspberry Pi 4

Search for similar issues

Yes

Additional information

I'm running the 5.3.0.beta.2 version of the integration.

JurajNyiri commented 1 year ago

Does the value change on integration reload or HA restart?

JurajNyiri commented 1 year ago

Please enable debug logs.

logger:
  default: critical
  logs:
    custom_components.tapo_control: debug

Wait until you see "Updating entities..." and upload the full log here.

Pippo1989 commented 1 year ago

home-assistant_profiler_2023-08-08T06-36-20.982Z.log

Hi, here you can find the critical logs from restart to boot completed.

In a seemingly inexplicable way, this last reboot was able to update the battery level of my cameras: I'll monitor it to see if the sensor will be kept up to date.

JurajNyiri commented 1 year ago

Please leave it running for a while until message "Updating entities..." shows up. This message is not in the log you sent.

Pippo1989 commented 1 year ago

I let it running for about 30 minutes from restart, but that message hasn't shown up:

home-assistant_profiler_2023-08-08T15-57-38.658Z.log

Should I wait longer?

Anyhow, the weird thing (I guess) is that warning from 17:34:36 ("[custom_components.tapo_control] Debouncer call ignored as shutdown has been requested.").

JurajNyiri commented 1 year ago

Hi, can you try rebooting your machine completely, that error shows that the HA is in incorrect state preparing for shutdown, resulting in some integrations not updating. Please make sure to also update to the latest version https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/releases/tag/5.3.0.beta.2 or https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/releases/tag/5.2.4.

You should see at minimum async_update_data - entry which is executed by the function responsible for updates.

JurajNyiri commented 1 year ago

Any updates?

JurajNyiri commented 12 months ago

Closing due to inactivity.

Pippo1989 commented 12 months ago

Hi, sorry for not replying until now, but I was not able to work on my hardware due to not being at home.

After the update (integration and system) it seems that the battery is detected correctly. However, I will monitor the situation.

Thank you.