No complicated programming necessary to use an Arduino or ESP device! I am the author of an Arduino library and set of SmartThings Device Handlers that simplifies the process for users down to editing a single Arduino sketch file. You simply decide what devices you want attached to each pin of your microcontroller and my software takes of of everything else!
depending on ST/ internet for a critical function like filling a tank, or stopping a pump, is bananas . If no harm will occur from missed commands then no big deal.
If the pump can be burned out by running empty, or the area will be flooded by pump running too long, then requiring ST/internet to operate correctly in order to avoid damage, is unsound design. It will make the hilarious issue of a garage door going down on your car, look like peanuts.
I expect incandescent disaster porn posts related to this design.
Why not simply use the microcontroller (Arduino, Z-Uno, ESP8266, etc…) to perform both functions? It could monitor level and control the pump accordingly, all without any wireless protocols or cloud solutions. This would be the most reliable and safest. You even even add in a water leak detector to make sure the pump doesn’t flood the area. Maybe even a temperature sensor to avoid running when temps drop below freezing? Lots of options… (can you tell I do industrial automation for a living? )
You could still expose everything to SmartThings for data tracking and manual control if desired. You could even “set the mode” of the arduino-device to either automatic control or manual.
I built a water level gauge for an overhead tank . Using the ST_Anyhting library and an ultrasonic sensor . The ultrasonic sensor measures the distance between itself and the surface of the water and is very precise . I will be adding a motor control option in the future . Unfortunately i haven’t had the time to clean up my code and share it. I will work on that but my project is a little bit more complex than what you are looking for.
Forgot to report back - my Z-Uno was delivered and I managed to make it report values to SmartThings. Just had to apply a template from another sensor and edit a bit to have correct scales. So Z-Uno is pretty well supported in Smart Things. Hopefully SmartThings have a nice template manager for such custom devices
I’ve been trying to get my Z-uno to talk to ST using a simple button and could not get it to work. I’ve tried different device templates in ST , none worked.
Could you post your Arduino code and the device manager template?
I have ordered the sensor and ESP8266. (I have never used a device like this, so I suppose a big learning curve awaits me.
Is my understanding correct that once I have these devices set up with my wifi, I’ll be using your ST_Anything DTH. Am I correct that there is a child-device for the Ultrasonic Distance Measuring Transducer? I suppose once I have all this connect and talking to each other, I will be able to figure out how to calibrate the sensor. I’m concerned that I’ll not be able to read the water level in webCoRE.
I believe you’re going to need some code developed by @Saif76 to get things going. My library does not currently have support for an Ultrasonic Distance Sensor (at least not that I can recall! )
You are correct that you’ve got a big learning curve ahead of you if you’ve never done any Arduino programming before. There are plenty of “getting started tutorials” that you should familiarize yourself with before even attempting to use ST_Anything. ST_Anything is a hobbyist tool-kit, with some ready-to-run device support. For custom things, like this ultrasonic sensor with tight timing characteristics, some knowledge of C/C++ programming on the Arduino/ESP8266 platform is required. You will also need to learn how to write some Groovy language code on the SmartThings IDE side of things. There is no standard ST Capability for a Level Sensor, so you’re looking at some custom code there as well.
Hopefully @Saif76 can provide some of his work to get you kick-started.
Would you mind sharing the code you used to get the ultrasonic sensor working with ST_Anything?
There are a few members looking for a solution to check the water level of a reservoir/tank.
Thank you for considering.
Yes, Let me post it here and if @ogiewon is interested in including it in his library i’m fine with that.
There is one important change you have to make in the “parent-st-anything-ethernet.groovy”, I had to add a condition to intercept the value of the sensor so i could calculate and show me capacity in percentage and liters. The water tank i am using is cylindrical in shape so my settings accept a height and diameter in cm to calculate volume.
def functionExist = childDevice.parseValue(namebase,value) // check if the child has a parse function
//log.debug "Function Exists"
childDevice.sendEvent(name: namebase, value: value)
//log.debug "function does not exist"
I know @ogiewon has made a few changes to the library since then, I have not updated my code to accommodate the changes, So please make modifications to fit your needs.