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?
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.
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.
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.