mdeweerd / zha-toolkit

🧰 Zigbee Home Assistant Toolkit - service for "rare" Zigbee operations using ZHA on Home Assistant
GNU General Public License v3.0
193 stars 29 forks source link

MAJ v1.1.14 : zha_toolkit.execute Not Found #244

Closed SebastienMrc closed 2 months ago

SebastienMrc commented 2 months ago

I just made the latest update via HACS to v1.1.14 and the "zha_toolkit.execute" function no longer exists in my Home Assistant. My automation that uses it can't run it...

Is there a change in the use of the function?

Log :

 Read ZLinky_TIC HP every minute: Error executing script. Service not found for call_service at pos 1: Action zha_toolkit.execute not found 
 17:28:00 – (ERREUR) Automatisation - message survenu pour la première fois à 15:40:00 et apparu 109 fois.
 [546682575248] Action zha_toolkitzha_toolkit.execute not found 
 17:20:49 – (ERREUR) Home Assistant WebSocket API
 websocket_api script: Error executing script. Service not found for call_service at pos 1: Action zha_toolkitzha_toolkit.execute not found 
 17:20:49 – (ERREUR) helpers/script.py
 Detected that custom integration 'hacs' calls hass.http.register_static_path which is deprecated because it does blocking I/O in the event loop, instead call `await hass.http.async_register_static_paths([StaticPathConfig("/hacsfiles/iconset.js", "/config/custom_components/hacs/iconset.js", True)])`; This function will be removed in 2025.7 at custom_components/hacs/frontend.py, line 57: hass.http.register_static_path(, please create a bug report at https://github.com/hacs/integration/issues 
 15:39:43 – (AVERTISSEMENT) helpers/frame.py - message survenu pour la première fois à 15:39:24 et apparu 6 fois.
 Error during setup of component zha_toolkit 
 15:39:42 – (ERREUR) setup.py
CordoWEB commented 2 months ago

Same error with 1.1.4 version. Back to 1.1.3 is OK. I'm using HA 2024.6.4

2024-08-06 18:11:01.449 ERROR (MainThread) [homeassistant.setup] Error during setup of component zha_toolkit Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 402, in _async_setup_component result = await task ^^^^^^^^^^ File "/config/custom_components/zha_toolkit/__init__.py", line 660, in async_setup await hass.async_add_executor_job(register_services, hass) File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/zha_toolkit/__init__.py", line 853, in register_services hass.services.async_register( File "/usr/src/homeassistant/homeassistant/core.py", line 2525, in async_register self._hass.verify_event_loop_thread("hass.services.async_register") File "/usr/src/homeassistant/homeassistant/core.py", line 447, in verify_event_loop_thread frame.report( File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 159, in report _report_integration(what, integration_frame, level, error_if_integration) File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 197, in _report_integration raise RuntimeError( RuntimeError: Detected that custom integration 'zha_toolkit' calls hass.services.async_register from a thread other than the event loop, which may cause Home Assistant to crash or data to corrupt. For more information, see https://developers.home-assistant.io/docs/asyncio_thread_safety/#hassservicesasync_register at custom_components/zha_toolkit/__init__.py, line 853: hass.services.async_register(. Please report it to the author of the 'zha_toolkit' custom integration. 2024-08-06 18:11:04.528 ERROR (MainThread) [homeassistant.components.automation.sirenes_etat_batteries] Divers - Etat batterie sirène: Error executing script. Service not found for call_service at pos 1: Service zha_toolkit.attr_read not found 2024-08-06 18:11:40.249 ERROR (MainThread) [homeassistant.components.automation.linky_recuperation_puissances] Linky - Récupération puissances: Error executing script. Service not found for call_service at pos 1: Service zha_toolkit.attr_read not found 2024-08-06 18:12:00.241 ERROR (MainThread) [homeassistant.components.automation.linky_recuperation_puissances] Linky - Récupération puissances: Error executing script. Service not found for call_service at pos 1: Service zha_toolkit.attr_read not found 2024-08-06 18:12:04.501 ERROR (MainThread) [homeassistant.components.automation.linky_informations_techniques] Linky - Récupération informations: Error executing script. Service not found for call_service at pos 2: Service zha_toolkit.attr_read not found 2024-08-06 18:12:40.240 ERROR (MainThread) [homeassistant.components.automation.linky_recuperation_puissances] Linky - Récupération puissances: Error executing script. Service not found for call_service at pos 1: Service zha_toolkit.attr_read not found 2024-08-06 18:13:00.240 ERROR (MainThread) [homeassistant.components.automation.linky_recuperation_puissances] Linky - Récupération puissances: Error executing script. Service not found for call_service at pos 1: Service zha_toolkit.attr_read not found 2024-08-06 18:13:40.240 ERROR (MainThread) [homeassistant.components.automation.linky_recuperation_puissances] Linky - Récupération puissances: Error executing script. Service not found for call_service at pos 1: Service zha_toolkit.attr_read not found 2024-08-06 18:14:00.241 ERROR (MainThread) [homeassistant.components.automation.linky_recuperation_puissances] Linky - Récupération puissances: Error executing script. Service not found for call_service at pos 1: Service zha_toolkit.attr_read not found

GuidoC1 commented 2 months ago

I have the same issue. Believe it is due to the fact that ZHA_toolkit setup fails see https://github.com/mdeweerd/zha-toolkit/issues/243

mdeweerd commented 2 months ago

I've refactored some code - hopefully that's fine by the HomeAssistant team's rules. It start fine for me on 2024.07.4 v1.1.15 is released

CordoWEB commented 2 months ago

Same bug here with v1.1.15 and v1.1.16 on HA 2024.6.4. Version v1.1.12 works fine.

SebastienMrc commented 2 months ago

I have the same problem with v1.1.16. The latest version that works properly at home is v1.1.13.

I'm on HA 2024.8.0

SebastienMrc commented 2 months ago

Ok, rectification, I updated to HA 2024.8.0 last night and now no version of zha_toolkit works anymore...

When I was on the previous version of HA, v1.1.13 worked. But now more...

I shouldn't have done this update...

mdeweerd commented 2 months ago

Personnaly I avoid the very first version of the month, and in this case there are major ZHA changes.

I am working on setting up an environment where I can test with a gateway - the other constraint is the effort...

SebastienMrc commented 2 months ago

I just tested the new version v1.1.17, it does not work with HA 2024.8.0 But I used a backup and returned to version HA 2024.7.4 and with this version, v1.1.17 works properly. I don't know what causes the problem with HA 2024.8.0 but with the previous version, patch v1.1.17 is functional!

mdeweerd commented 2 months ago

Thank you for the feedback.

2024.8.0 has a major overhaul of ZHA generating incompatilibities.

SebastienMrc commented 2 months ago

Will these incompatibilities be resolved in 2024.8.1 or will it be necessary to do differently in the future?