Closed Flodapo closed 4 months ago
Hi, set the limit in configuration for maximum hours to sync. Camera does not support multiple downloads at the same time, additionally it always restarts the download if you browse through videos or use the official app at all. Keep it reasonable and let it catch up without browsing etc, once it does in a few hours it should work as expected. You can monitor the download progress via a sensor.
i have set the limit and it does work for a while but at some point it just stops syncing. it sometimes fixes itself when i restart HA but then the synced videos that are over the limit dont get cleaned up. they start to pile up. (please dont mark it as completed because the issue is still there).
Are there any errors in the log when it tries to delete the videos? Do the videos get deleted when HA restarts?
thats my problem, it doesnt delete anything and it seems like it doesnt even try to delete it.
If it does not delete anything, there might be an error in the logs.
Enable debug logs and look for "Initiating media cleanup for entity". It will do it once 1 minute after the start of the HA and then on repeat every 10 minutes.
i get this error in the log when i try to watch a video:
2024-07-16 13:27:26.596 ERROR (MainThread) [custom_components.tapo_control] Already downloading a recording, please try again later.
yes i will do that
Also make sure to use the latest release, https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/releases/tag/5.4.26 . 5.4.13 is more than half a year old.
this is the log when i restarted the integration (the problem ecours also if i reload the integration) some things might be double because i have 2 cameras:
2024-07-16 13:29:14.341 DEBUG (MainThread) [custom_components.tapo_control] mediaSync
2024-07-16 13:29:14.343 DEBUG (MainThread) [custom_components.tapo_control] mediaSync
2024-07-16 13:29:14.344 DEBUG (MainThread) [custom_components.tapo_control] getRecordingsList -1
2024-07-16 13:29:14.350 DEBUG (SyncWorker_62) [custom_components.tapo_control] [pytapo] New request:
2024-07-16 13:29:14.350 DEBUG (SyncWorker_62) [custom_components.tapo_control] [pytapo] {'data': {'method': 'securePassthrough', 'params': {'request': 'm31Kv0ey271w7qZPMBOZ+RZtR3jGVQIZ6mJaohz/+yb6n3y5nt24LFNeWnLbBOo4AN4taIFbJJjMQ3mXtqj16aJE5IRCUi1igPeFQ8ilLsHYiDa7PIfhJvxyYufVEHzi4mXwaa6zmJaLkl/OIZoHDLp6PiKemAg/doqwTdkKodZf3Zqw+gPwTP2e76NN7jjSdrtcVoDqJyD4JhxB81YZipZYi70ZJN6HMXpSt/g23bnraQIGK8enhRYMpkS+E3ZFTxrM3v8SkhuhAclpKOm9/w=='}}, 'headers': {'Host': 'REDACTED', 'Referer': 'REDACTED', 'Accept': 'application/json', 'Accept-Encoding': 'gzip, deflate', 'User-Agent': 'Tapo CameraClient Android', 'Connection': 'close', 'requestByApp': 'true', 'Content-Type': 'application/json; charset=UTF-8', 'Seq': '189', 'Tapo_tag': 'REDACTED'}, 'verify': False}
2024-07-16 13:29:14.909 DEBUG (SyncWorker_62) [custom_components.tapo_control] [pytapo] 200
2024-07-16 13:29:14.910 DEBUG (SyncWorker_62) [custom_components.tapo_control] [pytapo] {'error_code': 0, 'seq': 189, 'result': {'response': 'PNqJZWB6COcV9wMgCDRKArYXX92/s2hUQfM9Hj0NL3VNuGO3EGkI2GOg3XAG5fRbZkiQRNUDfJJ4tBbtsfVo+9L3TfuDORZYzmAlTwisIr9q6FKLbq/k4kedd32x8R+taUfd4jNw4fqVCqXHQ7Qk8dQfzQ+KA2sGTvmcCISnniZNBnjuSlxuf6oDZN8xee5vY9wYo5x2iH1ZRn04MJpYC+4XfNixoG1wfxSoc8y9lHWwwYrkzcXpXoqVJ0CtYofVqURxQ8lpU8iIVBceFARHrg=='}}
2024-07-16 13:29:14.912 DEBUG (MainThread) [custom_components.tapo_control] getRecordingsList -2
2024-07-16 13:29:14.912 DEBUG (MainThread) [custom_components.tapo_control] getRecordings -1
2024-07-16 13:29:14.913 DEBUG (MainThread) [custom_components.tapo_control] Getting recordings for date 20240716...
2024-07-16 13:29:14.916 DEBUG (SyncWorker_56) [custom_components.tapo_control] [pytapo] New request:
2024-07-16 13:29:15.055 DEBUG (SyncWorker_56) [custom_components.tapo_control] [pytapo] 200
2024-07-16 13:29:15.057 DEBUG (MainThread) [custom_components.tapo_control] getRecordings -2
2024-07-16 13:29:15.057 DEBUG (MainThread) [custom_components.tapo_control] getRecording -1
2024-07-16 13:29:15.058 DEBUG (MainThread) [custom_components.tapo_control] getRecording -2
2024-07-16 13:29:15.058 DEBUG (MainThread) [custom_components.tapo_control] getRecording -1
2024-07-16 13:29:15.065 DEBUG (MainThread) [custom_components.tapo_control] getRecording -2
2024-07-16 13:29:15.066 DEBUG (MainThread) [custom_components.tapo_control] getRecording -1
2024-07-16 13:29:15.072 DEBUG (MainThread) [custom_components.tapo_control] getRecording -2
2024-07-16 13:29:15.072 DEBUG (MainThread) [custom_components.tapo_control] getRecording -1
2024-07-16 13:29:15.082 DEBUG (MainThread) [custom_components.tapo_control] async_update_data - entry
2024-07-16 13:29:15.082 DEBUG (MainThread) [custom_components.tapo_control] Motion sensor or time sync is enabled.
2024-07-16 13:29:15.082 DEBUG (MainThread) [custom_components.tapo_control] Motion sensor: OK
2024-07-16 13:29:15.082 DEBUG (MainThread) [custom_components.tapo_control] async_update_data - before someEntityEnabled check
2024-07-16 13:29:15.082 DEBUG (MainThread) [custom_components.tapo_control]
yes, i know that my version isnt the newest. i wasnt updating because of this issue. if i reboot now i need to get the sd card out of the rpi4 and open the sd in linux to delete the files manuelly
As I said, upgrade to the latest version. Also as described, the sync occurs after around 1 minute of running and then every 10 minutes. Posting logs just after the start has no value. Keep it running for at least 20 minutes then zip the logs and attach them here, do not post directly as a message.
ok, how do i get the log as a zip?
do i get them if i disable the debug logs for the integration?
Just zip the log file. Keep debug logs enabled.
where is the log file?
https://community.home-assistant.io/t/where-does-home-assistant-wirte-the-logs/5989
Please search before asking common basic questions to save us both time.
home-assistant_tapo_control_2024-07-16T11-59-52.398Z.log also got this file
It's removing the files.
2024-07-16 13:29:57.889 DEBUG (MainThread) [custom_components.tapo_control] Initiating media cleanup for entity 292c435eadc443d80599ca38a716d890...
2024-07-16 13:29:57.890 DEBUG (MainThread) [custom_components.tapo_control] Removing cache files from old HA instances for entity 292c435eadc443d80599ca38a716d890...
2024-07-16 13:29:57.921 DEBUG (MainThread) [custom_components.tapo_control] [deleteFilesNoLongerPresentInCamera] Removing /config/.storage/tapo_control/292c435eadc443d80599ca38a716d890//videos/1721062586-1721062670.mp4 (1721062586-1721062670)...
Check if this file is still there or is removed.
There are no log entries for "deleteColdFilesOlderThanMaxSyncTime", set the limit to 1 hour, restart, and keep it running for around 3, then report back with logs.
where is the setting?
Number of hours to keep synchronized.
yeah i got that set like this for about 5 Month and the issue was there the entire time
files are still there and i still dont know where to set deleteColdFilesOlderThanMaxSyncTime
That would be inside the logs, don't worry about that.
/config/.storage/tapo_control/292c435eadc443d80599ca38a716d890//videos/1721062586-1721062670.mp4 Can you confirm this exact file is still present as per right now?
please wait, i need to take out the sd card again
You can just use Terminal & SSH addon for example to easily access the file system.
thought so too but i cant get there (most likely to be because root)
What enironment are you running HA on? If you cannot get there and that exact file is there, filesystem permissions might be messed up and you will need to fix that.
didnt you look at my inital post? why dont you read it first and save us some time? :)
I tried to patiently help you with your environment issues, even repeated myself multiple times when you ignored my questions and provided misleading information as a feedback, I am not going to do that anymore. Locking.
Description
If I restart HA or the Integration the Videos stay and just pile up. And it often just breaks (meaning that it won't sync right with the cameras and just says please wait download another recording and it is not showing any thumbnails).
Reproduction Steps
Expected behavior
If applicable, add error logs.
Still downloading another recording
Device Firmware
Irrelevant (and unknown)
Integration Version
5.4.13
Using stream component
Yes
Does camera work via official integrations?
Yes
Camera has all attributes filled out in developer tools
Yes
HASS Environment
Raspberry Pi 4 (HA OS)
Search for similar issues
Yes
Additional information
No response