Temperature alert

Hi everyone. I could use some help creating a rule for a pellet boiler i have.
I have created some rules concerning the temperatures of the boiler (domestic hot water, boiled temp, feeder temp) to send me alerts (email and notifications) when the temps go above or below specific values.
What i want to do now and don’t know how, is when the temp isn’t rising above 2 degrees for a specific period (lets say after 15 minutes), to get a notification .
thank you in advance.

You’ll need to decide when to begin that timing. From boiler startup, perhaps? Because you need a way to trigger a rule.

In that start-up rule, you could store the current temperature in a global variable.
And use createTimer to set up a little code for the future, 15 mins.

When the timer runs, it can compare stored temp with new current temp, and ring bells if it hasn’t done what you expect.

You would probably also need another rule to cancel the timer under some circumstances - the boiler is shutdown by timeclock, or thermostat target is reached.

Could you not create a dummy item with a 15minute expire setting from the expire binding.

Everytime the temp changes just post a command ON to that item, and then it will continaully reset the expire timer until it hasn’t had a command to it for 15 minutes, get the expire to set it to OFF…then run a rule where dummy_Item changed to OFF

That’s probably simpler.
There isn’t a way to cancel an expire based timer, but in this case it should be possible to test in the rule that runs on expiry whether or not there is a cause for alarm (and ignore).

So i create a timer that starts when boiler temp drops below 55, then if the temp won’t go past 57 in the period of 15 minutes, trigger the alert. And to cancel the timer i could say that when the temp reaches 60 reset the timer. Is the logic correct?

That seems easier, i will try both. Thanks both of you.

See Design Patterns: Generic Is Alive. You should be able to adapt that to your use case. It will require a little more code because you don’t just care that you’ve received any old update, you want to see that the update is higher than the last one. So you need some if statements in there to determine whether to reset the timer or generate the alert.