This object is in archive! 

Threshold for sensor value changes

Bernd shared this idea 4 years ago
Completed

A lot of my rules are triggerd right now by changing values e.g. for temperature or luminance.

But only in case that the value is above or below a specific value the rule has to be executed. So the rule starts at every changing of the sensor value runs through but nothing happens as the threshold is not matched.

This brings a lot of traffic for the controller.

So my idea is to add a new micro block for :

change from above to below threshold andchange from below to above threshold for a specific sensor

With this a rule would be triggered in that case only when there is the intended necessity to be executed and the burdon for the controller would be minimized.

Maybe someone has this realised already with the existing blocks in the rule creator???

Regards

Bernd

Replies (1)

photo
1

Couldn't you just incorporate the threshold into the trigger for the rule, e.g.


When (temperature < 5) or (temperature > 20)


?

photo
1

Yes David, that´s the way I do it right now. But the IF-triggger is:

IF temperature

WHEN temperature below or above

.....

But the mess is, that this rule runs every time, when the temperature changes.

What I would like to have is

IF temperature changes from >=20 ° to < 20 °

.....

This rule runs exactly once only - in that specific moment when the temperature falls below 20 °

This would save a lot of controller capacity

photo
1

UPS there was of course IF and When reversed

Nevertheless if I in the IF condition an operator with < or > is used the rule is triggered with every new temperature measurement - which is in my case every minute. And the whole day over, when temperature is above 20 ° the rule is executed every minute although every thing is done with the first execution..

photo
1

Hi Bernd,

I think you could achieve this by using a variable (or virtual device) to store the previous value, or whether the previous run had matched.

Your idea seems like it would be useful though.

Ed.

photo
1

Yep, you'd need to store the previous value. Unfortunately variables can't be used in when triggers (illogically), so if you wanted to incorporate the stored value in the rule trigger, you'd need to use a virtual meter.

photo
2

David good idea. I´ll try with a virtual meter. That could work I think. Maybe a bit depending on the point in time when the virtual meter is set back to the threshold value.

photo
Leave a Comment
 
Attach a file