|  Developer
Updated on May 24, 2022

hub.scenes.status.get

  • Version: 1.0
  • Feature version:
  • Updated in : added “blockName” to output of the command.
  • Updated in : added status of exception blocks to output of the command; changed the name of a property with a status of when blocks from “blocks” to “when”.
  • Classes: UI
  • Description: Returns states of a scene and of each when block or logical operator in the scene.
Edit
Field Type Required Description
sceneId string + Id of a scene
Edit
Field Type Required Description
_id string + Id of a scene
status object + Status of the scene and of all its children
status.state string + State of the whole scene. Possible statuses: , , , . is returned if the state can’t be read from DB
status.lastChange string + Time of the last change in status, local time. If state change time wasn’t recorded, is returned
status.error string / object Contains error information for corrupted scene
status.when array of objects + An array of when blocks’ states
status.exceptions array of objects + An array of exception blocks’ states
status.blocks[]._id string + Id of a when block
status.blocks[].name string + Name of an event or a logical operator (isItemState, compareNumbers; or, xor, function etc)
status.blocks[].blockName string Block name given by a user
status.blocks[].state string + State of a when block. Possible statuses: , , , . is returned if the state can’t be read from DB
status.blocks[].lastChange string + Time of the last change in status, local time. If state change time wasn’t recorded, is returned
status.blocks[].function object If the node is a function operator, contains information about it
status.blocks[].function.name string + If the node is a function operator, contains a function name (pulse, follow, latch, for, etc)
status.blocks[].function.isLatched boolean If the function is a latch, contains if a function is latched, otherwise
status.blocks[].blocks array of objects An array of statuses of nested when blocks if any
Edit
Code Message Data
-32602 Wrong params,
-32600 Bad request, is empty
-32600 Bad request, does not exist
-32500 The scene with this id does not exist
Edit
				
					{
    "id": "_ID_",
    "jsonrpc": "2.0",
    "method": "hub.scenes.status.get",
    "params": {
        "sceneId": "62863322000000c8c9dc3943"
    }
}				
			
Edit
				
					{
    "error": null,
    "id": "_ID_",
    "method": "hub.scenes.status.get",
    "result": {
        "_id": "62863322000000c8c9dc3943",
        "status": {
            "lastChange": "2022-05-19T15:13:34+0300",
            "state": "true",
            "when": [
                {
                    "_id": "62863329000000c8c9dc3944",
                    "name": "or",
                    "blockName": "some_group",
                    "state": "true",
                    "lastChange": "2022-05-19T15:13:02+0300",
                    "blocks": [
                        {
                            "_id": "62863329000000c8c9dc3945",
                            "name": "not",
                            "state": "true",
                            "lastChange": "2022-05-19T15:13:02+0300",
                            "blocks": [
                                {
                                    "_id": "62863329000000c8c9dc3946",
                                    "name": "isItemState",
                                    "state": "false",
                                    "lastChange": "2022-05-19T15:13:02+0300"
                                }
                            ]
                        },
                        {
                            "_id": "62863329000000c8c9dc3947",
                            "name": "compareNumbers",
                            "state": "false",
                            "lastChange": "2022-05-19T15:13:34+0300"
                        }
                    ]
                },
                {
                    "_id": "62863329000000c8c9dc3948",
                    "name": "function",
                    "state": "false",
                    "lastChange": null,
                    "function": {
                        "name": "follow"
                    },
                    "blocks": [
                        {
                            "_id": "62863329000000c8c9dc3949",
                            "lastChange": null,
                            "name": "compareNumbers",
                            "state": "false"
                        }
                    ]
                }
            ],
            "exceptions": [
                {
                    "_id": "6286332a000000c8c9dc394a",
                    "name": "and",
                    "blockName": "some_exceptions",
                    "state": "true",
                    "lastChange": "2022-05-19T15:14:02+0300",
                    "blocks": [
                        {
                            "_id": "6286332a000000c8c9dc394b",
                            "name": "isItemState",
                            "state": "true",
                            "lastChange": "2022-05-19T15:14:02+0300"
                        }
                    ]
                }
            ],
        }
    }
}