home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.75k stars 30.86k forks source link

Risco Local Integration Problem #130660

Open 03397 opened 3 days ago

03397 commented 3 days ago

The problem

Every time I restart my Home Assistant my Risco Local Integration takes between 3-30min to load correctly(Panel Agility 4 with multisocket network card). It fails and then restarts again, This is happening for some time now with no apparent error message. However, I have managed to capture this error message. Keep in mind that I played around with Maximum Concurrent Connection with no difference

2024-11-14 23:22:32.214 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry MyHome Alarm for risco Traceback (most recent call last): File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for return await fut ^^^^^^^^^ asyncio.exceptions.CancelledError The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_socket.py", line 111, in send_command return await asyncio.wait_for(future, 10) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 519, in wait_for async with timeouts.timeout(timeout): File "/usr/local/lib/python3.12/asyncio/timeouts.py", line 115, in aexit raise TimeoutError from exc_val 
TimeoutError During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_socket.py", line 39, in connect panel_id = int(await self.send_result_command('RID'), 16) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_socket.py", line 101, in send_result_command command = await self.send_command(command) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_socket.py", line 113, in send_command raise OperationError(f'Timeout in command: {command}') pyrisco.common.OperationError: Timeout in command: RID During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 635, in __async_setup_with_context result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/risco/init.py", line 71, in async_setup_entry return await _async_setup_local_entry(hass, entry) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/risco/init.py", line 84, in _async_setup_local_entry await risco.connect() File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_local.py", line 30, in connect await self._rs.connect() File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_socket.py", line 49, in connect await self._close() File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_socket.py", line 151, in _close await asyncio.sleep(5) File "/usr/local/lib/python3.12/asyncio/tasks.py", line 665, in sleep return await future

What version of Home Assistant Core has the issue?

2024.11.1

What was the last working version of Home Assistant Core?

It never worked

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Risco

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 2 days ago

Hey there @onfreund, mind taking a look at this issue as it has been labeled with an integration (risco) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `risco` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign risco` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


risco documentation risco source (message by IssueLinks)

OnFreund commented 11 hours ago

A timeout error can mean many things. Did it work in previous versions? Does it work when it starts again?

03397 commented 8 hours ago

Hello @OnFreund

No it did not. I always had problems during startups. Even if I disable and enable integration I am getting this timeout. Like I said it is random how much time it will take for the integration to load correctly.

OnFreund commented 8 hours ago

So it's the same as https://github.com/home-assistant/core/issues/115491?

I don't know what's causing this in your environment. Is your system slow to start in general? What hardware are you running on?

03397 commented 7 hours ago

I have the same behavior as in my last comment in #115491. No my systems is not slow at all. Docker running on a NAS with 32GB RAM.

OnFreund commented 7 hours ago

What CPU and what else is running on it? How long does it take HA to start?

03397 commented 6 hours ago

Do not worry about CPU. Always below 10%. The cpu is a AMD R-Series RX-421ND.

For home assistant it takes around 5-6 seconds to bring back everything. Risco integration is the last and always failing.