Message telegram for monitoring a state of item at specfic time

How i can set a rule that send me a message at 0:00 and tell me the state of a particular item?

This is my rule that tell me if there is a change of state:

rule "It_C_CondSplitSalone"
when
	Item It_C_CondSplitSalone changed
then
	val telegramAction = getActions("telegram","telegram:telegramBot:bot1")
	
	if(It_C_CondSplitSalone.state==ON){
		
		telegramAction.sendTelegram(" Attenzione il Magnetotermico Split Salone del Quadro GENERALE e SCATTATO")
    } else {
		
		telegramAction.sendTelegram("Il Magnetotermico Split Salone del Quadro GENERALE e stato RIPRISTINATO")
    }
end

Read the documentation, ask a specific question if something in the documentation is unclear.
Would be quicker to Google the correct link than asking this question and waiting for an answer, or?

https://www.openhab.org/docs/configuration/rules-dsl.html#time-based-triggers

sorry i’m niubbo…

Can it work?

rule "It_I_IrrigazONOFF"
when
Time is midnight
else
    Item (It_I_IrrigazONOFF.state==ON
then
	val telegramAction = getActions("telegram","telegram:telegramBot:bot1")
    telegramAction.sendTelegram("Irrigazione Disabilitata")
	sendBroadcastNotification("Irrigazione disabilitata")
end
rule "It_I_IrrigazONOFF"
when
Time is midnight
if
    Item (It_I_IrrigazONOFF.state==ON){
	val telegramAction = getActions("telegram","telegram:telegramBot:bot1")
    
	telegramAction.sendTelegram("Irrigazione Disabilitata")
	sendBroadcastNotification("Irrigazione disabilitata")}
end

it’s better that way

That won’t work. There is no else in the when. You have to have an if statement in the body of the rule.

In the UI, you could use a condition instead of the if.

rule “Irrigazione off”
when
Time cron “0 0,56 0,23 * * ?”
then
val telegramAction = getActions(“telegram”,“telegram:telegramBot:bot1”)
if(It_O_BloccoIrrigazione .state==OFF){
telegramAction.sendTelegram(“Ti volevo avvisare che l’irrigazione è disattivata”)
}
end

It’s working