Versions Compared

Key

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

...


Code Block
languagepy
themeDJango
titleGet 5 seconds of readings from a CTD
from onc.onc import ONC
onc = ONC('YOUR_TOKEN_HERE')

filters = {
  'locationCode': 'JDATF',
  'deviceCategoryCode': 'CTD',
  'propertyCode': 'conductivity',
  'dateFrom': '2019-06-20T00:00:00.000Z',
  'dateTo': '2019-06-20T00:00:05.000Z'
}
result = onc.getDirectScalargetDirectByLocation(filters)
onc.print(result)



Code Block
languagepy
themeConfluence
titleResult
"sensorData": [
  {
    "data": {
      "qaqcFlags": [1,1,1,1,1],
      "sampleTimes": [
        "2019-06-20T00:00:00.060Z",
        "2019-06-20T00:00:01.060Z",
        "2019-06-20T00:00:02.060Z",
        "2019-06-20T00:00:03.060Z",
        "2019-06-20T00:00:04.060Z"
      ],
      "values": [3.3043, 3.3045, 3.3047, 3.3044, 3.3046]
   },
   "sensorName": "Conductivity",
   "unitOfMeasure": "S/m"
   (...)


...