Delay to send telegram notify

I have the following rule:

rule "CO2 Notify"
when
    Item ESP_Climate_1_CO2 changed
then
    if (ESP_Climate_1_CO2.state > 1000 && Send_via_Telegram_Switch.state == ON) {
    sendTelegram("climate", "\ud83d\udeab CO2=%sppm", ESP_Climate_1_CO2.state)
    }
       
end

It sends a message when the CO2 level is above 1000. But the problem is that it sends when changing to 1001,1002 etc. How can I fix this so that we can accept notifications every 5 minutes, if the value is in the specified range?

If you stick with Rules DSL you will need to take a timestamp when you send the telegram as a global variable. Then add a check to see if it’s been at least five minutes since that timestamp before sending the telegram again.