JurajNyiri / HomeAssistant-Tapo-Control

Control for Tapo cameras as a Home Assistant component
Apache License 2.0
953 stars 80 forks source link

Battery sensor unavailable (Tapo C420) #505

Closed Pippo1989 closed 1 month ago

Pippo1989 commented 5 months ago

Description

Hi,

since the last update, the battery sensor and several other memory-related sensors have become consistently unavailable (see attached image).

The problem occurs on Tapo c420 cameras.

Reproduction Steps

/

Expected behavior

The sensors described above should be available.

If applicable, add error logs.

home-assistant_tapo_control_2024-01-23T12-35-21.657Z.log

Unavailable entities -21.657Z.log)

Device Firmware

1.2.15 Build 20231013 rel.73743

Integration Version

5.4.14

Using stream component

Yes

Does camera work via official integrations?

Yes

Camera has all attributes filled out in developer tools

No

HASS Environment

HASSIO on Raspberry Pi 4

Search for similar issues

Yes

Additional information

No response

JurajNyiri commented 5 months ago

Please fix the link to logs. Also try migrating back to previous version to confirm the issue is caused by the update.

Pippo1989 commented 5 months ago

Please fix the link to logs. Also try migrating back to previous version to confirm the issue is caused by the update.

Done! But...

Something unexpected happened with the previous version (5.4.13): the battery level sensor disappeared... it doesn't even appear among the hidden entities.

Exelord commented 4 months ago

Can confirm the issue

JurajNyiri commented 4 months ago

I checked the logs for SD card as well as tapoBatterySensor entities, and they are added properly according to logs. So there must be some other error going on which I can't really tell from the logs.

Does this happen consistently - it never comes up?

Pippo1989 commented 3 months ago

Hi,

yes, I can confirm that the battery sensor is completely absent and does not appear among the camera entities.

perdimia commented 3 months ago

I have lost the battery sensor on my doorbell

vargabp commented 2 months ago

Had came to terms with it thinking a feature was removed, until stumbling across this. Having the same issue. It used to work, but can't tell when it stopped (have been using the entity in a dashboard monitoring battery levels for all devices).

Edit: Enabled debug logs and found that the battery levels were acknowledged on a restart of HA:

