Code
let mycount = 0;
let alertTimer = null;
let myDay = 0;
function startMonitor() {
alertTimer = Timer.set(2 * 1000,
true,
function () {
mycount = mycount + 1;
print("mycount" + JSON.stringify(mycount));
if(mycount % 2 === 0) {
print("even");
Shelly.call("Switch.Set", {"id": 1, "on": false});
}
else {
print("odd");
Shelly.call("Switch.Set", {"id": 1, "on": true});
}
},
null
);
}
startMonitor();
Alles anzeigen
this seems to work.
so nesting is not a good idea.
i will try to work on that.
the json looks like:
Code
{
"hostname": "amis",
"psaldo": 1040,
"qsaldo": -186,
"wpf": 7419448,
"wpr": 0,
"wqf": 28565,
"wqr": 2906946,
"uptime": 0,
"freememory": 35704,
"time": 1555071841,
"phase1": -100,
"phase2": -100,
"phase3": -100,
"zeit": "2019-04-12 14:24:01",
"ip": "10.0.0.141",
"mac": "DC:4F:22:66:0B:A1",
"rssi": "-61"
}
Alles anzeigen