NEWS
Variable nach xx Minuten zurücksetzen
-
var timer; function xxx() setState('yyy', true) if (!timer) { timer = setTimeout(function () { timer = null; setState('yyy', false) }, 1800000); -
Hallo,
oder so:
on({ id: idVariable, // Variable wird überwacht (idVariable muss natürlich im Skript oben deklariert werden) change: 'ne' }, function (obj) { if (obj.newState.val === true ) { // wenn Variable auf true gesetzt wird setStateDelayed(idVariable, false, 30 * 60 * 1000); // nach 30min zurücksetzen } });oder noch kürzer müsste auch gehen (nicht probiert :roll: )
on({"javascript.0.Variable", // so gehts auch statt id val: true }, setStateDelayed("javascript.0.Variable", false, 30 * 60 * 1000); // nach 30min zurücksetzen );Gruß,