I am learning to use this program and I am in a situation where I do not know how to move forward. I do this to learn. I have the following situation. An API that reads a balanace and passes it to a node which checks what the balance is and if it exceeds x it sends a notification by telegram. This part of the code is already done and it works, the inconvenience I have is that the reading of the balance is done every 30 seconds and when the function is activated it sends me a notification every 30 seconds. How do I send a notification and have a timeout of for example 1 hour to send back a notification to re-activate the function? My current nodes are the following:
//1 CHEQUEAR EL BALANCE
msg.payload = msg.payload.data.balance
if (msg.payload >= 1) {
msg.payload = {
send: true,
string: 'Balance: ${msg.payload}'
}
return msg;
} else {
msg.payload = {
send: false,
string: "Not ready!"
}
return msg;
}
//2 EJECUTA LA NOTIFICACION
if (msg.payload.send == true) {
msg.payload = msg.payload.string;
return msg;
}
// 3 CREA EL MENSAJE PARA TELEGRAM
msg.payload = {chatId :35(chatId)100, type : 'message', content :
msg.payload}
return msg;
What would be the correct way to do what I want to do? I tried to search about time management in Node RED but I did not find much information. I would appreciate if you point me to where to read or the different options to get this type of action. That walk well!