I am using OpenHab since one week and already managed to set up some simple rules (if this changes do that), but I am going crazy about this simple use case:
Every day at a given time, I want OH to send me a mail and telegram message when min temperature for the next day is below 4 degrees (to remind me shielding the windows of my car).
What I did so far:
Item definition:
Number Temp_Frost "Temperature Frost [%.2f]"{weather="locationId=home, forecast=1, type=temperature, property=min"}
Item shows nicely in sitemap using
Text item=Temp_Frost label="Frost" icon="temperature"
Now I set up this rule:
rule "Mail Frost"
when
Time cron "0 7 16 * * ?"
then
if(Temp_Frost < 4) {
sendMail("someone@gmail.com", "Achtung Frost!", "This is the message.")
sendTelegram("bot1", "Achtung Frost!")
}
end
When the rule is firing, in the log I get
Error during the execution of rule ‘Mail Frost’: Unknown variable or command ‘<’; line 60, column 5, length 14
2018-11-15 16:07:00.014 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule 'Mail Frost': Unknown variable or command '<'; line 60, column 5, length 14
The CRON part itself works nicely, cause if I don’t use the “if…”-Statement, the rule fires at the given time and sends me mail and telegram.
What am I doing wrong?