diff --git a/pool.js b/pool.js index 1f08f4f..cf23b12 100644 --- a/pool.js +++ b/pool.js @@ -13,9 +13,14 @@ let status = { disable_temp: null, lock_update: false, + duration: null, + schedule: null, + tick_mqtt: 0, tick_temp: 0, + tick_lock: 0, tick_pump: 0, + tick_pump_skip: 0, tick_day: 0, }; @@ -124,6 +129,9 @@ function update_pump(temp, max, time) { print("[POOL] update_pump - duration:", duration); print("[POOL] update_pump - schedule:", JSON.stringify(schedule)); + status.duration = duration; + status.schedule = schedule; + let calls = []; calls.push({method: "Schedule.DeleteAll", params: null}); @@ -209,7 +217,8 @@ function update_temp(temp) { status.update_temp_max_last = status.temp_max; } else { - print("[POOL] to much update_pump, skipped"); + status.tick_pump_skip++; + print("[POOL] to much update_pump, skipped", status.tick_pump_skip); } } } @@ -244,7 +253,8 @@ MQTT.subscribe( Shelly.addEventHandler( function (data) { if (data.info.event === "toggle") { - print("[POOL] disable temp"); + status.tick_lock++; + print("[POOL] disable temp", status.tick_lock); if (status.disable_temp !== null) Timer.clear(status.disable_temp);