master^2
Varun 9 months ago
parent c829041483
commit 6423bfb41e

@ -5885,13 +5885,16 @@ client.on('message', async (topic, message) => {
});
}
const currentTime = moment().tz('Asia/Kolkata').format('DD-MMM-YYYY - HH:mm');
const currentDate = moment().tz('Asia/Kolkata').format('DD-MMM-YYYY - HH:mm');
const currentTime = moment().tz('Asia/Kolkata').format('HH:mm');
// Create tank documents
const tankDocuments = tanks.map((tank) => ({
tankhardwareId: tank.Id,
tankHeight: tank.level,
date: currentTime,
date: currentDate,
time: currentTime,
}));
// Save IoT data
@ -5899,7 +5902,9 @@ client.on('message', async (topic, message) => {
hardwareId: hw_Id,
Motor_status,
tanks: tankDocuments,
date: currentTime,
date: currentDate,
time: currentTime,
});
await iotTankData.save();

Loading…
Cancel
Save