Page 1 of 1

How could I calculate the mean?

Posted: 01 Aug 2022, 21:28
by bastler11
Hello,

on my ESP 8266 with ESPEasy I measure an analog signal 0-5V. This signal is connected on Ain0 at ADS1115 ADC.The output signal which is shown under device sways about from 4570 - 4670. Is it possible to calculate the mean in ESPEasy? How could I do it?

Thanks for your help!

Re: How could I calculate the mean?

Posted: 01 Aug 2022, 21:57
by TD-er
You can sum a number of samples and count that nr, then divide it ;)

Or you can take one of the latest test builds (new build will be very soon) which does add features like these to allmost all plugins.

Re: How could I calculate the mean?

Posted: 01 Aug 2022, 22:47
by bastler11
Thanks, but how could I do it? There is the %value% in the las row, and how could I get the value for example after 1s, after 2s, 3s, ...? If I have these values I write: 1.%value% + 2.%value%, ....10%value%/10 =mean? Hope you understand it?

Re: How could I calculate the mean?

Posted: 01 Aug 2022, 23:30
by TD-er
You can do something like this in the rules: https://espeasy.readthedocs.io/en/lates ... ng-filters

Re: How could I calculate the mean?

Posted: 02 Aug 2022, 12:00
by bastler11
Thanks, it looks good. I will try to do it.