This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Hold a state when value changes
#1
I have a script where I'm monitoring consumption, but can get no finer numbers than 1, 2, 3 and 4 for my measurements. When consumption is same or above 2 I set an object to true, and when it is below the object goes to false.

However, this is causing some issues as the consumption temporarily drops below 2 for a few milliseconds, causing my object to drop to false. 

Does anyone have a best practice or hysteresis-type solution to this kind of problem?
Reply
#2
If it is event script then just add small delay to it and set Execution Mode: First instance only
------------------------------
Ctrl+F5
Reply
#3
But I want the object to go to false if it goes below 2 and stays there. Wouldn't your suggestion prevent that?
Reply
#4
it will change only after the delay but if new telegram arrives in the meantime then the current script will be cancelled and new with new value will run.
------------------------------
Ctrl+F5
Reply
#5
Shouldn’t it be “last instance” then?
Reply
#6
True Smile
------------------------------
Ctrl+F5
Reply


Forum Jump: