alryaz / hass-pik-intercom

ПИК Домофон для Home Assistant
47 stars 12 forks source link

Сamera are unavailable a few hours after component reboot #2

Closed sinijvas closed 2 years ago

sinijvas commented 2 years ago

Most likely the links to the cameras are limited in time. (1-2-3 hours)

alryaz commented 2 years ago

There's a check embedded for that (it spams warnings regarding unavailability for 50 times or so). After that the component attempts to refresh data about cameras to retrieve the most recent URLs.

That is true, however, only for camera snapshots (or whenever you look at the camera through Home Assistant interface).

May I ask you to enable debug logging level for the component, and submit logs with everything containing custom_components.pik_intercom?

It can be done the following way:

# configuration.yaml
logger:
  default: warning
  logs:
    custom_components.pik_intercom: debug

After your camera loses image next time, please, extract your logs (via SSH: cat /config/home-assistant.log | grep custom_components.pik_intercom | tee /config/pik_intercom.log; log file will be in your HA configuration directory named pik_intercom.log), clean them from any personal information, and submit them here?

sinijvas commented 2 years ago

I did not see anything unusual in the logs, but there is one feature for displaying the camera, I use the https://github.com/AlexxIT/WebRTC custom component, maybe there is some peculiarity in this?

I myself, before your component, requested the url of the camera once an hour using the command_line sensor, this method works stably.

2021-09-22 14:36:11 DEBUG (MainThread) [custom_components.pik_intercom.api] [26] Call sessions fetching successful
2021-09-22 14:36:11 DEBUG (MainThread) [custom_components.pik_intercom.api] [26] Stopped due to list truncation
2021-09-22 14:41:11 DEBUG (MainThread) [custom_components.pik_intercom.api] [27] Performing property intercoms fetching with username "...101", url: https://intercom.pik-comfort.ru/api/call_sessions
2021-09-22 14:41:15 DEBUG (MainThread) [custom_components.pik_intercom.api] [27] Call sessions fetching successful
2021-09-22 14:41:15 DEBUG (MainThread) [custom_components.pik_intercom.api] [27] Stopped due to list truncation
2021-09-22 14:46:11 DEBUG (MainThread) [custom_components.pik_intercom.api] [28] Performing property intercoms fetching with username "...101", url: https://intercom.pik-comfort.ru/api/call_sessions
2021-09-22 14:46:16 DEBUG (MainThread) [custom_components.pik_intercom.api] [28] Call sessions fetching successful
2021-09-22 14:46:16 DEBUG (MainThread) [custom_components.pik_intercom.api] [28] Stopped due to list truncation
2021-09-22 14:51:11 DEBUG (MainThread) [custom_components.pik_intercom.api] [29] Performing property intercoms fetching with username "...101", url: https://intercom.pik-comfort.ru/api/call_sessions
2021-09-22 14:51:12 DEBUG (MainThread) [custom_components.pik_intercom.api] [29] Call sessions fetching successful
2021-09-22 14:51:12 DEBUG (MainThread) [custom_components.pik_intercom.api] [29] Stopped due to list truncation
2021-09-22 14:56:11 DEBUG (MainThread) [custom_components.pik_intercom.api] [30] Performing property intercoms fetching with username "...101", url: https://intercom.pik-comfort.ru/api/call_sessions
2021-09-22 14:56:11 DEBUG (MainThread) [custom_components.pik_intercom.api] [30] Call sessions fetching successful
2021-09-22 14:56:11 DEBUG (MainThread) [custom_components.pik_intercom.api] [30] Stopped due to list truncation
2021-09-22 15:01:11 DEBUG (MainThread) [custom_components.pik_intercom.api] [31] Performing property intercoms fetching with username "...101", url: https://intercom.pik-comfort.ru/api/call_sessions
2021-09-22 15:01:11 DEBUG (MainThread) [custom_components.pik_intercom.api] [31] Call sessions fetching successful
2021-09-22 15:01:11 DEBUG (MainThread) [custom_components.pik_intercom.api] [31] Stopped due to list truncation
alryaz commented 2 years ago

I found the culprit (camera attributes were not updated).

Could you, please, contact me directly over Telegram for testing purposes? (@alryaz, https://tg.me/alryaz)

alryaz commented 2 years ago

Release v0.1.0 adds support for update intervals configuration, and employs a more robust updates mechanism. I tested it with WebRTC component, and it appears to be working fine for an hour or so (haven't had an opportunity to test further).

@sinijvas please, check whether the new release solves the issue.

sinijvas commented 2 years ago

thanks 72 hours work stably close it