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
72.39k stars 30.29k forks source link

Risco partition doesn't work after update core 2024.4.0 #114830

Closed liberomic closed 5 months ago

liberomic commented 6 months ago

The problem

In my security system I have three partitions where I can arm or disarm (local integration LightSYS(50) firmware 06.07.01) . I have noted after upgrade the homeassistant core to 2024.4.0 one of three partition working fine other it is disabled. I have tried to restart the integration but the issue persist. In the identity the partitions are avaliable but are disabled/unavaliable. I have restored the backup to 2024.3.3 where the integration Risco working fine.

thanks for your work

What version of Home Assistant Core has the issue?

2024.4.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

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 6 months 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 6 months ago

Logs?

liberomic commented 6 months ago

I have the same problem with 2024.4.1

2024-04-07 21:16:51.626 DEBUG (MainThread) [homeassistant.components.risco] Risco partition update for 1 2024-04-07 21:16:51.737 DEBUG (MainThread) [homeassistant.components.risco] Risco zone update for 13 2024-04-07 21:16:53.541 DEBUG (MainThread) [homeassistant.components.risco] Risco partition update for 1 2024-04-07 21:16:53.615 DEBUG (MainThread) [homeassistant.components.risco] Risco zone update for 14 2024-04-07 21:16:55.511 DEBUG (MainThread) [homeassistant.components.risco] Risco partition update for 1 2024-04-07 21:16:55.606 DEBUG (MainThread) [homeassistant.components.risco] Risco zone update for 14 2024-04-07 21:16:58.453 DEBUG (MainThread) [homeassistant.components.risco] Risco partition update for 1 2024-04-07 21:16:58.578 DEBUG (MainThread) [homeassistant.components.risco] Risco zone update for 13 2024-04-07 21:17:00.532 DEBUG (MainThread) [homeassistant.components.risco] Risco partition update for 1 2024-04-07 21:17:00.666 DEBUG (MainThread) [homeassistant.components.risco] Risco zone update for 13

On HA the partitions are unavaliable, do you have other procedure to capture logs of Risco integration?

Regards

OnFreund commented 6 months ago

Once 2024.4.3 is out, please try lower values for the new concurrency option and see if it solves the problem.

liberomic commented 6 months ago

Hi OnFreund,

I have upgaded but the issue persist, I moved concurrency option from 4-3-2 but the issue persist

Error in Risco library

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 109, in send_command return await asyncio.wait_for(future, 1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 87, in _keep_alive await self.send_result_command("CLOCK") File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_socket.py", line 98, in send_result_command command = await self.send_command(command) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_socket.py", line 111, in send_command raise OperationError(f'Timeout in command: {command}') pyrisco.common.OperationError: Timeout in command: CLOCK

Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_socket.py", line 65, in _listen cmd_id, command, crc = await self._read_command() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_socket.py", line 124, in _read_command return self._crypt.decode(buffer) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_crypt.py", line 47, in decode decrypted = decrypted_chars.decode(self._encoding) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

OnFreund commented 6 months ago

Your panel is not responding within 1 second, but it's a clock command, so it shouldn't have any effect on function.

Does this only happen during HA startup? What happens if you disable the integration, restart HA, and only enable it after HA is fully loaded?

liberomic commented 6 months ago

Hi OnFreund,

I am using local integration from some time and work fine until 2024.3.3 (in some case need the restart the integration). In my enviroment I have three partiton where I arm or disarm the security alarm. After the upgrade to the latest version of HA 2024.4.3 the Risco integratios is unstable and unusable.

Issue: Security partitions are present in the list of the Risco identity but unavaiable, The first partition is avaliable other are unavaliable.

1) I have disabled the integration and restart HA and enabled it but the issue persit 2) I have moved concurrency options from 4-3-2-1 but the issue persit 3) Now I have restored the snapshot to 2024.3.3 HA present out of memory and the integration not start, I try to poweroff HA for some time and start. 4) I have cleared all log in registry section and I shared to you, I can't see other logs

Regards, thanks for your works

liberomic commented 6 months ago

Now I have restored HA to 2024.3.3 but the Risco integration can't start, the integration loop on inizializing for some hours without working. Do you help me to restore the comunication with Risco local?

Regards

liberomic commented 5 months ago

for this issue: the integration loop on inizializing for some hours without working. Do you help me to restore the comunication with Risco local?

Now the risco integration work fine with 2024.3.3, I will wait for your fix to update HA

OnFreund commented 5 months ago

So it seems like your alarm was stuck. Maybe you should try 2024.4.3 again?

liberomic commented 5 months ago

I have upgraded to 2024.4.3 after startup I see only one partition avaliable of three partitions. I have moved concurrency options from 4 to 2 and after the completly reboot the integration stay in loop on inizializing.... and not start. Now I moved to 3 and retry I will chech if reboot of the Risco alarm is needed

Regards

liberomic commented 5 months ago

Hi Onfreund,

I have moved concurrency options from 4 to 2 and the local comunication with Risco Alarm is blocked and the integration stay in loop. I have moved from 2 to 3 after complety restart of HA all work fine, I have tried 2 or 3 reboot and I will see the same error 1 partition is avaliable others are not avaliable.

Error in Risco library

Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_socket.py", line 65, in _listen cmd_id, command, crc = await self._read_command() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_socket.py", line 124, in _read_command return self._crypt.decode(buffer) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_crypt.py", line 47, in decode decrypted = decrypted_chars.decode(self._encoding) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 32: invalid start byte

liberomic commented 5 months ago

After some time are present this partition errors

Error in Risco library

Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_local.py", line 221, in _listen self._partition_status(int(command[4:]), result) File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_local.py", line 181, in _partition_status p = self._partitions[partition_id]


KeyError: 2
bdraco commented 5 months ago

closed as completed via https://github.com/home-assistant/core/pull/116182

liberomic commented 5 months ago

Hi Onfreund,

I have tested but the issue on the Security Zone persist, now with the latest version of HA 2024.5.2 if i change cuncurrency from 4 to 1 and now the integration start correctly but I will se only one zone avaliable. With 2024.3.3 all works fine.

Error in Risco library Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_local.py", line 221, in _listen self._partition_status(int(command[4:]), result) File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_local.py", line 181, in _partition_status p = self._partitions[partition_id]

Error in Risco library Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_socket.py", line 65, in _listen cmd_id, command, crc = await self._read_command() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_socket.py", line 123, in _read_command return self._crypt.decode(buffer) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_crypt.py", line 47, in decode decrypted = decrypted_chars.decode(self._encoding)

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 108, 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

Screenshot 2024-05-07 100151