Limiting the number of telegram messages

I have a problem limiting the number of messages a rule can send in a certain time.

I have a over 100 temp sensors which report readings via mqtt at 1s intervals each.
I have voltage, amps, power monitoring at 2s intervals, I need to be alerted of power failure.
I have smoke sesors reporting at 1s intervals.

Using simple rules I can get an almost instant Telegram alert if any of them gets triggered, BUT I keep getting the alerts over and over and over again, almost rendering my phone useless because of the message flood.

I need a piece of advice about how to limit the number of messages dispatched, something like once every 10s, or every 20s.
I don’t want them to be “one time only” since I might be busy and miss the alert, so repeating is better, but not flooding my phone at 1s intervals.

Here is one of the rules:

rule "max temp alert"
    Item gTehnicalTempSensors received update
    if (gTehnicalTempSensors.state as Number >= 40) {
        val StringBuilder sb = new StringBuilder
        gTehnicalTempSensors.allMembers.filter[ i | i.state as Number > 40 ].forEach[ i | sb.append( +" ")]
        logError("Temperature:", "Temperatura sisteme peste 40 grade Celsius!"+sb.toString)
        sendTelegram("kCritical", "Temperatura sisteme peste 40 grade Celsius! "+sb.toString)

PS. this rule also triggers a weird error every time I save the file, the rule works as expected, it’s just annoying

01:45:07.094 [ERROR] [untime.internal.engine.RuleEngineImpl] - Rule 'max temp alert': Script interpreter couldn't be obtain

A simple method is to trigger an Item that rules use to block messaging until it expires.
But it sounds more like the queuing example here would suit (no dropped messages)

Since I need them to drop the same repeating message if it occurs in a 5s window I implemented a virtual flag Switch Item which gets set when the first message is sent and then restored by a 5s timer.
Thank you!

PS. God damn DSL, this language is everything but a programming language, takes ages to figure out something I can do in C for Arduino in 30 seconds…

I use the expire binding for that, so the virtual switch item switches itself off…