Scene events
Field paths are relative to one object in the message array. [] means an array item: for example, services[].rid is the rid of each service. Fields under value are shown as value.name, value.color_arr[].x, and so on.
Scene added
Topic
res/scene/add
Example message
json
[
{
"id": "AE017B91-75BF-4CC6-9EC7-F2C48DDC11FD",
"type": "scene",
"name": "瓦尔登湖",
"parent_id": "2F0B3B6D-CE40-4A2F-A529-A2DE3EDD9C62",
"parent_type": "group_light",
"room_uuid": "6B703F4A-A2A2-4F3C-82D6-BDD4E8BA8B1C",
"brightness": 0,
"scene_type": 2,
"is_active": 0,
"sequence": 0,
"number": 4885848,
"icon": "",
"background": "",
"colors": [
4293473571,
4293687116,
4294026836,
4294432128,
4287352825
],
"picture_id": "25967925-FC78-4C1F-A8CB-33E5A3DD17A5",
"picture_type": "file",
"picture_url": "http://192.168.41.104:8000/33E5A3DD17A5.png",
"device_arr": [
{
"ext_light": [],
"id": "10E48D35-0ABD-47EB-BA4B-C150D68C4B23",
"type": "device"
}
]
}
]Fields
| Field | Type | Description |
|---|---|---|
id | string | Scene UUID. |
type | string | Always scene. |
name | string | Scene name |
parent_id | string | UUID of the parent group_light resource. |
parent_type | string | Always group_light. |
room_uuid | string | Room UUID. |
brightness | integer | Scene brightness. |
scene_type | integer | 1: color scene; 2: image scene. |
is_active | integer | 1 if the scene is active; otherwise 0. |
sequence | integer | Scene sequence number |
number | integer | Scene library index. |
icon | string | Scene icon; currently unused. |
background | string | Scene background; currently unused. |
colors | integer[] | Five scene colors. |
picture_id | string | UUID of the image resource. |
picture_type | string | Always file. |
picture_url | string | Image URL. |
device_arr | object[] | Per-device colors for this scene. |
Event details
- Sent when a new scene is created.
Scene deleted
Topic
res/scene/remove
Example message
json
[
{
"id": "AE017B91-75BF-4CC6-9EC7-F2C48DDC11FD",
"type": "scene"
}
]Fields
| Field | Type | Description |
|---|---|---|
id | string | Scene UUID. |
type | string | Always scene. |
Event details
- Sent when a scene is deleted.
Scene updated
Topic
res/scene/update
Example message
json
[
{
"id": "AE017B91-75BF-4CC6-9EC7-F2C48DDC11FD",
"room_id": "6B703F4A-A2A2-4F3C-82D6-BDD4E8BA8B1C",
"value": {
"is_active": 1
}
}
]Fields
| Field | Type | Description |
|---|---|---|
id | string | Scene UUID. |
room_id | string | Room UUID. |
value | object | Fields changed by this event. |
Fields in value
| Field | Type | Description |
|---|---|---|
value.name | string | Scene name |
value.picture_id | string | Image UUID |
value.picture_type | string | Always file. |
value.picture_url | string | Image URL. |
value.sequence | integer | Scene sequence number |
value.icon | string | Scene icon |
value.background | string | Scene background image |
value.colors | integer[] | Five scene colors. |
value.is_active | integer | 1 if active; otherwise 0. |
Event details
- Sent when the scene's properties change. The
valueobject contains only the changed fields. - Apply the fields in
valueto your local state. Fields absent from the message have not changed.