Skip to content

Matter Integration enters crash loop when off-spec matter devices are added #152806

@juhaagit

Description

@juhaagit

The problem

Description
The Matter integration enters a crash loop when an off-spec Matter device is added, rendering all Matter devices unusable until the faulty device is removed. The same problem has already been described in issue #140737

Steps to Reproduce
Pair a device running the official MatterContact Arduino example firmware from Silicon Labs (e.g. the Arduino Nano Matter).
The firmware contains an attribute with an incorrect type (not compliant with the specification).
Immediately after pairing, the Matter integration crashes repeatedly before the device becomes visible in Home Assistant.

Expected Behavior
Home Assistant should handle the faulty attribute gracefully, allowing other Matter devices to remain functional.

Actual Behavior
The Matter integration enters a continuous crash loop.
No Matter devices are usable until the faulty device is removed.
The only recovery method is to manually delete the paired device from the Matter Server UI.

Root Cause
The crash is triggered by a non-spec attribute type in the SiLabs firmware. I have submitted a fix upstream:
SiliconLabs/arduino#149

Impact
A single misbehaving device causes a complete outage of all Matter devices in Home Assistant.

What version of Home Assistant Core has the issue?

core-2025.9.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Matter

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

Anything in the logs that might be useful for us?

2025-09-18 10:29:37.325 ERROR (MainThread) [homeassistant.components.matter] Unexpected exception: Value 0 of type <class 'int'> is invalid for stateValue, expected value of type <class 'bool'>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/matter/__init__.py", line 176, in _client_listen
    await matter_client.start_listening(init_ready)
  File "/usr/local/lib/python3.13/site-packages/matter_server/client/client.py", line 635, in start_listening
    MatterNode(dataclass_from_dict(MatterNodeData, x))
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/matter_server/client/models/node.py", line 247, in __init__
    self.update(node_data)
    ~~~~~~~~~~~^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/matter_server/client/models/node.py", line 334, in update
    self.endpoints[endpoint_id] = MatterEndpoint(
                                  ~~~~~~~~~~~~~~^
        endpoint_id=endpoint_id, attributes_data=attributes_data, node=self
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/matter_server/client/models/node.py", line 73, in __init__
    self.update(attributes_data)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/matter_server/client/models/node.py", line 223, in update
    self.set_attribute_value(attribute_path, attribute_value)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/matter_server/client/models/node.py", line 214, in set_attribute_value
    attribute_value = parse_value(
        attribute_name, attribute_value, attribute_type, attribute_class().value
    )
  File "/usr/local/lib/python3.13/site-packages/matter_server/common/helpers/util.py", line 262, in parse_value
    raise TypeError(
    ...<2 lines>...
    )
TypeError: Value 0 of type <class 'int'> is invalid for stateValue, expected value of type <class 'bool'>

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions