hass-aarlo icon indicating copy to clipboard operation
hass-aarlo copied to clipboard

Event loop closed by server and some sensors stops updating

Open JOR200 opened this issue 7 months ago • 6 comments

I have had issues the last months with captured today stops updating and I'm wondering if this could be solved by changing my config?

My Aarlo version: 0.8.1.18.

I have the following in my Configuration.yaml:

# Arlo Addon
aarlo:
  host: https://my.arlo.com
  username: !secret aarlo_username
  password: !secret aarlo_password
  refresh_devices_every: 2
  stream_timeout: 120
  reconnect_every: 90
  tfa_source: imap
  tfa_type: email
  tfa_host: imap.gmail.com
  tfa_username: !secret aarlo_tfa_username
  tfa_password: !secret aarlo_tfa_password

I have deleted my Aarlo.yaml.

I get some Aarlo related errors in my logs:

2025-04-25 20:03:54.931 WARNING (ImportExecutor_0) [homeassistant.components.light] ATTR_COLOR_TEMP was used from aarlo, this is a deprecated constant which will be removed in HA Core 2026.1. Use kelvin equivalent (ATTR_COLOR_TEMP_KELVIN) instead, please report it to the author of the 'aarlo' custom integration 2025-04-25 20:03:54.935 WARNING (ImportExecutor_0) [homeassistant.components.light] ATTR_COLOR_TEMP was used from aarlo, this is a deprecated constant which will be removed in HA Core 2026.1. Use kelvin equivalent (ATTR_COLOR_TEMP_KELVIN) instead, please report it to the author of the 'aarlo' custom integration

2025-04-25 20:10:10.626 ERROR (Recorder) [homeassistant] Error doing job: Task exception was never retrieved (None) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/discovery_flow.py", line 137, in async_start await gather_with_limited_concurrency(FLOW_INIT_LIMIT, *init_coros) File "/usr/src/homeassistant/homeassistant/util/async.py", line 114, in gather_with_limited_concurrency return await gather( ^^^^^^^^^^^^^ ...<2 lines>... ) ^ File "/usr/src/homeassistant/homeassistant/util/async_.py", line 112, in sem_task return await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1455, in async_init flow, result = await self._async_init(flow_id, handler, context, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1490, in _async_init result = await self._async_handle_step(flow, flow.init_step, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 501, in _async_handle_step if result.get("preview") is not None: ^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'get' 2025-04-25 20:38:26.263 WARNING (SyncWorker_0) [root] Waiting for authorization... 2025-04-25 21:56:00.846 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140610991758144] Unexpected exception Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...<7 lines>... ) ^ File "/usr/src/homeassistant/homeassistant/core.py", line 2794, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2837, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/homeassistant/init.py", line 151, in async_handle_turn_service await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/core.py", line 2794, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2837, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1007, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ hass, entity, func, data, call.context ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1079, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1711, in async_turn_off await self.hass.async_add_executor_job(ft.partial(self.turn_off, **kwargs)) File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run result = self.fn(*self.args, **self.kwargs) File "/usr/src/homeassistant/homeassistant/components/tuya/switch.py", line 798, in turn_off self._send_command([{"code": self.entity_description.key, "value": False}]) ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/tuya/entity.py", line 298, in _send_command self.device_manager.send_commands(self.device.id, commands) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/tuya_sharing/manager.py", line 93, in send_commands return self.device_repository.send_commands(device_id, commands) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/tuya_sharing/device.py", line 180, in send_commands self.api.post(f"/v1.1/m/thing/{device_id}/commands", None, {"commands": commands}) ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/tuya_sharing/customerapi.py", line 192, in post return self.__request("POST", path, params, body) ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/tuya_sharing/customerapi.py", line 121, in __request raise Exception(f"network error:({ret['code']}) {ret['msg']}") Exception: network error:(-9999999) sign invalid 2025-04-25 22:07:52.871 WARNING (ArloEventStream) [pyaarlo] event loop closed by server 2025-04-25 23:56:00.404 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140610991758144] Unexpected exception Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...<7 lines>... ) ^ File "/usr/src/homeassistant/homeassistant/core.py", line 2794, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2837, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/homeassistant/init.py", line 151, in async_handle_turn_service await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/core.py", line 2794, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2837, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1007, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ hass, entity, func, data, call.context ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1079, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1711, in async_turn_off await self.hass.async_add_executor_job(ft.partial(self.turn_off, **kwargs)) File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run result = self.fn(*self.args, **self.kwargs) File "/usr/src/homeassistant/homeassistant/components/tuya/switch.py", line 798, in turn_off self._send_command([{"code": self.entity_description.key, "value": False}]) ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/tuya/entity.py", line 298, in _send_command self.device_manager.send_commands(self.device.id, commands) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/tuya_sharing/manager.py", line 93, in send_commands return self.device_repository.send_commands(device_id, commands) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/tuya_sharing/device.py", line 180, in send_commands self.api.post(f"/v1.1/m/thing/{device_id}/commands", None, {"commands": commands}) ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/tuya_sharing/customerapi.py", line 192, in post return self.__request("POST", path, params, body) ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/tuya_sharing/customerapi.py", line 121, in __request raise Exception(f"network error:({ret['code']}) {ret['msg']}") Exception: network error:(-9999999) sign invalid 2025-04-26 00:11:22.515 WARNING (ArloEventStream) [pyaarlo] event loop closed by server 2025-04-26 01:56:00.358 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140610991758144] Unexpected exception Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...<7 lines>... ) ^ File "/usr/src/homeassistant/homeassistant/core.py", line 2794, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2837, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/homeassistant/init.py", line 151, in async_handle_turn_service await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/core.py", line 2794, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2837, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1007, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ hass, entity, func, data, call.context ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1079, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1711, in async_turn_off await self.hass.async_add_executor_job(ft.partial(self.turn_off, **kwargs)) File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run result = self.fn(*self.args, **self.kwargs) File "/usr/src/homeassistant/homeassistant/components/tuya/switch.py", line 798, in turn_off self._send_command([{"code": self.entity_description.key, "value": False}]) ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/tuya/entity.py", line 298, in _send_command self.device_manager.send_commands(self.device.id, commands) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/tuya_sharing/manager.py", line 93, in send_commands return self.device_repository.send_commands(device_id, commands) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/tuya_sharing/device.py", line 180, in send_commands self.api.post(f"/v1.1/m/thing/{device_id}/commands", None, {"commands": commands}) ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/tuya_sharing/customerapi.py", line 192, in post return self.__request("POST", path, params, body) ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/tuya_sharing/customerapi.py", line 121, in __request raise Exception(f"network error:({ret['code']}) {ret['msg']}") Exception: network error:(-9999999) sign invalid 2025-04-26 02:13:53.171 ERROR (ArloBackgroundWorker) [pyaarlo] failed to read modes (v2) 2025-04-26 02:13:53.242 ERROR (ArloBackgroundWorker) [pyaarlo] failed to read modes (v2) 2025-04-26 02:13:53.314 ERROR (ArloBackgroundWorker) [pyaarlo] failed to read modes (v2) 2025-04-26 02:14:50.843 WARNING (ArloEventStream) [pyaarlo] event loop closed by server

