Skip to content

Matter: add UniqueID attribute to BridgedDeviceBasicInformation cluster - #183

Merged
Tamas Jozsi (silabs-bozont) merged 1 commit into
SiliconLabsSoftware:mainfrom
lboue:UniqueID
Jul 23, 2026
Merged

Matter: add UniqueID attribute to BridgedDeviceBasicInformation cluster#183
Tamas Jozsi (silabs-bozont) merged 1 commit into
SiliconLabsSoftware:mainfrom
lboue:UniqueID

Conversation

@lboue

Copy link
Copy Markdown
Contributor

Problem

UniqueID became a mandatory attribute in Matter 1.4 for the BridgedDeviceBasicInformation cluster. Its absence causes controllers such as Home Assistant to fail to create entities for bridged endpoints — the controller cannot stably identify a bridged device across re-pairings or bridge restarts, so it refuses to add it.

Changes

MatterDevice.h

  • Add kChanged_UniqueID = 1u << 6 to the Changed_t enum; update kChanged_Last to match
  • Add void SetUniqueID(const char* uniqueid) declaration
  • Add inline char* GetUniqueID() getter
  • Add char unique_id[DeviceDescStrSize] protected member

MatterDevice.cpp

  • Include em_system.h
  • In the constructor, populate unique_id from SYSTEM_GetUnique() using the format "silabs-%016llx", giving each bridged endpoint a stable, hardware-derived identity
  • Add Device::SetUniqueID() implementation (mirrors SetSerialNumber)
  • Add UniqueID::Id read handler in HandleReadBridgedDeviceBasicAttribute
  • Add kChanged_UniqueID block in HandleDeviceStatusChanged to schedule reporting callbacks

Matter.cpp

  • Add DECLARE_DYNAMIC_ATTRIBUTE for UniqueID::Id after SerialNumber in bridgedDeviceBasicAttrs

Matter.h

  • Bump bridgedDeviceBasicAttrs extern array size from 7 to 8

Note: bridged_device_basic_information_cluster_revision is left at 4, matching the current Matter 1.4 spec revision for this cluster — revision 4 already covers making UniqueID mandatory, so no further bump is needed.

Testing

Cherry-picked from #166 (verified there on an xiao_mg24 running a Matter bridge sketch; Home Assistant successfully discovered and created entities for all bridged endpoints).

@silabs-bozont Tamas Jozsi (silabs-bozont) added Community contribution PR contents contributed by the community Run CI Matter Run Matter specific build tests labels Jul 6, 2026
@github-actions github-actions Bot removed the Run CI Matter Run Matter specific build tests label Jul 6, 2026
@silabs-bozont Tamas Jozsi (silabs-bozont) added the Under review Request or issue under review label Jul 8, 2026
Comment thread libraries/Matter/src/devices/MatterDevice.cpp Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the quick fix - could you please squash your new commit into the previous one (so that we don't have a broken state on one)? Then I think we're all set for merging.

UniqueID became a mandatory attribute in Matter 1.4 for the
BridgedDeviceBasicInformation cluster. Its absence causes controllers such
as Home Assistant to fail to create entities for bridged endpoints — the
controller cannot stably identify a bridged device across re-pairings or
bridge restarts, so it refuses to add it.

Populate unique_id from getDeviceUniqueIdStr() at construction time,
giving each bridged endpoint a stable hardware-derived identity. Expose
SetUniqueID()/GetUniqueID() so sketches can override the value.

Co-Authored-By: Drew McCalmont <drewm@mcfamily.us>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@lboue

Copy link
Copy Markdown
Contributor Author

Thank you for the quick fix - could you please squash your new commit into the previous one (so that we don't have a broken state on one)? Then I think we're all set for merging.

Done

@silabs-bozont Tamas Jozsi (silabs-bozont) added the Run CI Matter Run Matter specific build tests label Jul 22, 2026
@github-actions github-actions Bot removed the Run CI Matter Run Matter specific build tests label Jul 22, 2026
@silabs-bozont
Tamas Jozsi (silabs-bozont) merged commit a98732c into SiliconLabsSoftware:main Jul 23, 2026
5 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 23, 2026
@silabs-akosj silabs-akosj removed the Under review Request or issue under review label Jul 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Community contribution PR contents contributed by the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants