Get Lift Position
The GET_LIFT_POSITION
command retrieves the current status of the lift, including its floor position and whether it is in motion. This command provides real-time insights but is served on a best-effort basis depending on system availability.
WebSocket API
Command
- Command:
GET_LIFT_POSITION
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
command | String | Yes | GET_LIFT_POSITION |
requestId | String | Yes | Unique identifier for the request |
Response
Field | Type | Description |
---|---|---|
requestId | String | Matches the ID in the original request |
status | String | Status of the request (success /error ) |
code | String | Expect GET_LIFT_POSITION_OK if successful, otherwise error code |
info.currentFloor | Integer | The current floor the lift is on |
info.isMoving | Boolean | Indicates whether the lift is in motion |
Example Request
{
"requestId": "a1b2c3d9",
"command": "GET_LIFT_POSITION"
}
Expected Response
- On Success:
{
"requestId": "a1b2c3d9",
"code": "GET_LIFT_POSITION_OK",
"info": {
"isMoving": false,
"currentFloor": 1
}
}
- On Error:
{
"request_id": "a1b2c3d9",
"status": "error",
"error_code": "LIFT_NOT_FOUND",
"message": "The specified lift ID does not exist."
}