Closed MCheckN closed 4 months ago
Hey there @home-assistant/matter, mind taking a look at this issue as it has been labeled with an integration (matter
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
matter documentation matter source (message by IssueLinks)
I have the same error an am currently unable to use the matter integration
I have exact same error on the integration side log adding Tasmota Flashed Switchbot plug. No errors in the Add-On server side log that shows the plug completed commissioning with no errors. Reboot of the Add-On Matter server shows it can find the device with no issues.
I think have the same here with a newly flashed Tasmota install on a Sonoff Dual R3 - with matter installed on the device I can link it to Google Home as matter device, but cannot link it to Home Assistant, and after the attempt the HA Matter Integration consistently shows flips between 'Initialising' and 'Failed setup, will retry'.
Tasmota version: Program Version 13.4.0(tasmota32) Build Date & Time 2024-02-14T16:17:40
Home Assistant Versions: Core 2024.4.3 Supervisor 2024.04.0 Frontend 20240404.2 Matter Integration:
Error logged (using debug settings):
Logger: homeassistant.components.matter
Source: components/matter/__init__.py:151
integration: Matter (BETA) (documentation, issues)
First occurred: 11:11:33 (3 occurrences)
Last logged: 11:12:49
Unexpected exception: Value 2 of type <class 'int'> is invalid for NOCStruct.noc, expected value of type <class 'bytes'>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/matter/__init__.py", line 151, in _client_listen
await matter_client.start_listening(init_ready)
File "/usr/local/lib/python3.12/site-packages/matter_server/client/client.py", line 598, in start_listening
MatterNode(dataclass_from_dict(MatterNodeData, x))
File "/usr/local/lib/python3.12/site-packages/matter_server/client/models/node.py", line 245, in __init__
self.update(node_data)
File "/usr/local/lib/python3.12/site-packages/matter_server/client/models/node.py", line 332, in update
self.endpoints[endpoint_id] = MatterEndpoint(
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/matter_server/client/models/node.py", line 71, in __init__
self.update(attributes_data)
File "/usr/local/lib/python3.12/site-packages/matter_server/client/models/node.py", line 221, in update
self.set_attribute_value(attribute_path, attribute_value)
File "/usr/local/lib/python3.12/site-packages/matter_server/client/models/node.py", line 212, in set_attribute_value
attribute_value = parse_value(
^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/matter_server/common/helpers/util.py", line 148, in parse_value
return origin(
^^^^^^^
File "/usr/local/lib/python3.12/site-packages/matter_server/common/helpers/util.py", line 149, in <genexpr>
parse_value(name, subvalue, get_args(value_type)[0])
File "/usr/local/lib/python3.12/site-packages/matter_server/common/helpers/util.py", line 144, in parse_value
return dataclass_from_dict(value_type, value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/matter_server/common/helpers/util.py", line 263, in dataclass_from_dict
field.name: parse_value(
^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/matter_server/common/helpers/util.py", line 237, in parse_value
raise TypeError(
TypeError: Value 2 of type <class 'int'> is invalid for NOCStruct.noc, expected value of type <class 'bytes'>
Hm, the NOCStruct
type clearly is defined as octstr
, so I wonder why Tasmota response with an integer here :thinking:
Can you try to clear the flash before flashing Tasmota? To me it seems a problem of Tasmota not adhering to the data type of NOCStruct
. But I guess since others handle it gracefully (presumably ignore the value?) we probably should too. But this seems a bug in Tasmota.
Thank you! So I guess we'll see this bug fixed in 5.6.0 release. Installing ) Meanwhile, I've confirmed that there's seem so be a bug in Tasmota also. Because downgrading to 13.3 solves the problem. But I had to set "Force static endpoints" as seems HA Matter doesn't support it in Bridge mode. More details on Tasmota bugreport here - https://github.com/arendst/Tasmota/discussions/20949
Thank you! So I guess we'll see this bug fixed in 5.6.0 release. Installing )
I think this also needs the update on client side (addressed with https://github.com/home-assistant/core/pull/116514). So needs Core 2024.5.0.
But I had to set "Force static endpoints" as seems HA Matter doesn't support it in Bridge mode. More details on Tasmota bugreport here - arendst/Tasmota#20949
Yeah I saw this discussion. In general, wee do support bridges, at least Hue and M1 are known to work. I am not sure why Tasmota emulating a bridge doesn't work. What happens exactly? Is there an error in the Matter Server or Client logs?
But I had to set "Force static endpoints" as seems HA Matter doesn't support it in Bridge mode. More details on Tasmota bugreport here - arendst/Tasmota#20949
Yeah I saw this discussion. In general, wee do support bridges, at least Hue and M1 are known to work. I am not sure why Tasmota emulating a bridge doesn't work. What happens exactly? Is there an error in the Matter Server or Client logs?
Exactly, it creates the device in Matter but no objects inside. No switch or anything. Just an empty device
Exactly, it creates the device in Matter but no objects inside. No switch or anything. Just an empty device
If Tasmota adheres to the Matter standard you will see the devices pop up in HA just fine, as long as the device types are already supported in HA ofcourse.
Thanks for the troubleshooting. It was a stupid mistake in the attribute number in NOCStruct. It is fixed now in https://github.com/arendst/Tasmota/pull/21365
The problem
Sonoff Basic R4 flashed to Tasmota ESP32 13.4.0.2. Configured with template without Magic Button. When I try to connect device with Matter enabled to Home Assistant Matter integration, the integration itself hangs in HA. Even if there were successful Matter added devices in HA before that, after trying to add Tasmota device the integration hangs in an endless loop trying to restore integration. The only thing that helps is remove all integrations and reinstall Matter integration with addon from scratch
What version of Home Assistant Core has the issue?
2024.3.0
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
Matter
Link to integration documentation on our website
No response
Diagnostics information
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response