|
|
|
@ -4796,6 +4796,7 @@ client.on('message', async (topic, message) => {
|
|
|
|
|
const waterLevel = parseInt(waterLevelHeight * waterCapacityPerCm, 10); // Calculated water level
|
|
|
|
|
|
|
|
|
|
// Update water level in the existing tank
|
|
|
|
|
console.log(tankHeight,"this is located in tank controllers at iot-data mqtt sub ")
|
|
|
|
|
if (tankHeight>0 && waterLevel >= 0) {
|
|
|
|
|
existingTank.waterlevel = waterLevel;
|
|
|
|
|
await existingTank.save();
|
|
|
|
|