lights stepping up


var data = json.data_raw;
var output = {};

/* Pull out average value, skipping the first and last 2 points */
var response_1 = MathROUND(MathMEDIAN(json.data_raw.slice(2,298)),0); 
var response_2 = MathROUND(MathMEDIAN(json.data_raw.slice(302,598)),0); 
var response_3 = MathROUND(MathMEDIAN(json.data_raw.slice(602,898)),0); 
var response_4 = MathROUND(MathMEDIAN(json.data_raw.slice(902,1198)),0); 
var response_5 = MathROUND(MathMEDIAN(json.data_raw.slice(1202,1498)),0); 
var response_6 = MathROUND(MathMEDIAN(json.data_raw.slice(1502,1798)),0); 
var response_7 = MathROUND(MathMEDIAN(json.data_raw.slice(1802,2098)),0); 
var response_8 = MathROUND(MathMEDIAN(json.data_raw.slice(2102,2398)),0); 
var response_9 = MathROUND(MathMEDIAN(json.data_raw.slice(2402,2698)),0); 
var response_10 = MathROUND(MathMEDIAN(json.data_raw.slice(2702,2998)),0); 


/*outputs*/
output["1"]=response_1; 
output["2"]=response_2; 
output["3"]=response_3; 
output["4"]=response_4; 
output["5"]=response_5;
output["6"]=response_6; 
output["7"]=response_7; 
output["8"]=response_8; 
output["9"]=response_9; 
output["10"]=response_10;


return output;
{
  "time_offset": 300,
  "time": 1485459392665,
  "device_version": "1",
  "device_id": "d4:f5:00:00:00:02",
  "device_battery": 85,
  "device_firmware": "1.14",
  "firmware_version": "1.14",
  "device_time": 1484316799,
  "sample": [
    {
      "time": 1485459392677,
      "protocol_id": 1,
      "message": [
        [
          "alert",
          " Place main body lights over the soil",
          "ok"
        ],
        [
          "0",
          "0",
          ""
        ],
        [
          "0",
          "0",
          ""
        ],
        [
          "0",
          "0",
          ""
        ],
        [
          "0",
          "0",
          ""
        ],
        [
          "alert",
          " Switch to clamp side",
          "ok"
        ],
        [
          "0",
          "0",
          ""
        ],
        [
          "0",
          "0",
          ""
        ],
        [
          "0",
          "0",
          ""
        ],
        [
          "0",
          "0",
          ""
        ]
      ],
      "recall": {
        "time": 1485459397191,
        "userdef[1]": 365,
        "userdef[2]": 368.5,
        "userdef[3]": 413.5,
        "userdef[4]": 486,
        "userdef[5]": 564,
        "userdef[6]": 655.5,
        "userdef[7]": 727.5,
        "userdef[8]": 809
      },
      "data_raw": [
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        6981,
        12349,
        12386,
        12377,
        12393,
        12396,
        12379,
        12383,
        12388,
        12359,
        12375,
        12393,
        12391,
        12424,
        12402,
        12385,
        12392,
        12425,
        12402,
        12388,
        9724,
        14256,
        14295,
        14303,
        14294,
        14307,
        14295,
        14303,
        14305,
        14297,
        14306,
        14299,
        14301,
        14304,
        14299,
        14300,
        14298,
        14304,
        14300,
        14308,
        8921,
        12494,
        12520,
        12517,
        12521,
        12519,
        12520,
        12521,
        12516,
        12521,
        12523,
        12512,
        12515,
        12506,
        12503,
        12501,
        12491,
        12495,
        12486,
        12487,
        3201,
        16910,
        16946,
        16908,
        16857,
        16823,
        16802,
        16771,
        16765,
        16742,
        16726,
        16717,
        16711,
        16692,
        16690,
        16687,
        16683,
        16683,
        16672,
        16677,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        36494,
        13438,
        13200,
        13176,
        13166,
        13155,
        13145,
        13135,
        13131,
        13125,
        13111,
        13109,
        13106,
        13100,
        13107,
        13091,
        13096,
        13095,
        13087,
        13084,
        41137,
        12308,
        11928,
        11882,
        11868,
        11855,
        11845,
        11846,
        11834,
        11834,
        11830,
        11818,
        11819,
        11814,
        11813,
        11812,
        11798,
        11803,
        11800,
        11789,
        25683,
        15175,
        15042,
        15030,
        15014,
        15020,
        15014,
        15017,
        15019,
        15011,
        15017,
        15015,
        15011,
        15015,
        15010,
        15013,
        15017,
        15009,
        15017,
        15015,
        24320,
        19330,
        19263,
        19264,
        19263,
        19255,
        19259,
        19253,
        19255,
        19262,
        19255,
        19260,
        19259,
        19264,
        19264,
        19260,
        19265,
        19267,
        19259,
        19268
      ]
    }
  ],
  "app_os": "win",
  "app_name": "PhotosynQ",
  "app_version": "0.3.6",
  "app_device": "x86-32",
  "location": [
    "42.7225858",
    "-84.4746622"
  ],
  "ConsoleMacro": "269"
}
Default avatar
Created by

Sean


Protocol connections:
1
Latest Update:
Oct 2017