HTTP JSON Sensor Data: Unterschied zwischen den Versionen

Aus Gude Systems GmbH
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „*all Sensor data is available in a generic JSON Object presentet by status.json *there are two relevant sub-objects: sensor_values and sensor_descr *sensor_des…“)
 
Zeile 14: Zeile 14:
  
 
A sensor description might look like this:
 
A sensor description might look like this:
[
+
*all Sensor data is available in a generic JSON Object presentet by status.json
  {
+
*there are two relevant sub-objects: sensor_values and sensor_descr
"num": 2,
+
*sensor_descr can tell:
"type": 9
+
**what sensor types are actually relevent
"fields": [{
+
**what is type-specifiv sensor-field descripton
"decPrecision": 3,
+
**how many sensors of each type are actually present
"name": "Voltage",
+
**what are the names of each of such sensors
"unit": "V"
+
*sensor_values tells you about the sensor values, matching the description explained above
}, {
+
*it's common practice to get sensor_descr+sensor_values once, and poll sensor_values only subsequently
"decPrecision": 3,
+
 
"defaultDisplay": 1,
+
*HTTP-Get status.json?components=8470528
"msgCfgType": 1,
+
**here, 8470528 sums up sensor_values (16384 aka 0x10000) plus sensor_descr (65536 aka 0x4000), plus the ‘extended’ marker (0x800000) to get both simple sensors and complex sensor groups
"name": "Current",
+
**0x4000 + 0x10000 + 0x800000 = 8470528
"unit": "A"
+
 
}],
+
A sensor description might look like this:
"properties": [{
+
  [
"id": "L1",
+
    {
"name": "Meter1",
+
      "type": 664,
"state": 1,
+
      "num": 2,
"statistics": []
+
      "fields": [
}]
+
        {"name": "Voltage", "unit": "V", "decPrecision": 3},
}],
+
        {"name": "Current", "unit": "A", "decPrecision": 1}
 +
      ]
 +
      "properties": [
 +
        { "id": "L1", "name": "Meter1", "state": 1},
 +
        { "id": "L2", "name": "Meter2", "state": 1},
 +
      ]
 +
    },
 +
    {
 +
      "type": 665,
 +
      "num": 1,
 +
      "fields": [
 +
        {"name": "Temperature", "unit": "C", "decPrecision": 1},
 +
        {"name": "Humidity",   "unit": "%", "decPrecision": 1}
 +
      ]
 +
      "properties": [
 +
        { "id": "6102", "name": "Server-Rack", "state": 1}
 +
      ]
 +
    }
 +
  ]

Version vom 1. April 2021, 12:44 Uhr

  • all Sensor data is available in a generic JSON Object presentet by status.json
  • there are two relevant sub-objects: sensor_values and sensor_descr
  • sensor_descr can tell:
    • what sensor types are actually relevent
    • what is type-specifiv sensor-field descripton
    • how many sensors of each type are actually present
    • what are the names of each of such sensors
  • sensor_values tells you about the sensor values, matching the description explained above
  • it's common practice to get sensor_descr+sensor_values once, and poll sensor_values only subsequently
  • HTTP-Get status.json?components=8470528
    • here, 8470528 sums up sensor_values (16384 aka 0x10000) plus sensor_descr (65536 aka 0x4000), plus the ‘extended’ marker (0x800000) to get both simple sensors and complex sensor groups
    • 0x4000 + 0x10000 + 0x800000 = 8470528

A sensor description might look like this:

  • all Sensor data is available in a generic JSON Object presentet by status.json
  • there are two relevant sub-objects: sensor_values and sensor_descr
  • sensor_descr can tell:
    • what sensor types are actually relevent
    • what is type-specifiv sensor-field descripton
    • how many sensors of each type are actually present
    • what are the names of each of such sensors
  • sensor_values tells you about the sensor values, matching the description explained above
  • it's common practice to get sensor_descr+sensor_values once, and poll sensor_values only subsequently
  • HTTP-Get status.json?components=8470528
    • here, 8470528 sums up sensor_values (16384 aka 0x10000) plus sensor_descr (65536 aka 0x4000), plus the ‘extended’ marker (0x800000) to get both simple sensors and complex sensor groups
    • 0x4000 + 0x10000 + 0x800000 = 8470528

A sensor description might look like this:

 [
   {
     "type": 664,
     "num": 2,
     "fields": [
        {"name": "Voltage", "unit": "V", "decPrecision": 3},
        {"name": "Current", "unit": "A", "decPrecision": 1}
     ]
     "properties": [
       { "id": "L1", "name": "Meter1", "state": 1},
       { "id": "L2", "name": "Meter2", "state": 1},
     ]
   },
   {
     "type": 665,
     "num": 1,
     "fields": [
        {"name": "Temperature", "unit": "C", "decPrecision": 1},
        {"name": "Humidity",    "unit": "%", "decPrecision": 1}
     ]
     "properties": [
       { "id": "6102", "name": "Server-Rack", "state": 1}
     ]
   }
 ]