Last active
March 28, 2022 20:11
-
-
Save TalalMash/2538ed7371b35cb3f9e50188729f6acb to your computer and use it in GitHub Desktop.
[Tasmota] SR-04 Ultrasonic Tank Level measurement rules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rule1 ON sr04#distance>0 DO Backlog var1=((((%value%*)-20)-(EM-20))/(EM-20))*-100; var2=(var1*0.01)*LT; event sendval ENDON | |
Rule1 + ON event#sendval DO publish tele/watertank/LEVEL %var1% ENDON ON event#sendval DO publish tele/watertank/VOLUME %var2% ENDON | |
Rule1 1 | |
Replace: | |
-LT with the number of liters | |
-EM with the distance when the tank is empty. | |
You will get percentage (level) and number of liters, accurate starting from 60cm deep tanks. | |
SR-04 (water proof) is recommended for use. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment