Telegram-Sender if no message for 31 minutes?

Hello,

An IoT device sends an MQTT message every 15 minutes: "connected".
An MQTT-IN-Node receives this message in NodeRed and a SENDER-NODE forwards them to a Telegram bot.

As a result, I receive 96 messages a day in Telegram. ;-(

How can I set up NodeRed so that the SENDER-NODE only sends a message if no MQTT message has been received for 31 minutes?

Thank you for the reading,

The trigger node does that trick for you

If what you actually want to know is whether the device has failed or has not connected to mqtt then you may be able to use the MQTT LWT message instead.

1 Like

The trigger node is a good idea! It's exactly what I wanted, thank you!

The trigger node is a good idea! It's exactly what I wanted, thank you!

The trigger node is certainly the best answer to your question. My point was that you might be asking the wrong question, dependent on why there might be no message for 31 minutes.

Hello,

The MQTT message cycle is 15 minutes.
2 x 15 minutes + 1 minute, to be on the safe side...
That was the reason for "31 minutes" :wink:

But it's true: the trigger node works great!

The question is what are you trying to protect against? If it is enough to know that mqtt is not connected then you can use the mqtt lwt and that will tell you almost immediately that there is a problem without having to wait for half an hour. If, however, the connection may dropout for 29 minutes and that does not bother you, provided it recovers in time for the next message, then the solution you have is perfect.