Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Risco integration not working #128489

Closed
understrong opened this issue Oct 15, 2024 · 12 comments · Fixed by #132493
Closed

Risco integration not working #128489

understrong opened this issue Oct 15, 2024 · 12 comments · Fixed by #132493

Comments

@understrong
Copy link

The problem

Risco integration was working properly until few days ago. Since then, it is not able to finalise the initialisation, so all the entities are simply not available anymore.
I also tried to remove and re-configure the integration but nothing changed.
Attached the error code shown.
Screenshot_20241015_225539_Home Assistant

What version of Home Assistant Core has the issue?

core-2024.10.2

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

Risco

Link to integration documentation on our website

https://www.home-assistant.io/integrations/risco

Diagnostics information

home-assistant_risco_2024-10-15T21-27-37.448Z.log

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

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)

@agmckaybro
Copy link
Contributor

agmckaybro commented Oct 16, 2024

Same issue here since Risco updated their Cloud on 2024/10/14.
Relates to Risco cloud integration (https://www.home-assistant.io/integrations/risco) pyrisco lib which talks to risco cloud via well known api urls.

image

After using Fiddler between ios/riscocloud app <> risco website i can confirm:

which seems to fix the get_state() call.

Trying to patch my local homeassistant with it.

@agmckaybro
Copy link
Contributor

confirmed: modifying following lines on the lib pyrisco solve this issue:

vi /var/lib/docker/overlay2/[your ha docker id]/merged/usr/local/lib/python3.12/site-packages/pyrisco/cloud/risco_cloud.py
> line 57: add , from_control_panel=True
> line 63: modify with: "fromControlPanel": from_control_panel,

    async def _site_post(self, url, body, from_control_panel=True):
        site_url = url % self._site_id
        for i in range(NUM_RETRIES):
            try:
                site_body = {
                    **body,
                    "fromControlPanel": from_control_panel,
                    "sessionToken": self._session_id,
                }

> line 134: add: , from_control_panel=False
    async def get_state(self):
        """Get partitions and zones."""
        resp = await self._site_post(STATE_URL, {}, from_control_panel=False)
        return Alarm(self, resp["state"]["status"])

and alarm state comes back:

image

will open an issue at pyrisco level

@understrong
Copy link
Author

Ok, thanks for digging into. Looking forward for an integration update

@OnFreund
Copy link
Contributor

Thanks @agmckaybro!
The new pyrisco version is here: https://pypi.org/project/pyrisco/0.6.5/

@OnFreund
Copy link
Contributor

Here's the diff if you want to create a dependency bump PR for HA:
OnFreund/pyrisco@v0.6.4...v0.6.5

@understrong
Copy link
Author

Ciao Guys, I'm ingnorant on that. What's next now? Will it be intermgrated in the next home assistant core update?

agmckaybro added a commit to agmckaybro/core that referenced this issue Oct 21, 2024
Following issue home-assistant#128489, due to an updated version of RiscoCloud API, pyrisco has been updated to v0.6.5.
@smeersma
Copy link

smeersma commented Dec 4, 2024

@agmckaybro will you issue a PR?

@rosariourzi
Copy link

I'm getting still the same problem on HA core version Core
2024.11.3 Frontend 20241106.2.
!
04 12 2024_20 53 36_REC

@agmckaybro
Copy link
Contributor

Sorry for the delay, reinstalling test env (on a new pc) to start HA tests before starting a PR

@agmckaybro
Copy link
Contributor

@OnFreund PR done, could you review it ? #132493
thanks

@github-actions github-actions bot locked and limited conversation to collaborators Jan 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants