Sorry for no better Subject, i have a rule that simply does ot fire. tried a lot and did check multiple times.
I have a jeelink temperature item that comes from within the fridge - and should fire when temp goes above 15 degree…but never fires. Anyone can see what may be wrong? Temperature is a number/temp item.
Logs do not see anything to complain about.
// ***************************************************************************************************
rule "FridgeAlert - Notification"
when
Item NG5_JeelinkFridge_Temperature received update
then
if (NG5_JeelinkFridge_Temperature.state > 15) {
sendMail("xxxxxxxxxxxxxxxxxxxxxx", "Fridge TempAlert | " + NG5_JeelinkFridge_Temperature.state + "°C", "---EoM---")
sendPushoverMessage(pushoverBuilder("Fridge | " + NG5_JeelinkFridge_Temperature.state + "°C").withTitle("TempAlert").withSound("alien"))
}
end
Did you use VisuslStudioCode to edit the rule file? This editor should highlight syntax problems?
Did you check the logs when saving the file?
Use some logInfo lines in order to see if the rule does trigger but does not run your desired code lines.
@norbert_jordan
I was fighting this just yesterday. As said above, your temperature has UnitofMeasurement. You also need to get the value of the state, not just the state itself, so try this:
if ((NG5_JeelinkFridge_Temperature.state as Number) > 15 | "°C") {
In that way you compare apples with apples. That made my rule fire.
No that didn’t make your rule fire.
What makes the rule fire is the trigger event
That line of code is an if statement inside a rule
And you are correct about apples and oranges
many thanks of course you did make it work!!!
I was not aware that Jeelink (or whoever is in charge within the framework) did create a number:temp item…i simply changed it in PaperUI to number and so the rule finally works…