core icon indicating copy to clipboard operation
core copied to clipboard

Cannot install Risco integration using local option

Open 03397 opened this issue 1 year ago • 16 comments

The problem

Guys, I am trying to connect my Risco Alarm Panel Rw132 as local to Home Assistant. I am 100% sure that the IP address, port and CS Pin Number are all correct.. When I try to add I am getting a "Failed to Connect" message without any entries in the logs of Home Assistant

What version of Home Assistant Core has the issue?

2023.11.0

What was the last working version of Home Assistant Core?

It never worked.

What type of installation are you running?

Home Assistant Core

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

03397 avatar Nov 04 '23 14:11 03397

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.

(message by CodeOwnersMention)


risco documentation risco source (message by IssueLinks)

home-assistant[bot] avatar Nov 04 '23 15:11 home-assistant[bot]

Have you looked at #99229?

OnFreund avatar Nov 04 '23 16:11 OnFreund

i currently have the same problem, but this is on the way to be solved by adding a communication delay. Already done in "Pyrisco" the goal or porpose is to cover the slower mono socket ip modules, which are sometimes in the need of this delay.

FredericMa:add_communication_delay

jakob1911 avatar Nov 04 '23 16:11 jakob1911

Have you looked at #99229?

My panel can successfully connect to the cloud and connect to CS software simultaneously. This is multi socket. Is this the solution or this is something to try or the solution is the delay proposed?

03397 avatar Nov 04 '23 16:11 03397

In addition, I have disabled the cloud connection and I am getting the same behavior.

03397 avatar Nov 04 '23 16:11 03397

PR #101349 has been merged. I guess it will be shipped in the December release.

FredericMa avatar Nov 13 '23 14:11 FredericMa

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Ιs this solved here or on PR #101349?

03397 avatar Feb 11 '24 16:02 03397

I think so

FredericMa avatar Feb 11 '24 17:02 FredericMa

Still does not work Logger: homeassistant.components.risco.config_flow Source: components/risco/config_flow.py:184 Integration: Risco (documentation, issues) First occurred: 8:20:20 PM (1 occurrences) Last logged: 8:20:20 PM

Unexpected exception Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/risco/config_flow.py", line 184, in async_step_local info = await validate_local_input(self.hass, user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/risco/config_flow.py", line 99, in validate_local_input await risco.connect() File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_local.py", line 28, in connect firmware = await self._rs.send_result_command("FSVER?") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 108, in send_command return await asyncio.wait_for(future, 1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for return await fut ^^^^^^^^^ pyrisco.common.OperationError: cmd_id: 6, Risco error: N05

03397 avatar Feb 11 '24 18:02 03397

I had the same fault when trying to connect to my Agility 3. The "problem" is not at the risco integration here -- its in the dependency of this integration ! PYRISCO by OnFreund is a depedency for this integration to work ! I found out the problem by checking the code ( ---- PYRISCO by OnFreund) on the point where "FSVER?" is send to the panel. My RW132 never gave me an response on that command "FSVER?". So i had the same fault in homeassistant as you !

Then i verified this guess (panel not giving a response) by analysing the logs when communicating with the risco config software. This command is asking for the firmware version. In my case (my panel) the commad for retriving the firmware has to be "PNLVER?". But i don´t wasted my time on that and modified the code (i forked pyrisco - jakob1911) right away to give a fixed response on that command. So instead of await..... i use a constant string '3.95' -- which is my firmware version. Then communication was possible for me.

I was also mentioning creating a PR in the next months, but not here at the risco integration. The code parts that i modified is within the used dependency for this integration which is PYRISCO by OnFreund.

jakob1911 avatar Feb 13 '24 20:02 jakob1911

I have also an Agility 3 so our scenarios are actually identical. I am running Home assistant in a docker, can you please be more specific in how I can change the Pyrisco that you have mentioned above and change it using your fork Pyrisco?

Is your change going to be included in the Pyrisco at sometime or not?

03397 avatar Feb 13 '24 21:02 03397

had the same fault when trying to connect to my Agility 3. The "problem" is not at the risco integration here -- its in the dependency of this integration ! PYRISCO by OnFreund is a depedency for this integration to work !

Yes, I maintain both the integration and the underlying dependency. HA integrations don't communicate directly with devices, they use libraries.

Then i verified this guess (panel not giving a response) by analysing the logs when communicating with the risco config software. This command is asking for the firmware version. In my case (my panel) the commad for retriving the firmware has to be "PNLVER?".

FSVER and PNLVER are not equivalent, but it's good to know that FSEVER isn't supported on all devices. I can figure out a way around that. Other than FSVER, is everything else functioning correctly? I want to make sure this isn't representative of other unsupported commands.

OnFreund avatar Feb 13 '24 21:02 OnFreund

I released a new version of pyrisco that doesn't get the firmware version for RW panels. Can you test that? https://pypi.org/project/pyrisco/0.5.9/

OnFreund avatar Feb 14 '24 16:02 OnFreund

Hello OnFreund,

many thanks for your fast reply ! I really appriciate your work and your time for this code/project. It took me quite a lot of time to get my fork of pyrisco working properly togehter with HomeAssistant. I´m willing to contribute with my changes, but i was still testing everything for stability purpose.

I will create a Issue in the depedency -- pyrisco right now with the other changes i made. I hope you can modifiy, so that i dont need to get the expirienced way with the "custom integration", which i do now for testing purpose.

Thank you ! Jakob

jakob1911 avatar Feb 16 '24 19:02 jakob1911

Hello OnFreund, hello 03397,

please find my Issue here https://github.com/OnFreund/pyrisco/issues/18

I put all the information on modifications to get it to work with homeassistant.

@03397 I´m also using HA in a Docker..... I can share my manifest.json from my "custom integration" which i did in HA. But i think we should wait for OnFreund`s answer first. Because my solutions with the "custom integration" - Risco also has negative aspects -- like you are by your self responsible for updating it...... and so on.. I think this are problems that can be solved and merged.

jakob1911 avatar Feb 16 '24 20:02 jakob1911

Guys, any news on this?

03397 avatar Mar 09 '24 12:03 03397

@03397 this should be fixed in 2024.3.2

@jakob1911 Can you open a new issue (here in HA, not in pyrisco) for your max concurrency situation? Might take me a while to get to it, so I don't want to lose track of it.

OnFreund avatar Mar 15 '24 11:03 OnFreund