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.9k stars 30.97k forks source link

Risco integration not working #128489

Open understrong opened 1 month ago

understrong commented 1 month ago

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[bot] commented 1 month 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)

agmckaybro commented 1 month ago

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 commented 1 month ago

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

agmckaybro commented 1 month ago

see:

understrong commented 1 month ago

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

OnFreund commented 1 month ago

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

OnFreund commented 1 month ago

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

understrong commented 1 month ago

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