How could I calculate the mean?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
bastler11
Normal user
Posts: 101
Joined: 11 Jan 2021, 21:58
Location: Luebeck

How could I calculate the mean?

#1 Post by bastler11 » 01 Aug 2022, 21:28

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!

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: How could I calculate the mean?

#2 Post by TD-er » 01 Aug 2022, 21:57

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.

bastler11
Normal user
Posts: 101
Joined: 11 Jan 2021, 21:58
Location: Luebeck

Re: How could I calculate the mean?

#3 Post by bastler11 » 01 Aug 2022, 22:47

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?

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: How could I calculate the mean?

#4 Post by TD-er » 01 Aug 2022, 23:30

You can do something like this in the rules: https://espeasy.readthedocs.io/en/lates ... ng-filters

bastler11
Normal user
Posts: 101
Joined: 11 Jan 2021, 21:58
Location: Luebeck

Re: How could I calculate the mean?

#5 Post by bastler11 » 02 Aug 2022, 12:00

Thanks, it looks good. I will try to do it.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 27 guests