Is Z-Uno supported by Smart Things? I need a water level sensor


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!

Check it out!


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.


In fact best would be to use direct Z-Wave associations between Z-Uno and the switch. This is robust. And just report water level sensor to analyze in ST and use more complex logic in future

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? :smile: )

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.


They are not as close to each over to make it in one device. And I did not wanted wires to go along the tube from the tank to the wire.

BTW, adding a flood sensor to the same Z-Uno can be a nice idea to make sure the tank to not leak :wink: Will be two-in-one. And adding a DS18B20 temp sensor would also make sense to monitor temperature.

1 Like

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.

I would recommend you use 2 ESP8266 .

ESP8266 - One

ESP8266 - Two

Once you have all theses devices exposed to Smartthings you can create a simple Smart app to manage the automation and notifications.

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?

That would be very appreciated

I would love to see how you got this all to integrate with Smartthings and if you do have the time, an explanation of how you did this, would be much appreciated.

Here is the main ST_Anything forum thread…

Thanks. I’ll purchase the hardware - maybe the lights will come on for me. Currently I have no idea how this will work.

What exactly are you trying to accomplish? That would help us advise you on your options.

I’m looking for a solution to fill a water tank by turning a water pump on when the water drops below a specified level.
Thanks for you response.

Sounds like @Saif76 does indeed have a solution that you could use without having to reinvent the water wheel! :wink:

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! :slight_smile: )

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.

Thanks Dan. I will first do some reading so that I at least have some understanding of what I’m dealing with, before I start bugging @Saif76.

Hi @Saif76.
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.

This is the sensor i used -

Here is the code to the Arduino class and the DH -

Here is what the it looks like in the app

In the parent device handler i had to change this

childDevice.sendEvent(name: namebase, value: value) 


            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.

1 Like

Thanks very much - much appreciated. I can’t wait to try this.

Did you install the sensor at the top of the tank, looking down towards the bottom thereof?