Calculate average values does not work
Moderators: grovkillen, Stuntteam, TD-er
Calculate average values does not work
Hello, I use 4 sensors with my ESP2866. One signal is not very stable, so I tried to use rules to get a stable value. But It does not work. The average value I got is about 74 instead of about 102? Here are some screenshots. Could you have a look on it? What is my mistake?
Thanks and best regards!
Thanks and best regards!
- Attachments
-
- Screenshot_5.jpg (128.45 KiB) Viewed 3788 times
-
- Screenshot_4.jpg (47.91 KiB) Viewed 3788 times
-
- Screenshot_3.jpg (212.88 KiB) Viewed 3788 times
-
- Screenshot_1.jpg (128.62 KiB) Viewed 3788 times
Re: Making average values does not work
The easiest way to get the average for task values is to enable the Stats checkbox, left from the Decimals setting for that Value, and use the [Zisterne_Inhalt#Prozent.avg] value in a rule:
Also see the documentation: https://espeasy.readthedocs.io/en/lates ... statistics
Code: Select all
On Zisterne_Inhalt#Prozent Do
TaskValueSet,ZisInhalt,Dummy,[Zisterne_Inhalt#Prozent.avg] // Use .avg10 to get the average over the last 10 samples
Endon
/Ton (PayPal.me)
Re: Calculate average values does not work
Thanks,
I tried to do it, but values will not be shown?
I tried to do it, but values will not be shown?
- Attachments
-
- Screenshot_6.jpg (21.32 KiB) Viewed 3781 times
-
- Screenshot_2.jpg (54.71 KiB) Viewed 3781 times
Re: Calculate average values does not work
Did you disable or remove the rule with the same trigger? As only the first found instance will be executed (rules 1 .. rules 4 are read in that order, top down).
/Ton (PayPal.me)
Re: Calculate average values does not work
I deleted all rules and all Dummy Devices. Then I and wrote the rule for the content new. But the shown value is still 0.0?
Re: Calculate average values does not work
But you still have a ZisInhalt Dummy Device, with a Dummy value? As I've used the TaskValueSet using the taskname and valuename, so these have to match for the value to be assigned (matching is not case-sensitive).
/Ton (PayPal.me)
Re: Calculate average values does not work
I do not understand? Here are again some screenshots.
In the rule you send me: TaskValueSet,ZisInhalt,Dummy,[Zisterne_Inhalt#Prozent.avg] were have I to write it?
In the rule you send me: TaskValueSet,ZisInhalt,Dummy,[Zisterne_Inhalt#Prozent.avg] were have I to write it?
- Attachments
-
- Screenshot_10.jpg (97.19 KiB) Viewed 3767 times
-
- Screenshot_9.jpg (48 KiB) Viewed 3767 times
-
- Screenshot_8.jpg (96.04 KiB) Viewed 3767 times
Re: Calculate average values does not work
The name of your Dummy Device task should be ZisInhalt, and the Name for the Values entry should be Dummy, like you originally had, that should fix it.
The ADS1115 task is already named Zisterne_Inhalt, you can't have 2 devices (tasks) with the same name.
The ADS1115 task is already named Zisterne_Inhalt, you can't have 2 devices (tasks) with the same name.
/Ton (PayPal.me)
Re: Calculate average values does not work
No do not work. Were do I find the value Prozent.avg
- Attachments
-
- Screenshot_12.jpg (92.09 KiB) Viewed 3762 times
-
- Screenshot_11.jpg (85.55 KiB) Viewed 3762 times
Re: Calculate average values does not work
You have to enable the Stats checkbox on your ADS1115 task:
(took a screenshot from this thread, above)
(took a screenshot from this thread, above)
/Ton (PayPal.me)
Re: Calculate average values does not work
One more thing
.
I tried to use this function with an other device. But there I do not find the Stats checkbox. Do I have to update the firmware?

I tried to use this function with an other device. But there I do not find the Stats checkbox. Do I have to update the firmware?
- Attachments
-
- Screenshot_13.jpg (137.29 KiB) Viewed 3727 times
Re: Calculate average values does not work
That plugin does have Stats enabled, but because it is in a Collection build the Stats feature is excluded to limit the .bin size. You would have to build a Custom ESPEasy to have that enabled.
It should be available for an ESP32 Collection B build though, as an ESP32 has more space available for code.
It should be available for an ESP32 Collection B build though, as an ESP32 has more space available for code.
/Ton (PayPal.me)
Re: Calculate average values does not work
Ok, than I have to change to ESP32.
Thanks again!
Thanks again!
Who is online
Users browsing this forum: No registered users and 14 guests