Action Required! Starting November 21st, 2022, Nest Hubs opted into the Preview Program are being updated to support Matter 1.0 in anticipation of Google's general availability (GA) of Matter. All Matter devices being used with the Preview Program will need to be updated. See the Release Notes for more details.

CommissioningClient

Stay organized with collections Save and categorize content based on your preferences.
public interface CommissioningClient implements HasApiKey<Api.ApiOptions.NoOptions> OptionalModuleApi

Performs commissioning of Matter devices (both initial out of box commissioning, as well as multi-administrator commissioning flows).

Public Method Summary

abstract Task<IntentSender>
commissionDevice(CommissioningRequest request)
Commission a new device into one or more fabrics.
abstract Task<IntentSender>
shareDevice(ShareDeviceRequest request)
Returns an IntentSender which can be used to display a sharing UI, which allows the user to grant administrative control of a Matter device to another user (via text) or application.

Public Methods

public abstract Task<IntentSender> commissionDevice (CommissioningRequest request)

Commission a new device into one or more fabrics. In the CommissioningRequest, if no commissioning service is specified, then the device will be commissioned for use within Google (Google Assistant, Google Home).

If you already know the particular device that you are looking for, then you can specify this via the DeviceInfo in the request to limit which device will be set up during this commissioning process.

Alternatively, if you already have proof of possession of a device (e.g. from a manually entered passcode, shared passcode, or QR code) you can specify this in the request via the onboarding payload to target a specific device, and bypass the need to scan a QR code or enter a passcode during commissioning.

Upon success, the activity result will contain a CommissioningResult in the result data including details about the device which was commissioned.

If this is called when Build.VERSION.SDK_INT is lower than Build.VERSION_CODES.O_MR1, then the Task will fail with an ApiException with the status code CommonStatusCodes.DEVELOPER_ERROR.

public abstract Task<IntentSender> shareDevice (ShareDeviceRequest request)

Returns an IntentSender which can be used to display a sharing UI, which allows the user to grant administrative control of a Matter device to another user (via text) or application.

Upon receiving an IntentSender, it should be started for result. At this point, it is expected that the shared device already has an opened commissioning window, the details of which must be provided in the request.

If the user chooses a sharing destination, then the result will be RESULT_OK, and no further action should be taken (note that this does not mean that the user has commissioned the device -- only that the information has been sent elsewhere). Upon receiving a result of RESULT_CANCELED, you should revoke the opened commissioning window on the device.

If this is called when Build.VERSION.SDK_INT is lower than Build.VERSION_CODES.O_MR1, then the Task will fail with an ApiException with the status code CommonStatusCodes.DEVELOPER_ERROR.