getLightAppAiRuleNames(data: GetLightAppAiRuleNamesParams)
Requires:
@tuya-miniapp/cloud-api≥1.2.0
Description
Get the list of AI lighting scene names on the App side. This API returns the lighting scenes available for a specified room, including basic scenes (on/off) and DIY scenes. Each item includes the scene name, color, icon, turn-on percentage, and an optional scene data list.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Yes | Request parameters: ownerId (Home ID), roomId (Room ID), sceneType (scene type: 1 basic scene on, 2 basic scene off, 3 DIY scene) |
Return Value
Type: Promise<GetLightAppAiRuleNamesResult>
Array of scene info objects (nameRosettaKey, name, turnOnPercent, color, icon, sceneDataList, id, etc.; see the Return Parameters table and the SceneData structure for details)
Referenced Types
type
GetLightAppAiRuleNamesResultExamples
Request example
Response example
Additional notes
- The
sceneDataListfield distinguishes scene types:- When it has data: the scene is a scene-library scene; you can send
sceneDatato the device directly. - When it has no data or is empty: the scene is an AI generative style scene and needs further handling.
- When it has data: the scene is a scene-library scene; you can send
- The returned scene list is generated dynamically based on device capabilities in the room. Different rooms may return different lists.
- The
turnOnPercentfield indicates what proportion of lights will be turned on in this scene, useful for UI or scene descriptions. - The
colorfield is a hexadecimal color value without the#prefix. Add#when using it, for example#50657A.