2025-04-26 04:19:27.575 WARNING (ArloEventStream) [pyaarlo] event loop closed by server 2025-04-26 06:22:55.070 WARNING (ArloEventStream) [pyaarlo] event loop closed by server 2025-04-26 08:23:53.270 ERROR (ArloBackgroundWorker) [pyaarlo] failed to read modes (v2) 2025-04-26 08:23:53.348 ERROR (ArloBackgroundWorker) [pyaarlo] failed to read modes (v2) 2025-04-26 08:24:20.301 WARNING (ArloEventStream) [pyaarlo] event loop closed by server

2025-04-26 10:27:49.621 WARNING (ArloEventStream) [pyaarlo] event loop closed by server 2025-04-26 12:30:32.764 WARNING (ArloEventStream) [pyaarlo] event loop closed by server 2025-04-26 14:33:53.107 ERROR (ArloBackgroundWorker) [pyaarlo] failed to read modes (v2) 2025-04-26 14:33:53.200 ERROR (ArloBackgroundWorker) [pyaarlo] failed to read modes (v2) 2025-04-26 14:33:53.293 ERROR (ArloBackgroundWorker) [pyaarlo] failed to read modes (v2) 2025-04-26 14:33:53.382 ERROR (ArloBackgroundWorker) [pyaarlo] failed to read modes (v2) 2025-04-26 14:34:35.396 WARNING (ArloEventStream) [pyaarlo] event loop closed by server 2025-04-26 15:34:18.535 WARNING (SyncWorker_0) [root] Waiting for authorization... 2025-04-26 16:43:53.065 ERROR (ArloBackgroundWorker) [pyaarlo] failed to read modes (v2) 2025-04-26 16:43:53.158 ERROR (ArloBackgroundWorker) [pyaarlo] failed to read modes (v2) 2025-04-26 16:43:53.251 ERROR (ArloBackgroundWorker) [pyaarlo] failed to read modes (v2) 2025-04-26 16:43:53.347 ERROR (ArloBackgroundWorker) [pyaarlo] failed to read modes (v2) 2025-04-26 16:45:04.067 ERROR (ArloBackgroundWorker) [pyaarlo] job-error=TypeError Traceback (most recent call last): File "/usr/local/lib/python3.13/site-packages/pyaarlo/background.py", line 35, in _run_next job"callback" ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/pyaarlo/media.py", line 193, in update for video in data: ^^^^ TypeError: 'NoneType' object is not iterable

