So I have finally managed to complete my ultrasonic sensor which monitors the level of our heating oil.
I have enable MQTT support and using teleperiod I’m uploading sensor reading every one hour. It works great and it is very accurate.
Here is how my graphs looks:
The problem I want to solve is although mqtt is updating every hour, sensor is working constantly.
Is it possible to switch off the sensor for an hour too? Then switch it on again, get new value, update mqtt server and wait for another hour ?
I know you can do it via commands but I can’t figure out which are these commands?
Maybe a rule which will be triggered by time?
Would apreciate any help.
Also apart that I would like some help how to calculate volume of my tank.
It’s a horizontal cylinder. The mathematical equation for volume is
Volume = πr2h
How can I make this a template which will also give me the volume of the tank?
I am using SR04 with esphome to monitor my water tank levels. I have made it to turn on every half an hour and then take 3 readings over 10second interval and then turn off. If you want i can share that code with you but you will have to setup and install esphome. if you want any help with that i can help
I have tried tasmota for this purpose but i couldn’t find anything as you asked for.
In my case I dont see any issue with my esphome connectivity till now. Besides that except this device all my other devices are tasmotas only. More than that esphome works with its own integration and I dont rely on mqtt maybe that would be why i havent seen any connectivity issues. I havent tested it with mqtt till now.
I dont know if this formula is right. I have strong concerns that this could be wrong. As the volume of a horizontal tank should contain a factor of the angle made by the arc which is filled by the fluid. But you can try this maybe after simplification we ight end up with this. Please make sure you test the accuracy before use. What is the volume of tank as mentioned in the product?
You can test if this is right by bleeding the tank empty and measuring the bled oil and then refilling it. If you need any tweaks you can do it after assessing that.
I tested the same template with one of my sensors and it returns correct value. I cant see any issues, its very strange. Please try deleting the sensor and adding it again.
If it is not working you can try an alternate template but this is all the same.
I havent found a way to do that till now. You could try something with deepsleep but its complicated. This is the only reason why I had to shift my sensor to esphome.
You can do one thing to make the sensor not work but its not elegant method. You can use a relay or a transistor to cut the trigger line of the sr04 when you dont want it in use. I guess you already have free pins and vcc with the esp8266 module. You can use this relay to trigger and block the sensor. In theory it should work but do it only if so desperate.