Filter Rule For Ultrasonic Distance Sensor

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
DaveS
Normal user
Posts: 25
Joined: 12 Feb 2018, 17:35

Filter Rule For Ultrasonic Distance Sensor

#1 Post by DaveS » 23 Jul 2018, 19:24

Hi All,
Please help a noob with espeasy rules ...
I have a JSN-SR04T waterproof ultrasonic sensor I intend to measure water level in a rain water harvesting tank.
These sensors also work with the newping libary.
When testing the sensor,every so often a zero value is returned otherwise readings are quite accurate. (every 7th or 8th reading is zero)
How can I set up a rule that will ignore zero values ?
Taking an average value from 10 or 20 readings will still have a large error due to the zero value readings.
I also want to convert the distance value to litres and multiply value by 2 as there are 2 identical tanks connected together.
Can all these calculations be done in one long rule or is it best practice to write 2 or 3 rules ?
tia
Dave

Post Reply

Who is online

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