Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

A raw_result is a type of MQTT message published by almost every data acquisition module of the SiteController to the MQTT topic raw_result/<gateway_id>, it contains the values read by the module, normally (but not restricted to) as numbers or strings, without any processing applied. A raw_result message can contain the value read from 1 or more sensors, the used format is always JSON. This type of messages are not retained in internal storage nor sent to the cloud.

A raw_result should comply with the following structure:

Code Block
languagejs
titleraw_result message structure
{
    "error_code": <int>,
    "result_dict": {
        "sensor_1": {
            "changed": <true | false>,
            "value": <value read from sensor/datapoint>data point>,
            "err_code": <int>,
            "err_desc": "<description<textual description of anthe error>"
        },
        "sensor_2": {
             ......
        },
        "sensor_3": {
             ......
        }
    },
    "partial": <true means this raw_result can contain just some sensors associated to the sensor_gateway, false or absent means all sensor are present in every raw_result message>,
    "sensor_gateway_id": "<identification of the gateway associated to this sensor group>",
    "timestamp": "<message timestamp in ISO8601 format>"
}

...

SC-1088

NamePurposeOptionalDefault value
error_codeError code classifying the whole raw_resultNo
result_dictdictionary with every sensor read, see the next table for more informationNo
partial

true means this raw_result can contain just some sensors associated to the sensor_gateway, false or absent means all sensor are present in every raw_result messageNote: Parameter added inĀ 

Jira Legacy
serverSystem JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId44da6023-248d-3348-aa75-5314a89d8310
keyYesFalse
sensor_gateway_idIdentification of the gateway associated to this sensor groupNo
valueTypeThis could be set to one of a list of specific data types to indicate the data values in result_dict have a special relationship (e.g. GPS coordinates, high frequency data samples, WiFi or Bluetooth scan data, ...)Yes
timestampMessage timestamp in ISO8601 formatYescurrent timestamp

Field result_dict

NamePurposeOptionalDefault value
changedMark the specific sensor as been changed in comparison with the last readingĀ No
valueValue readed read from the sensor, this can be a number, string or (in case of a set valueType in the raw_result object) any other valid JSON structure accoding to that valueType, boolean, string.No
err_codeInteger value representing a error about this specific sensor, 0 means no error, any other value means a error specific for the device, this value have higher relevance than error_code from raw_resultYes0
err_descTextual representation of the errorYes""

...

valueTypedescriptionFuther reading (e.g. Jira Ticket/Wiki page)
graphBlobhigh frequency sensor data sampleFAG smart check
wifiAccessPointsa list of WiFi Access points in rangeAP (wifi) scanner
beaconRaw
ble scanner
beaconCount

ble_estimote
ble scanner
ble_scanner
ble scanner

Example


Code Block
{
    "error_code": 0, 
    "result_dict": {
        "accuracy": {
            "changed": true, 
            "value": 1.1061637275660097
        }, 
        "mac": {
            "changed": false, 
            "value": "d9:cc:ba:9a:88:db"
        }, 
        "major": {
            "changed": false, 
            "value": 4463
        }, 
        "minor": {
            "changed": false, 
            "value": 12099
        }, 
        "proximity": {
            "changed": false, 
            "value": 1.0,
            "err_code": 1,
            "err_desc": "too close"
        }, 
        "rssi": {
            "changed": true, 
            "value": -77
        }, 
        "tx_power": {
            "changed": false, 
            "value": -76
        }, 
        "type": {
            "changed": false, 
            "value": "IBeaconAdvertisement"
        }, 
        "uuid": {
            "changed": false, 
            "value": "b9407f30-f5f8-466e-aff9-25556b57fe6d"
        }
    }, 
    "sensor_gateway_id": "ble_ibeacon", 
    "timestamp": "2018-05-18T15:04:35.097Z", 
    "valueType": "beaconRaw",
    "partial": false
}