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

Backup blueprint broke with latest update #239

Closed
roblamoreaux opened this issue Aug 1, 2024 · 10 comments
Closed

Backup blueprint broke with latest update #239

roblamoreaux opened this issue Aug 1, 2024 · 10 comments

Comments

@roblamoreaux
Copy link

`The latest update seems to have removed the zha_execute service that the backuyp blueprint uses, so it give an error message.

I think the blueprint needs to be changed to the new zhe_toolkit.backup service.

@roblamoreaux
Copy link
Author

It looks like I may have been mistaken, in that ZHA_Toolkit had not started due to not finding HA Core. updating to V1.1.12 seems to have fixed that, but I am getting the following when I execute the script:
Daily Coordinator Backup - Monthly rotation: Error executing script. Unexpected error for call_service at pos 1: 'HAZHAData' object has no attribute 'gateway' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 525, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 764, in _async_call_service_step response_data = await self._async_run_long_action( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 727, in _async_run_long_action return await long_task ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2763, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2806, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/zha_toolkit/__init__.py", line 684, in toolkit_service zha_gw = zha.gateway ^^^^^^^^^^^ AttributeError: 'HAZHAData' object has no attribute 'gateway'

@mdeweerd
Copy link
Owner

mdeweerd commented Aug 1, 2024

It looks like the latest version obliges to find a new way to access the 'gateway' instance (if it's still there).

This surely impacts more than just the backup which is as far as I know also proposed by ZHA itself.

@mdeweerd
Copy link
Owner

mdeweerd commented Aug 1, 2024

The gateway file was deleted from 2024.7.4 to 2024.8.0b

diff --git a/homeassistant/components/zha/core/gateway.py b/homeassistant/components/zha/core/gateway.py
deleted file mode 100644

@mdeweerd
Copy link
Owner

mdeweerd commented Aug 1, 2024

But thre is a function to get it (accroding to homeassistant/components/zha/diagnostics.py code)

    gateway: [-ZHAGateway-]{+Gateway+} = get_zha_gateway(hass)
    app = gateway.application_controller

And found in the zha helpers:

homeassistant/components/zha/helpers.py:def get_zha_gateway(hass: HomeAssistant) -> Gateway:
homeassistant/components/zha/helpers.py:def get_zha_gateway_proxy(hass: HomeAssistant) -> ZHAGatewayProxy:

I do not have a 2024.8.X system yet, and other priorities as well.

@ChristophCaina
Copy link
Contributor

then, this integration requires more rework and will fail for all users next week.
With the last version I tried to overcome this - but it seem, that there are more areas that needs to be adapted.

Unfortunately, I also do not have the capacity to go through all cases :-(

@CordoWEB
Copy link

CordoWEB commented Aug 2, 2024

Tip of the day : Keep version HA 2024.7 or lower !
With each update of HA, incompatibility issues exist.

I'm using 2024.6.4 version and all i need, works like a charm. Why change ?

@puddly
Copy link

puddly commented Aug 2, 2024

We're restructuring ZHA a lot and will have more major changes in the next couple of releases.

I think long-term the functionality you rely on to be provided by ZHA Toolkit needs to be moved into zigpy and ZHA for it to be stable.

@CordoWEB
Copy link

CordoWEB commented Aug 2, 2024

We're restructuring ZHA a lot and will have more major changes in the next couple of releases.
I think long-term the functionality you rely on to be provided by ZHA Toolkit needs to be moved into zigpy and ZHA for it to be stable.

Why i need zha_toolkit ? Because in ZHA there are a "zha.set_zigbee_cluster_attribute" but no "zha.get_zigbee_cluster_attribute". I do not understand why because this function is available on HA UI. I need it to read information on zigbee a device every 40s. When you request this feature, the first answer is "install zha-toolkit" ! Thanks a lot if you can add it.

@wbyoung
Copy link
Contributor

wbyoung commented Aug 9, 2024

Try out the beta release, 1.1.19 and see how things go. This resolved all issues for my use cases.

@mdeweerd
Copy link
Owner

#271 is a duplicate, but I already tagged that one, so I am closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants