Skip to content

How can we get Structure ID and Device ID after commissioning a Matter device #14

@JackeyPSSPL

Description

@JackeyPSSPL

Hello Team [@Vyrastas @erwinpan1 @aBozowski @YigitUyan @shannonhwu-google ]
We are integrating Google Home Mobile SDK to commission Matter devices via a Nest Hub (2nd Gen).

The commissioning flow works fine. The device is successfully added but the CommissioningResult object does not return deviceIds or any way to directly obtain the Device ID and Structure ID (home) after commissioning. it mean we know which device added recently into which home.

Currently our code looks like this:

lateinit var commissioningManager: CommissioningManager

commissioningManager =
    CommissioningManager(pageContext, pageContext.lifecycleScope, pageContext)

fun onAddDeviceClicked() {
    addHomeDeviceResultLauncher.let {
        commissioningManager.requestCommissioning(it)
    }
}

suspend fun commissioningCallback(activityResult: ActivityResult) {
    try {
        val result: CommissioningResult =
            CommissioningResult.fromIntentSenderResult(
                activityResult.resultCode,
                activityResult.data
            )

        // Store the result
        commissioningResult.emit(result)

        showToastMessage("Commissioning Success!")
    } catch (exception: ApiException) {
        showToastMessage("Commissioning Result: " + exception.status)
    }
}

Problem

  • result.deviceIds is always null or empty.
  • We need a way to get the Device ID and Structure ID immediately after commissioning, without polling HomeGraph indefinitely.

What we expect

  1. CommissioningResult should expose either:
  • deviceIds (populated after commissioning), or
  • a method to fetch the newly commissioned device ID + its associated home (structure ID).
  1. If that’s not possible immediately, guidance on the recommended way to map the commissioned device descriptor to a Device + Structure in HomeGraph.

Please find below image of CommissioningResult class value

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions