I need, that I get a information via telegram, if the temperature under 3 Degree.
If I use …
rule "temperature"
when
Item eg_temp01 changed
then
if(eg_temp01.state<3) {
sendtelegram("bot1", "Information ...")
}
end
… by every change from the temperature fire the ruleand and I get a telegramm message.
I only need the message once when the temperature breaks the e.g. 3 degree limit.
How can I this config?
Thanks! Michael
var tempFlag = 0 // Add this at the very top of the rules file
rule "temperature"
when
Item eg_temp01 changed
then
if(eg_temp01.state<3) {
if (tempFlag == 0) { // The flag is 0 - First Time
sendtelegram("bot1", "Information ...")
tempFlag = 1 // Set the flag to 1
} else if (tempFlag == 1) { // If the temp goes over 3 AND the flag is 1
tempFlag = 0 // Reset the flag
}
end