Environmental Measurements


Push all environmental measurements to the macro so it is displayed in the Android App window
var output = {};

if (typeof json.temperature != "undefined") {                 // check to see if each of these variables exists before passing it to the macro (otherwise you get an error)
	output["Temp"] = json.temperature;           // save temperature as macro output
}
if (typeof json.light_intensity != "undefined") {
	output["Light"] = json.light_intensity
}
if (typeof json.co2 != "undefined") {
	output["CO2"] = json.co2
}
if (typeof json.relative_humidity != "undefined") {
	output["Rel Humidity"] = json.relative_humidity
}
if (typeof json.analog_read != "undefined") {
	output["Analog Read"] = json.analog_read
}
if (typeof json.light_intensity_raw != "undefined") {
	output["Raw Light"] = json.light_intensity_raw
}
if (typeof json.contactless_temperature != "undefined") {
	output["Leaf Temp"] = json.contactless_temperature
}
  

//Return data
return output;
{
  "time_offset": 300,
  "time": 1422625274239,
  "device_id": 66,
  "firmware_version": "0.360",
  "sample": [
    [
      {
        "time": 1422625274239,
        "protocol_id": "94",
        "relative_humidity": 19.11,
        "co2": 691,
        "temperature": 21.97,
        "data_raw": [

        ]
      }
    ],
    [
      {
        "time": 1422625276509,
        "protocol_id": "94",
        "relative_humidity": 19.09,
        "co2": 688,
        "temperature": 21.98,
        "data_raw": [

        ]
      }
    ]
  ]
}
012409 pbi 160 low low res headshot
Created by

Greg Austic


Protocol connections:
2
Latest Update:
Jan 2015