core: Cast Error using Device Action "Issue effect for all LEDs" w/ Inovelli Blue Switches

The problem

Steps to reproduce:

  • Create an action in an automation or script for a device
  • Choose an inovelli blue (zigbee) switch
  • Choose the “issue effect for all LEDs” action and select any values
  • Test that action (not the entire script/automation)

“Unknown error” will be shown. Checking the core logs shows this stacktrace: https://pastebin.com/bBfLLLB5

What version of Home Assistant Core has the issue?

2022.12.8

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

ZHA

Link to integration documentation on our website

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

Diagnostics information

zha-9fd41b61b98cf009614bbc0608b4367d-Inovelli VZM31-SN-2c43a32ccc1959fa988bec13a4bac529.json.txt

Example YAML snippet

type: issue_all_led_effect
domain: zha
device_id: 2c43a32ccc1959fa988bec13a4bac529
effect_type: Solid
duration: 132
level: 1
color: 192

Anything in the logs that might be useful for us?

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
    await func(hass, connection, msg)
  File "/config/custom_components/nodered/websocket.py", line 84, in websocket_device_action
    await platform.async_call_action_from_config(hass, msg["action"], {}, context)
  File "/usr/src/homeassistant/homeassistant/components/zha/device_action.py", line 125, in async_call_action_from_config
    await ZHA_ACTION_TYPES[DEVICE_ACTION_TYPES[config[CONF_TYPE]]](
  File "/usr/src/homeassistant/homeassistant/components/zha/device_action.py", line 221, in _execute_channel_command_based_action
    await getattr(action_channel, action_type)(**config)
  File "/usr/src/homeassistant/homeassistant/components/zha/core/channels/manufacturerspecific.py", line 253, in issue_all_led_effect
    await self.led_effect(effect_type, color, level, duration, expect_reply=False)
  File "/usr/src/homeassistant/homeassistant/components/zha/core/channels/base.py", line 78, in wrapper
    result = await command(*args, **kwds)
  File "/usr/local/lib/python3.10/site-packages/zigpy/quirks/__init__.py", line 180, in command
    return await self.request(
  File "/usr/local/lib/python3.10/site-packages/zigpy/zcl/__init__.py", line 304, in request
    hdr, request = self._create_request(
  File "/usr/local/lib/python3.10/site-packages/zigpy/zcl/__init__.py", line 265, in _create_request
    request = schema(*args, **kwargs)  # type:ignore[operator]
  File "/usr/local/lib/python3.10/site-packages/zigpy/types/struct.py", line 115, in __new__
    setattr(instance, name, field._convert_type(value))
  File "/usr/local/lib/python3.10/site-packages/zigpy/types/struct.py", line 41, in _convert_type
    raise ValueError(
ValueError: Failed to convert led_effect='Solid' from type <class 'str'> to <class 'zigpy.types.basic.uint8_t'>

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17 (5 by maintainers)

Most upvoted comments

This is not a stale issue. I just ran into the same problem. ZHA with Skyconnect and Inovelli testing yields an error, running the automation does not

This appears to be fixed in 2023.8.0 (possibly earlier?)

There hasn’t been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Yes, that works. And yes to your second question as well. The problem with that workaround is that it’s not possible to manually rewrite the value for something like Node-Red, and it’s still a bug that should be fixed.

I think you misunderstand, this is not a choice I made. The action was configured from the UI, “Solid” comes from the drop-down. Additionally, it works fine when not running the action by itself, so it must be more complex than just “wrong type”.