Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tapo Integration dosnt clean after itself if restarted and breaks often #624

Closed
Flodapo opened this issue Jul 16, 2024 · 33 comments
Closed

Comments

@Flodapo
Copy link

Flodapo commented Jul 16, 2024

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

  1. Trying to watch recordings (broken)
  2. Restarting HA or Integration
  3. Now it works again (for some time) but the Storage space is getting fuller every time I restart the Integration or HA

Expected behavior

  1. I want it not to break in the first place
  2. If I restart HA or the Integration I want it to clear unwanted files from the folder (that I can't reach from within HA)

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

@JurajNyiri
Copy link
Owner

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.

@Flodapo
Copy link
Author

Flodapo commented Jul 16, 2024

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).

@JurajNyiri JurajNyiri reopened this Jul 16, 2024
@JurajNyiri
Copy link
Owner

Are there any errors in the log when it tries to delete the videos?
Do the videos get deleted when HA restarts?

@Flodapo
Copy link
Author

Flodapo commented Jul 16, 2024

thats my problem, it doesnt delete anything and it seems like it doesnt even try to delete it.

@JurajNyiri
Copy link
Owner

JurajNyiri commented Jul 16, 2024

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.

@Flodapo
Copy link
Author

Flodapo commented Jul 16, 2024

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.

@Flodapo
Copy link
Author

Flodapo commented Jul 16, 2024

yes i will do that

@JurajNyiri
Copy link
Owner

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.

@Flodapo

This comment was marked as off-topic.

@Flodapo
Copy link
Author

Flodapo commented Jul 16, 2024

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

@JurajNyiri
Copy link
Owner

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.

@Flodapo
Copy link
Author

Flodapo commented Jul 16, 2024

ok, how do i get the log as a zip?

@Flodapo
Copy link
Author

Flodapo commented Jul 16, 2024

do i get them if i disable the debug logs for the integration?

@JurajNyiri
Copy link
Owner

Just zip the log file. Keep debug logs enabled.

@Flodapo
Copy link
Author

Flodapo commented Jul 16, 2024

where is the log file?

@JurajNyiri
Copy link
Owner

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.

@Flodapo
Copy link
Author

Flodapo commented Jul 16, 2024

home-assistant-log.zip

@Flodapo
Copy link
Author

Flodapo commented Jul 16, 2024

@JurajNyiri
Copy link
Owner

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)...

@JurajNyiri
Copy link
Owner

Check if this file is still there or is removed.

@JurajNyiri
Copy link
Owner

JurajNyiri commented Jul 16, 2024

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.

@Flodapo
Copy link
Author

Flodapo commented Jul 16, 2024

image
where is the setting?

@JurajNyiri
Copy link
Owner

Number of hours to keep synchronized.

@Flodapo
Copy link
Author

Flodapo commented Jul 16, 2024

yeah i got that set like this for about 5 Month and the issue was there the entire time

@JurajNyiri
Copy link
Owner

Please follow my instructions above. 1, 2.

@Flodapo
Copy link
Author

Flodapo commented Jul 16, 2024

files are still there and i still dont know where to set deleteColdFilesOlderThanMaxSyncTime

@JurajNyiri
Copy link
Owner

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?

@Flodapo
Copy link
Author

Flodapo commented Jul 16, 2024

please wait, i need to take out the sd card again

@JurajNyiri
Copy link
Owner

JurajNyiri commented Jul 16, 2024

You can just use Terminal & SSH addon for example to easily access the file system.

@Flodapo
Copy link
Author

Flodapo commented Jul 16, 2024

thought so too but i cant get there (most likely to be because root)

@JurajNyiri
Copy link
Owner

JurajNyiri commented Jul 16, 2024

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.

@Flodapo
Copy link
Author

Flodapo commented Jul 16, 2024

didnt you look at my inital post? why dont you read it first and save us some time? :)

@JurajNyiri
Copy link
Owner

JurajNyiri commented Jul 16, 2024

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.

Repository owner locked as too heated and limited conversation to collaborators Jul 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants