Page 1 of 1

Change Sensor value

Posted: 10 Apr 2021, 17:37
by Lonzo
Hi, I have a small problem: I am measuring waterpressure, value goes in ADS0#Wasserdruck. Works fine - but: if no water is flowing the values swings around 0 (-0.1, 0,04 and so on).
Is ist possible to create a rule like: if ADS0#Wasserdruck<0.2 then sensor value is 0.00?
Under ESPeasy it is easy to use an internal variable, but in RPIEasy I don´t know how to do.
Maybe someone can help me.

Thank you

Lonzo

Re: Change Sensor value

Posted: 11 Apr 2021, 18:20
by enesbcs
Lonzo wrote: 10 Apr 2021, 17:37 Hi, I have a small problem: I am measuring waterpressure, value goes in ADS0#Wasserdruck. Works fine - but: if no water is flowing the values swings around 0 (-0.1, 0,04 and so on).
There are a lot of possibilities. I guess you are using an Analog ADS1115 device. You can either set decimals to zero, or use a simple formula at the plugin page to smoothen values. For example:

max(int((%value% * 10) / 10),0)

Re: Change Sensor value

Posted: 12 Apr 2021, 12:08
by Lonzo
Tank you! I will test it.