Hey,
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 - https://www.amazon.com/Waterproof-Ultrasonic-Distance-Measuring-Transducer/dp/B01J5KZU8M/ref=sr_1_sc_1?ie=UTF8&qid=1517795020&sr=8-1-spell&keywords=ultarsonic+water+proof
Here is the code to the Arduino class and the DH - https://github.com/saif76/STWaterLevel
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)
to
def functionExist = childDevice.parseValue(namebase,value) // check if the child has a parse function
if(functionExist)
{
//log.debug "Function Exists"
}
else
{
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.