2025-04-26 16:47:05.248 WARNING (ArloEventStream) [pyaarlo] event loop closed by server 2025-04-26 18:53:53.076 ERROR (ArloBackgroundWorker) [pyaarlo] failed to read modes (v2) 2025-04-26 18:53:53.179 ERROR (ArloBackgroundWorker) [pyaarlo] failed to read modes (v2) 2025-04-26 18:53:53.294 ERROR (ArloBackgroundWorker) [pyaarlo] failed to read modes (v2) 2025-04-26 18:53:53.391 ERROR (ArloBackgroundWorker) [pyaarlo] failed to read modes (v2) 2025-04-26 18:54:27.980 WARNING (ArloEventStream) [pyaarlo] event loop closed by server 2025-04-26 20:58:08.706 WARNING (ArloEventStream) [pyaarlo] event loop closed by server 2025-04-26 23:01:41.833 WARNING (ArloEventStream) [pyaarlo] event loop closed by server 2025-04-27 01:03:53.197 ERROR (ArloBackgroundWorker) [pyaarlo] failed to read modes (v2) 2025-04-27 01:03:53.285 ERROR (ArloBackgroundWorker) [pyaarlo] failed to read modes (v2) 2025-04-27 01:03:53.366 ERROR (ArloBackgroundWorker) [pyaarlo] failed to read modes (v2) 2025-04-27 01:05:11.485 WARNING (ArloEventStream) [pyaarlo] event loop closed by server

Any idea of what is going on and how to solve this?

Rgds.

JOR200 avatar Apr 28 '25 18:04 JOR200

configuration.yaml isn't used any more. Do you have a file called aarlo.yaml file in the same directory?

twrecked avatar Apr 30 '25 10:04 twrecked

Hi, Thanks for quick response. I deleted the aarlo stuff in confiuration.yaml yesterday and restarted HA. I also renamed my aarlo.yaml some weeks ago to aarlo_old.yaml like this:

Image

For the moment I just have a plain config without aarlo.yaml.

I still have the same arlo messages in my logs and captured today stops updating after a few hours.

Here's what I had i my aarlo.yaml before:

version: 1
aarlo:
  host: https://my.arlo.com
  reconnect_every: 90
  user_agent: linux
  #backend: sse

Please advice. Rgds.

JOR200 avatar Apr 30 '25 10:04 JOR200

use the aarlo.yaml file but remove the host line.

twrecked avatar Apr 30 '25 11:04 twrecked

Thanks. I will test that later on today.

Rgds.

JOR200 avatar Apr 30 '25 11:04 JOR200

Hi. The integration has now run smootly for more than 24 hours. Captured today keeps updating and the only Arlo related messages in my logs are these:

2025-05-01 04:17:32.944 WARNING (ArloEventStream) [pyaarlo] request-error=ConnectionError 2025-05-01 04:56:39.957 WARNING (ArloEventStream) [pyaarlo] request-error=ConnectionError

Removing the host line in aarlo.yaml was the solution.

I will monitor the behaviour through the weekend and close the issue if nothing more shows up.

Thanks.

JOR200 avatar May 01 '25 15:05 JOR200

Hi. The integration has been running without issues until I got the following in my logs yesterday:

2025-05-04 16:24:25.298 ERROR (ArloBackgroundWorker) [pyaarlo] job-error=TypeError Traceback (most recent call last): File "/usr/local/lib/python3.13/site-packages/pyaarlo/background.py", line 35, in _run_next job"callback" ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/pyaarlo/media.py", line 193, in update for video in data: ^^^^ TypeError: 'NoneType' object is not iterable

After that the captured today stopped updating for all my cameras. Looks like most other entities are still updating.

I have 4 cameras. Is there any tuning that is recomended for this issue?

Rgds.

JOR200 avatar May 05 '25 16:05 JOR200