kumoapp temperature change and time period

11 views
Skip to first unread message

evan.c...@gmail.com

unread,
Nov 5, 2018, 3:21:25 AM11/5/18
to Wireless Sensor Tags
Hi, 
I would like to create a kumoapp that alerts when big swings in temperature take place. 
For example a room increases or decreases 3 degrees in a two hour period.

how could I add the time component to this code?

var tags = <#temperature sensors_[12]_N#>;
var step = 3<%minimum °C change to trigger transmission_N%>;
   tags.forEach(
function (tag) {
    tag.setTempSensorThresholds(tag.temperature-step, tag.temperature+step);
    tag.temperatureCross = function () {
        KumoApp.Log(this.name + " is " + this.temperature + "°C")
        if (this.tempState==2)// too high
        {
            this.setTempSensorThresholds(this.lowTh+step, this.highTh+step)
        }
        else if(tag.tempState==3)  // too low
        {
            this.setTempSensorThresholds(this.lowTh-step, this.highTh-step)
        }
    };
});
Reply all
Reply to author
Forward
0 new messages