---
name: "SmartLampAdvancedAbility.convertTemperature"
mode: "api"
versionRequirements:
  - { name: "", version: "1.15.0" }
title: "convertTemperature — convert color temperature; with advanced color temp enabled, returns a display value with units (e.g. 2700K), otherwise the raw value."
summary: "Converts color temperature; when advanced color temperature is enabled, returns a display value with units (e.g. 2700K)."
---

## SmartLampAdvancedAbility.convertTemperature

> [VERSION] v1.15.0+

### Description

Convert color temperature value: if the device has the advanced color temperature capability enabled, return a display value with unit (e.g., 2700K); otherwise return the raw value and an empty unit.

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `temperature` | `number` | Yes | Raw color temperature value (panel-side value, e.g., 2700) |

### Return Value

Type: `ConvertValue`

Converted value and unit; unit is an empty string when the advanced capability is not enabled. Depends on the cloud dpTranslateAdvancedCapability; network required.

**`type` ConvertValue**

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

### Referenced Types

##### `type` ConvertValue

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


### Examples

#### Example

```typescript
const result = await sdm.lampAdv.convertTemperature(2700);
console.log('Color temperature:', result.value, result.unit);
```


**Notes**

1. This method detects whether advanced color temperature is enabled.
2. If advanced capability is off, it returns the raw value and an empty unit.
3. On Matter devices, `color_temp_control` is used for conversion.
4. On standard protocol devices, `temp_value` is used for conversion.
5. Conversion uses a cloud API; network is required.
