Soil Moisture - GS1


Outputs volumetric water content (%) for the GS1 soil moisture sensor.
/**
 * Macro for data evaluation on PhotosynQ.org
 * by: Dan TerAvest
 * created: June 26, 2017 1:00 PM
 */

// Define the output object here
var output = {};

output["VWC"] = MathROUND((0.0029 * json.analog_read) - 62.048);


// Check if the key time exists in json
if (json.time !== undefined){

	// Add key time and value to output
	output["time"] = json.time;
}

// Return data
return output;
{
  "time": "1498567956681",
  "device_name": "MultispeQ",
  "device_version": "1",
  "device_id": "ff:ff:ff:ff",
  "device_battery": -241,
  "device_firmware": 1.17,
  "sample": [
    [
      {
        "time": "1498567956692",
        "protocol_id": 1,
        "analog_read": 27419,
        "data_raw": [

        ]
      }
    ]
  ],
  "app_os": "win32-10.0.15063",
  "app_name": "PhotosynQ",
  "app_version": "0.0.14",
  "app_device": "ia32",
  "location": [
    "42.7226177",
    "-84.4746407"
  ],
  "time_offset": "America/New_York"
}
Sam 0645   copy   copy  2
Created by

Dan TerAvest


Protocol connections:
1
Latest Update:
Jun 2017