|
|
@ -1500,6 +1500,11 @@ exports.motorAction = async (req, reply) => {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
clearInterval(intervalId);
|
|
|
|
clearInterval(intervalId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Send notification after motor stops due to time threshold
|
|
|
|
|
|
|
|
if (fcmToken) {
|
|
|
|
|
|
|
|
await sendNotification(fcmToken, 'Motor Stopped After Time Threshold', `Motor ${motorId} has been stopped after reaching the set time threshold.`);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
await delay(300000);
|
|
|
|
await delay(300000);
|
|
|
|
|
|
|
|
|
|
|
|
const motorData = await MotorData.findOne({ customerId, motor_id: motorId, start_instance_id: start_instance_id });
|
|
|
|
const motorData = await MotorData.findOne({ customerId, motor_id: motorId, start_instance_id: start_instance_id });
|
|
|
@ -1526,7 +1531,6 @@ exports.motorAction = async (req, reply) => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
// Send low water level notification
|
|
|
|
// Send low water level notification
|
|
|
|
if (receiverFinalWaterLevel / parseInt(receiverTank.capacity, 10) * 100 <= 20) {
|
|
|
|
if (receiverFinalWaterLevel / parseInt(receiverTank.capacity, 10) * 100 <= 20) {
|
|
|
|
if (fcmToken) {
|
|
|
|
if (fcmToken) {
|
|
|
|