calc_sensors_last
The unit/calc_sensors_last request is used to add the ability to calculate unit sensor values from cache. Depending on the Last message only option in the settings of each sensor, cache may mean either the last known unit parameters or the last message.
svc=unit/calc_sensors_last¶ms={"unitId":<long>, "sensorId":<long>}
Parameters
Parameter | Description |
---|---|
unitId | Unit ID |
sensorId | Sensor ID |
Example
svc=unit/calc_sensors_last¶ms={"unitId":1532, "sensorId":15}
Response
If the request is completed successfully, a response with sensor values is returned. A response example:
{
"6": {
"value": "25701",
"format": {
"value": "A1-Velcom (BY) (25701)"
}
}
}
If the request hasn’t been completed, an error code is returned.
Error codes
Error code | Description |
---|---|
4 | Invalid input parameters. |
5 | Error obtaining the last value. |
7 | The user doesn't have the required access right to the unit (ADF_ACL_AVL_UNIT_VIEW_SENSORS). |