Skip to content

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 ​

FieldTypeDescription
idstringScene UUID.
typestringAlways scene.
namestringScene name
parent_idstringUUID of the parent group_light resource.
parent_typestringAlways group_light.
room_uuidstringRoom UUID.
brightnessintegerScene brightness.
scene_typeinteger1: color scene; 2: image scene.
is_activeinteger1 if the scene is active; otherwise 0.
sequenceintegerScene sequence number
numberintegerScene library index.
iconstringScene icon; currently unused.
backgroundstringScene background; currently unused.
colorsinteger[]Five scene colors.
picture_idstringUUID of the image resource.
picture_typestringAlways file.
picture_urlstringImage URL.
device_arrobject[]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 ​

FieldTypeDescription
idstringScene UUID.
typestringAlways 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 ​

FieldTypeDescription
idstringScene UUID.
room_idstringRoom UUID.
valueobjectFields changed by this event.

Fields in value

FieldTypeDescription
value.namestringScene name
value.picture_idstringImage UUID
value.picture_typestringAlways file.
value.picture_urlstringImage URL.
value.sequenceintegerScene sequence number
value.iconstringScene icon
value.backgroundstringScene background image
value.colorsinteger[]Five scene colors.
value.is_activeinteger1 if active; otherwise 0.

Event details ​

  • Sent when the scene's properties change. The value object contains only the changed fields.
  • Apply the fields in value to your local state. Fields absent from the message have not changed.