---
name: "getMatterRoad"
mode: "api"
versionRequirements:
  - { name: "", version: "1.15.0" }
title: "getMatterRoad"
summary: "Infer Matter lighting road count (1–5) or 0 if unknown from DP schema."
questions:
  - "Which DP combinations define roads 1 through 5?"
  - "What does a return value of 0 mean?"
---

## getMatterRoad

> [VERSION] v1.15.0+

> 💡 - **1 channel**: brightness_control
> - **2 channels**: brightness_control + color_temp_control
> - **3 channels**: hs_color_set + brightness_control
> - **4 channels**: hs_color_set + brightness_control + bright_value (depends on schema tag)
> - **5 channels**: hs_color_set + brightness_control + color_temp_control

### Description

Infer the number of channels of a Matter lighting device from the DP schema.

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `schemaObj` | `Record<string, DpSchema>` | Yes | dpSchema object |
| `force` | `boolean` | No | If matter-kit is not integrated, pass true to detect 4 channels by reading hasBrightValueCode on brightness_control |

### Return Value

None


### Referenced Types

##### `interface` DpSchema

| Property | Type | Description |
| --- | --- | --- |
| `attr` | `number` | DP attribute flag bit, used to mark additional capabilities of the DP |
| `canTrigger` | `boolean` | Whether it can be used as an automation trigger condition |
| `code` | `string` | DP code, e.g., switch |
| `defaultRecommend` | `boolean` | Whether it is the default recommended DP |
| `editPermission` | `boolean` | Whether it has edit permission |
| `executable` | `boolean` | Whether it can be issued (sent downstream) |
| `extContent` | `string` | DP extension content, typically a JSON string |
| `iconname` | `string` | DP icon name |
| `id` | `string \| number` | DP ID |
| `mode` | `"rw" \| "ro" \| "wr"` | DP mode type rw: writable and reportable (read/write) ro: report-only (read-only) wr: write-only |
| `name` | `string` | DP name, typically used in voice scenarios |
| `property` | `Object` | DP attributes |
| `type` | `"raw" \| "obj"` | DP data type categories: raw for raw byte stream, obj for structured object |

##### `type` DpSchema.property

| Property | Type | Description |
| --- | --- | --- |
| `type` | `"string" \| "bool" \| "value" \| "enum" \| "bitmap" \| "raw"` | DP type |
| `range` | `string[] \| string[]` | Enum value range; present only when type = enum |
| `label` | `string[] \| string[]` | Fault label list; present only when type = bitmap |
| `maxlen` | `number` | Maximum length for fault bitmap; present only when type = bitmap |
| `unit` | `string` | Unit (type = value only) |
| `min` | `number` | Minimum value (type = value only) |
| `max` | `number` | Maximum value (type = value only) |
| `scale` | `number` | Precision (type = value only) |
| `step` | `number` | Step (type = value only) |


### Examples

#### Example

```ts
import { createMatterKit, useDpSchema } from '@ray-js/panel-sdk';

const matterKit = createMatterKit();
const dpSchema = useDpSchema();
const road = matterKit.utils.getMatterRoad(dpSchema);
```
