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

Error with actions #8

Open
goedh452 opened this issue Aug 18, 2024 · 6 comments
Open

Error with actions #8

goedh452 opened this issue Aug 18, 2024 · 6 comments

Comments

@goedh452
Copy link

When I try to perform an action (formerly known as services), I get an unhandled execution. Any ideas? The information is displayed correctly and pressing the buttons provided by the integration does water the plants.

Scherm­afbeelding 2024-08-18 om 14 27 22
Logger: homeassistant.helpers.script.websocket_api_script
Source: helpers/script.py:525
First occurred: 14:24:46 (1 occurrences)
Last logged: 14:24:46

websocket_api script: Error executing script. Unexpected error for call_service at pos 1: 'tuple' object has no attribute 'handle_water_plant'
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/growcube/services.py", line 24, in async_call_water_plant_service
    await _async_handle_water_plant(hass, service_call.data)
  File "/config/custom_components/growcube/services.py", line 122, in _async_handle_water_plant
    await coordinator.handle_water_plant(channel, duration)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'tuple' object has no attribute 'handle_water_plant'
Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/growcube/services.py:122
integration: Home Assistant WebSocket API ([documentation](https://www.home-assistant.io/integrations/websocket_api), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
First occurred: 14:24:46 (1 occurrences)
Last logged: 14:24:46

[139661396911600] Error handling message: Unknown error (unknown_error) Bouke from 192.168.2.2 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.6 Safari/605.1.15)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 28, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 793, in handle_execute_script
    script_result = await script_obj.async_run(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1799, in async_run
    return await asyncio.shield(create_eager_task(run.async_run()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 463, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 527, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 557, in _handle_exception
    raise exception
  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/growcube/services.py", line 24, in async_call_water_plant_service
    await _async_handle_water_plant(hass, service_call.data)
  File "/config/custom_components/growcube/services.py", line 122, in _async_handle_water_plant
    await coordinator.handle_water_plant(channel, duration)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'tuple' object has no attribute 'handle_water_plant'
@gianlucaromito
Copy link

gianlucaromito commented Aug 21, 2024

Hi I've got the similar error.
It does NOT water the plant, using this method.

image

Translation Error: The intl string context variable "services" was not provided to the string "Impossibile eseguire l'azione: {services}" Unknown error

HASS:
Core 2024.8.2
Supervisor 2024.08.0
Operating System 12.4
Frontend 20240809.0

Growcube
da Elecrow
Firmware: 4.1

@gianlucaromito
Copy link

Hi is there some news on this error? Thanks for an update!

@goedh452
Copy link
Author

I abandoned the grow cube al together. Device didn't work for me. Connection errors and not suitable for bigger plants.

@gianlucaromito
Copy link

Thanks for letting me know.
Is the project still supported by @jonnybergdahl ?

@jonnybergdahl
Copy link
Owner

It is still fully supported by me, and I still use Growcube. I have been busy with moving, which is why I haven't had any time to work on the integration.

I just published v1.0.3 that should fix the "AttributeError: 'tuple' object has no attribute 'handle_water_plant'" issue.

As for the translation error, I need to look into that, but my guess is that it is realted to the HA developers renaming "services" to "actions". Still not sure why I don't see that error message though.

@gianlucaromito
Copy link

Hi I can confirm that it is working now.
Thanks for supporting this product.

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

3 participants