|
|
@ -1082,12 +1082,13 @@ const checkAutoMode = async () => {
|
|
|
|
|
|
|
|
|
|
|
|
for (const tank of tanks) {
|
|
|
|
for (const tank of tanks) {
|
|
|
|
if (tank.auto_mode === "active") {
|
|
|
|
if (tank.auto_mode === "active") {
|
|
|
|
|
|
|
|
console.log("this is automation " + tank.tankName)
|
|
|
|
const waterLevel = parseInt(tank.waterlevel, 10);
|
|
|
|
const waterLevel = parseInt(tank.waterlevel, 10);
|
|
|
|
const capacity = parseInt(tank.capacity, 10);
|
|
|
|
const capacity = parseInt(tank.capacity, 10);
|
|
|
|
const autoMinPercentage = parseInt(tank.auto_min_percentage, 10);
|
|
|
|
const autoMinPercentage = parseInt(tank.auto_min_percentage, 10);
|
|
|
|
const autoMaxPercentage = parseInt(tank.auto_max_percentage, 10);
|
|
|
|
const autoMaxPercentage = parseInt(tank.auto_max_percentage, 10);
|
|
|
|
const currentPercentage = (waterLevel / capacity) * 100;
|
|
|
|
const currentPercentage = (waterLevel / capacity) * 100;
|
|
|
|
|
|
|
|
console.log("this is automation percentage " + currentPercentage)
|
|
|
|
const now = moment().format('DD-MMM-YYYY-HH-mm');
|
|
|
|
const now = moment().format('DD-MMM-YYYY-HH-mm');
|
|
|
|
|
|
|
|
|
|
|
|
if (capacity > 0) {
|
|
|
|
if (capacity > 0) {
|
|
|
|