2024-04-14 10:28:02.650 DEBUG (MainThread) [custom_components.tapo_control] {'getDetectionConfig': False, 'getBarkDetectionConfig': False, 'getPersonDetectionConfig': False, 'getBCDConfig': False, 'getVehicleDetectionConfig': False, 'getMeowDetectionConfig': False, 'getGlassDetectionConfig': False, 'getPetDetectionConfig': False, 'getDeviceInfo': {'device_info': {'basic_info': {'device_type': 'SMART.TAPOHUB', 'device_model': 'H200', 'device_name': 'H200 1.0', 'device_info': 'H200 1.0', 'hw_version': '1.0', 'sw_version': '1.3.0 Build 20240221 rel.53262', 'device_alias': 'Tapo Hub', 'mac': '48-22-54-xx-xx-xx', 'dev_id': '802DB656E3CD67C517D9F02F2E54B802210B8585', 'oem_id': '20BDFF5DD35D9F82C31FC30217AA348D', 'hw_id': '99A36151C79A3A5D72823C98BC0FDA5F', 'status': 'configured', 'bind_status': True, 'child_num': 2, 'avatar': 'hub_h200', 'latitude': xxx, 'longitude': xxx, 'has_set_location_info': 1, 'need_sync_sha1_password': 0, 'product_name': 'Tapo Smart Hub', 'region': 'EU'}, 'info': {'device_type': 'SMART.TAPOHUB', 'device_model': 'H200', 'device_name': 'H200 1.0', 'device_info': 'H200 1.0', 'hw_version': '1.0', 'sw_version': '1.3.0 Build 20240221 rel.53262', 'device_alias': 'Tapo Hub', 'mac': '48-22-54-xx-xx-xx', 'dev_id': '802DB656E3CD67C517D9F02F2E54B802210B8585', 'oem_id': '20BDFF5DD35D9F82C31FC30217AA348D', 'hw_id': '99A36151C79A3A5D72823C98BC0FDA5F', 'status': 'configured', 'bind_status': True, 'child_num': 2, 'avatar': 'hub_h200', 'latitude': xxx, 'longitude': xxx, 'has_set_location_info': 1, 'need_sync_sha1_password': 0, 'product_name': 'Tapo Smart Hub', 'region': 'EU'}}}, 'getTamperDetectionConfig': False, 'getLensMaskConfig': False, 'getLdc': False, 'getLastAlarmInfo': False, 'getLedStatus': {'led': {'config': {'.name': 'config', '.type': 'led', 'enabled': 'on'}}}, 'getTargetTrackConfig': False, 'getPresetConfig': False, 'getFirmwareUpdateStatus': {'cloud_config': {'upgrade_status': {'state': 'normal', 'lastUpgradingSuccess': True}}}, 'getMediaEncrypt': {'cet': {'media_encrypt': {'enabled': 'on'}}}, 'getConnectionType': {'link_type': 'ethernet'}, 'getAlarmConfig': False, 'getAlarmPlan': False, 'getSirenTypeList': False, 'getLightTypeList': False, 'getSirenStatus': False, 'getLightFrequencyInfo': False, 'getLightFrequencyCapability': False, 'getRotationStatus': False, 'getNightVisionModeConfig': False, 'getWhitelampStatus': False, 'getWhitelampConfig': False, 'getMsgPushConfig': False, 'getSdCardStatus': {'harddisk_manage': {'hd_info': [{'hd_info_1': {'disk_name': '1', 'loop_record_status': '1', 'rw_attr': 'rw', 'total_space': '238.23 GB', 'write_protect': '0', 'type': 'local', 'status': 'normal', 'detect_status': 'normal', 'percent': '100', 'free_space': '192.46 GB', 'video_total_space': '226.32 GB', 'video_free_space': '180.55 GB'}}]}}, 'getCircularRecordingConfig': {'harddisk_manage': {'harddisk': {'loop': 'on'}}}, 'getRecordPlan': False, 'getFirmwareAutoUpgradeConfig': {'auto_upgrade': {'common': {'enabled': 'on', 'time': '03:00', 'random_range': 30}}}, 'getChildDeviceList': {'start_index': 0, 'child_device_list': [{'device_id': '80211B33D91C32B94E4DC5EC945112A72112F800', 'parent_device_id': '802DB656E3CD67C517D9F02F2E54B802210B8585', 'devicemodel': 'C420', **'device_name': 'C420 1.0', 'alias': 'Front Door', 'avatar': 'Outdoor', 'sw_ver': '1.2.17 Build 20240305 rel.75572', 'hw_ver': '1.0', 'mac': '48:22:54:xx:xx:xx', 'device_type': 'SMART.IPCAMERA', 'category': 'camera', 'hw_id': 'C5B155806880C301179651EA0F9ECF88', 'oem_id': 'FC5FF5303F725AF5CDE2115728A0AA86', 'system_time': 1713086882, 'led_status': 'off', 'updating': False, 'online': True, 'firmware_status': 'OK', 'power': 'BATTERY', 'batterypercent': 73**, 'battery_charging': 'NO', 'rssi': -37, 'dev_name': 'Tapo Smart Camera', 'ipaddr': '172.23.30.2', 'short_addr': 0, 'ext_addr': '482254E494A90000', 'status': 'configured', 'onboarding_timestamp': 1689085477, 'battery_voltage': 3859, 'battery_temperature': 21, 'battery_installed': 1, 'low_battery': False, 'power_save_mode': 'auto', 'power_save_status': 'off', 'uptime': 751607, 'cam_uptime': 9036, 'subg_cam_rssi': 0, 'subg_hub_rssi': 0, 'region': 'EU'}, {'device_id': '8021238C9825BAF2D22F30540ABACD0F21137227', 'parent_device_id': '802DB656E3CD67C517D9F02F2E54B802210B8585', 'device_model': 'C420', 'device_name': 'C420 1.0', 'alias': 'Garden', 'avatar': 'Balcony', 'sw_ver': '1.2.17 Build 20240305 rel.75572', 'hw_ver': '1.0', 'mac': '48:22:54:xx:xx:xx', 'device_type': 'SMART.IPCAMERA', 'category': 'camera', 'hw_id': 'C5B155806880C301179651EA0F9ECF88', 'oem_id': 'FC5FF5303F725AF5CDE2115728A0AA86', 'system_time': 1713086882, 'led_status': 'off', 'updating': False, 'online': True, 'firmware_status': 'OK', 'power': 'BATTERY', 'battery_percent': 84, 'battery_charging': 'NO', 'rssi': -59, 'dev_name': 'Tapo Smart Camera', 'ipaddr': '172.23.30.3', 'short_addr': 0, 'ext_addr': '482254E48B210000', 'status': 'configured', 'onboarding_timestamp': 1689087575, 'battery_voltage': 3963, 'battery_temperature': 9, 'battery_installed': 1, 'low_battery': False, 'power_save_mode': 'off', 'power_save_status': 'off', 'uptime': 1381861, 'cam_uptime': 13329, 'subg_cam_rssi': 0, 'subg_hub_rssi': 0, 'region': 'EU'}], 'sum': 2}, 'getAudioConfig': False}

Waiting for entity updates, but could only see my standalone cameras updating in the logs (C200 and C310), not the two C420 which are linked to the H200 hub.

Edit 2: masked second halves of MAC addresses, and removed latitude/longitude values

JurajNyiri commented 1 month ago

Fixed in https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/releases/tag/5.4.18.