---
name: "SmartLampAdvancedAbility.convertDp"
mode: "api"
versionRequirements:
  - { name: "", version: "1.15.0" }
title: "convertDp — convert a DP value to a display value with units by DP code (brightness / color temperature)."
summary: "Converts the raw value for a given DP code to a display value with units; supports brightness and color temperature."
---

## SmartLampAdvancedAbility.convertDp

> [VERSION] v1.15.0+

> 💡 Supports both single devices and groups; internally calls getAdvanceHighEnabled first, then ty.device.dpTranslateAdvancedCapability.

### Description

Convert a raw DP value to a display value with unit by DP; supports bright_value, temp_value, color_temp_control.

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `dpCode` | `"color_temp_control" \| "temp_value" \| "bright_value"` | Yes | DP code |
| `dpValue` | `number` | Yes | Raw DP value |

### Return Value

Type: `ConvertValue \| null`

On success, returns the display value and unit; returns { value, unit: '' } when the advanced capability is not enabled; may be null if the cloud has no valid translation. Network required.

### Referenced Types

##### `type` ConvertValue

| Property | Type | Description |
| --- | --- | --- |
| `value` | `number` | Value |
| `unit` | `string` | Unit |


### Examples

#### Example

```typescript
const b = await sdm.lampAdv.convertDp('bright_value', 100);
const t = await sdm.lampAdv.convertDp('temp_value', 2700);
const m = await sdm.lampAdv.convertDp('color_temp_control', 2700);
```


**Notes**

1. This method detects whether advanced capability is enabled for the given DP code.
2. If advanced capability is off, it returns the raw value and an empty unit.
3. Conversion calls the cloud API `ty.device.dpTranslateAdvancedCapability`; network is required.
4. On Matter devices, use `color_temp_control` for color temperature.
5. On standard protocol devices, use `temp_value` for color temperature.
6. Internally calls `getAdvanceHighEnabled` first to check capability.
