Access Measurements

Concept

The global measurements object allows you to access the device's current measurements. It is structured like this:
1
{
2
"BATTERY": {
3
"field_name": "BATTERY",
4
"timestamp": "1600378287",
5
"value": 3.301
6
},
7
"SOIL_CONDUCTIVITY": {
8
"field_name": "SOIL_CONDUCTIVITY",
9
"timestamp": "1600378287",
10
"value": 121
11
}
12
}
Copied!

Code Example

1
function decoder() {
2
3
// get current value from field in Database
4
var field_in_db = measurements.FIELD_IN_DB.value;
5
6
}
Copied!
Last modified 1yr ago
Export as PDF
Copy link