v1.0 sensors continuous read


measures all environmental sensors as continuous read using "environmental_array" call in API.
//============================================
// Macro for data evaluation on PhotosynQ.org
// created: 30/05/2016
//============================================

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

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

	//Add key time and value to output
	output["time"] = json.time;
	output["light_intensity"] = json.light_intensity;
	output["r"] = json.r;
	output["g"] = json.g;
	output["b"] = json.b;
	output["light_intensity_raw"] = json.light_intensity_raw;
	output["contactless_temp"] = json.contactless_temp;
	output["thickness"] = json.thickness;
	output["thickness_raw"] = json.thickness_raw;
	output["temperature"] = json.temperature;
	output["humidity"] = json.humidity;
	output["pressure"] = json.pressure;
	output["temperature2"] = json.temperature2;
	output["humidity2"] = json.humidity2;
	output["pressure2"] = json.pressure2;
	output["compass"] = json.compass;
	output["angle"] = json.angle;
	output["analog_read"] = json.analog_read;
	output["detector_read1"] = json.detector_read1;
}

//Return data
return output;
{
  "time_offset": 240,
  "time": 1464662954442,
  "device_version": "1",
  "device_id": "d4:f5:00:00:00:00",
  "device_battery": 48,
  "device_firmware": "0.55",
  "firmware_version": "0.55",
  "device_time": 1464618963,
  "sample": [
    [
      {
        "time": 1464662954456,
        "protocol_id": 1,
        "temperature": [
          "22.770000",
          "22.770000",
          "22.770000",
          "22.770000",
          "22.770000",
          "22.770000",
          "22.770000",
          "22.770000",
          "22.770000",
          "22.770000"
        ],
        "humidity": [
          "66.000000",
          "66.000000",
          "66.000000",
          "66.000000",
          "66.000000",
          "66.000000",
          "66.000000",
          "66.000000",
          "66.000000",
          "66.000000"
        ],
        "pressure": [
          "668.909973",
          "668.909973",
          "668.909973",
          "668.909973",
          "668.909973",
          "668.909973",
          "668.909973",
          "668.909973",
          "668.909973",
          "668.909973"
        ],
        "temperature2": [
          "23.420000",
          "23.420000",
          "23.420000",
          "23.420000",
          "23.420000",
          "23.420000",
          "23.420000",
          "23.420000",
          "23.420000",
          "23.420000"
        ],
        "humidity2": [
          "64.000000",
          "64.000000",
          "64.000000",
          "64.000000",
          "64.000000",
          "64.000000",
          "64.000000",
          "64.000000",
          "64.000000",
          "64.000000"
        ],
        "pressure2": [
          "709.609985",
          "709.609985",
          "709.609985",
          "709.609985",
          "709.609985",
          "709.609985",
          "709.609985",
          "709.609985",
          "709.609985",
          "709.609985"
        ],
        "contactless_temp": [
          "26.750000",
          "26.470001",
          "26.709991",
          "26.709991",
          "26.850006",
          "26.570007",
          "26.709991",
          "26.790009",
          "26.570007",
          "26.709991"
        ],
        "light_intensity": [
          "-8.000000",
          "0.000000",
          "0.000000",
          "0.000000",
          "0.000000",
          "0.000000",
          "1.000000",
          "0.000000",
          "0.000000",
          "0.000000"
        ],
        "light_intensity_raw": [
          "30.000000",
          "3.000000",
          "4.000000",
          "5.000000",
          "10.000000",
          "3.000000",
          "10.000000",
          "9.000000",
          "3.000000",
          "5.000000"
        ],
        "r": [
          "27.000000",
          "3.000000",
          "4.000000",
          "4.000000",
          "9.000000",
          "3.000000",
          "8.000000",
          "8.000000",
          "3.000000",
          "5.000000"
        ],
        "g": [
          "23.000000",
          "2.000000",
          "2.000000",
          "2.000000",
          "5.000000",
          "2.000000",
          "4.000000",
          "4.000000",
          "2.000000",
          "3.000000"
        ],
        "b": [
          "23.000000",
          "2.000000",
          "2.000000",
          "2.000000",
          "4.000000",
          "2.000000",
          "4.000000",
          "4.000000",
          "2.000000",
          "3.000000"
        ],
        "thickness": [
          "65535.000000",
          "65535.000000",
          "65535.000000",
          "65535.000000",
          "65535.000000",
          "65535.000000",
          "65535.000000",
          "65535.000000",
          "65535.000000",
          "65535.000000"
        ],
        "thickness_raw": [
          "65535.000000",
          "65535.000000",
          "65535.000000",
          "65535.000000",
          "65535.000000",
          "65535.000000",
          "65535.000000",
          "65535.000000",
          "65535.000000",
          "65535.000000"
        ],
        "analog_read": [
          "30212.000000",
          "29816.000000",
          "29506.000000",
          "29314.000000",
          "30120.000000",
          "29652.000000",
          "29853.000000",
          "29759.000000",
          "29733.000000",
          "29815.000000"
        ],
        "detector_read1": [
          "1387.000000",
          "1389.000000",
          "1390.000000",
          "1388.000000",
          "1391.000000",
          "1392.000000",
          "1396.000000",
          "1393.000000",
          "1392.000000",
          "1387.000000"
        ],
        "compass": [
          "357.505646",
          "256.382690",
          "132.352585",
          "177.559311",
          "345.429352",
          "205.759247",
          "143.051743",
          "323.568237",
          "214.013504",
          "154.901718"
        ],
        "angle": [
          "171.386932",
          "101.199173",
          "71.972130",
          "25.552994",
          "158.810455",
          "82.918213",
          "29.076370",
          "146.719513",
          "80.912109",
          "16.669075"
        ],
        "data_raw": [
          44715,
          48139,
          48613,
          48613,
          48614,
          48614,
          48612,
          48614,
          48613,
          48611
        ]
      }
    ]
  ],
  "app_os": "linux",
  "app_name": "PhotosynQ",
  "app_version": "0.3.3",
  "app_device": "x86-64",
  "location": [
    "42.2779507",
    "-83.8188371"
  ],
  "ConsoleMacro": "14",
  "notes": "first test of continous sensor reading using \"environmental_array\""
}
012409 pbi 160 low low res headshot
Created by

Greg Austic


Protocol connections:
3
Latest Update:
May 2016