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

Crash while sending Zigbee command over ZHA integration #80157

Closed
0anton opened this issue Oct 12, 2022 · 4 comments
Closed

Crash while sending Zigbee command over ZHA integration #80157

0anton opened this issue Oct 12, 2022 · 4 comments
Assignees

Comments

@0anton
Copy link

0anton commented Oct 12, 2022

The problem

I suspect a bug in ZHA integration. If I try to issue a command following the path in UI:

Clusters -> Commands -> Clusters: Ota (Endpoint id: 1, id: 0x0019, Type: out) -> Commands of the selected cluster: image_notify (id: 0x0000) -> Issue zigbee command

I get a Python error:

Failed to call service zha/issue_zigbee_cluster_command. '>=' not supported between instances of 'NoneType' and 'PayloadType'

What version of Home Assistant Core has the issue?

Home Assistant 2022.10.3 Supervisor 2022.10.0 Operating System 9.2 Frontend 20221010.0 - latest

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

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

/config/home-assistant.log:


2022-10-12 10:40:42.963 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [281472101692752] '>=' not supported between instances of 'NoneType' and 'PayloadType'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 202, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1738, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1775, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 748, in admin_handler
    await result
  File "/usr/src/homeassistant/homeassistant/components/zha/api.py", line 1295, in issue_zigbee_cluster_command
    response = await zha_device.issue_cluster_command(
  File "/usr/src/homeassistant/homeassistant/components/zha/core/device.py", line 680, in issue_cluster_command
    response = await cluster.client_command(command, *args)
  File "/usr/local/lib/python3.10/site-packages/zigpy/zcl/__init__.py", line 342, in reply
    hdr, request = self._create_request(
  File "/usr/local/lib/python3.10/site-packages/zigpy/zcl/__init__.py", line 266, in _create_request
    request.serialize()  # Throw an error before generating a new TSN
  File "/usr/local/lib/python3.10/site-packages/zigpy/types/struct.py", line 231, in serialize
    for field, value in self.assigned_fields(strict=True):
  File "/usr/local/lib/python3.10/site-packages/zigpy/types/struct.py", line 178, in assigned_fields
    f"Value for field {field.name!r} is required: {self!r}"
  File "/usr/local/lib/python3.10/site-packages/zigpy/types/struct.py", line 348, in __repr__
    for f, v in self.assigned_fields():
  File "/usr/local/lib/python3.10/site-packages/zigpy/types/struct.py", line 171, in assigned_fields
    if field.requires is not None and not field.requires(self):
  File "/usr/local/lib/python3.10/site-packages/zigpy/zcl/clusters/general.py", line 1354, in <lambda>
    lambda s: s.payload_type >= s.PayloadType.QueryJitter_ManufacturerCode
TypeError: '>=' not supported between instances of 'NoneType' and 'PayloadType'

Additional information

I'm not sure if this issue is for ZHA integration (wrong usage of zigpy library) or for zigby library https://github.com/zigpy/zigpy (library implementation error)

Last function in stack :

File "/usr/local/lib/python3.10/site-packages/zigpy/zcl/clusters/general.py", line 1354, in <lambda>
    lambda s: s.payload_type >= s.PayloadType.QueryJitter_ManufacturerCode
@homeassistant
Copy link
Contributor

Hey there @dmulcahey, @Adminiuga, @puddly, mind taking a look at this issue as it has been labeled with an integration (zha) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)


zha documentation
zha source
(message by IssueLinks)

@dmulcahey
Copy link
Contributor

Should be fixed by: #79908

@0anton
Copy link
Author

0anton commented Oct 13, 2022

Oh thank you! Looking forward for the merge of the pull request. I’d be glad to retest after that.

@0anton
Copy link
Author

0anton commented Oct 14, 2022

Thanks @dmulcahey! I‘m looking forward for the next release to test the fix!

@github-actions github-actions bot locked and limited conversation to collaborators Nov 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants