Problem with Dummy and rule for average value

Moderators: grovkillen, Stuntteam, TD-er

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

Problem with Dummy and rule for average value

#1 Post by bastler11 » 29 Apr 2024, 09:52

Hello, I use an esp2866 with the actual firmware. I measure the distance with a time of flight sensor VL53L1X. From the value of this sensor I want to calculate the average value. In the rules I tried to use this:

On Tank#Wasserstand Do
TaskValueSet,AverageCalc,Wasserstand_gemittelt,[Tank#Wasserstand].avg10 // Use .avg10 to get the average over the last 10 samples
Endon

But it does not work. The last value before I tried to calculate the average still remains. To check if I have written all correct I tried to divide the value like this:

On Tank#Wasserstand Do
TaskValueSet,AverageCalc,Wasserstand_gemittelt,[Tank#Wasserstand]/2
Endon

It works and shows me half of the original value. So what is my mistake to get the average?

This is my setting. Could anyone help me to find out the mistake?

Thanks and best regards!
Attachments
Screenshot-Apr.-29-2024_09.43.06.jpg
Screenshot-Apr.-29-2024_09.43.06.jpg (115.78 KiB) Viewed 200 times
Screenshot-Apr.-29-2024_09.43.41.jpg
Screenshot-Apr.-29-2024_09.43.41.jpg (110.32 KiB) Viewed 200 times
Screenshot-Apr.-29-2024_09.44.34.jpg
Screenshot-Apr.-29-2024_09.44.34.jpg (211.24 KiB) Viewed 200 times

User avatar
Ath
Normal user
Posts: 3563
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Problem with Dummy and rule for average value

#2 Post by Ath » 29 Apr 2024, 09:57

The build you're using doesn't include the statistics collection, so no average values are available :o (it's missing the checkboxes to enable that for the Values)
/Ton (PayPal.me)

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

Re: Problem with Dummy and rule for average value

#3 Post by bastler11 » 29 Apr 2024, 09:59

Thanks, so which build should I use?

User avatar
Ath
Normal user
Posts: 3563
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Problem with Dummy and rule for average value

#4 Post by Ath » 29 Apr 2024, 10:46

Well, the simplest way to get that going is to use an ESP32 Collection B build (or MAX if you have an ESP32 with 16 MB Flash).

AFAICS, the Custom ESP8266 builds currently also get LIMIT_BUILD_SIZE set, causing the statistics/graphs options to be excluded :?
/Ton (PayPal.me)

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

Re: Problem with Dummy and rule for average value

#5 Post by bastler11 » 29 Apr 2024, 15:18

Ok, then I must order some.
So if I have an esp32 I could use the rule like I tried to do?

It is not so urgent, I want to have an additional check for the water level of my greenhouse watering tank. The actually esp2688 is still build in a small housing, to change the hardware, I think I have to build a new housing.

User avatar
Ath
Normal user
Posts: 3563
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Problem with Dummy and rule for average value

#6 Post by Ath » 29 Apr 2024, 15:54

bastler11 wrote: 29 Apr 2024, 15:18 The actually esp2688 is still build in a small housing, to change the hardware, I think I have to build a new housing.
The smallest ESP32 I own are the same size and pinout as an ESP01S (using an ESP32-C3), so 'quite small'... a little larger are these C3/S3 units, still smaller than a Wemos D1 or NodeMCU. Instead of via USB-C you can also power them via the regular 5V(Vin)/GND pins if required.
/Ton (PayPal.me)

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

Re: Problem with Dummy and rule for average value

#7 Post by bastler11 » 30 Apr 2024, 12:03

Thanks, I will have a look on it. Actually I built a housing for the sensor and tried to make it close against humidity, because it is direct over the filler neck. The water level is in 30cm. To open the housing it is a little difficult.
Attachments
IMG_6190.JPG
IMG_6190.JPG (2.51 MiB) Viewed 134 times

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

Re: Problem with Dummy and rule for average value

#8 Post by TD-er » 30 Apr 2024, 12:39

Maybe these "super mini" boards are better suited for this use case as they are nearly as small as those "ESP-01" boards (about 3mm wider).
The ESP-01 (and the ESP32-C3 variant of it) do have 8 pins which are rather bulky.
These "super mini" boards do have an USB-C connector which makes flashing a lot simpler.
Also there are more pins available.

N.B. when ordering the ones from my link, better buy a few of them as the quality control is... limited.
I have one with missing resistors in 3 places so it isn't recognized by the PC. (component size is 0201, so really small)

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

Re: Problem with Dummy and rule for average value

#9 Post by bastler11 » 30 Apr 2024, 14:01

👍 I will have a look on it, thanks.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 2 guests