Thanks for this. Just a note about the UNI - the two pairs of black wires are “relays” (not really relays, but they act like such) so there is no voltage on them, they just open and close circuits.
@@LarsKlintTech 'Dry' contacts just mean that they are isolated from the incoming voltage powering the control device. i.e. you can use a 12v relay controller to switch on or off a 240v circuit, or the other way around. As opposed to 'wet' relays which you find on power metering relays where the relay output voltage is supplied by device incoming.
I like to think that I'm a tech-savvy, but you take the cake!, I'm about to start a hydroponics project, and I'm doing a checklist of what I might need to start it, what you just show here will save me lots of trips and money, I can't thank you enough. I wish you and your family the best.
Great video Lars, I was struggling to grasp the concept of how to do this but this video, this comments section and your recommend viewing suggestions have helped immensely and now my water anxiety is fueled by data and not guess work :-) Was also nice to discover the Shelly Uni, I've done a lot of home automation stuff with ESP boards but this little thing is powerful, now to think up another project where I can use another one.
That makes me so happy to hear that mate. That is part of the reason I do the videos: to break down the barriers for implementing these projects, so we can all benefit. The other reason is that explaining it on camera makes me think more about how to do it, and usually I get a better result. So, we all win!! Good luck with the projects and feel free to report back when you get it going 🤓
Thanks for sharing the knowledge. I used your previous video for my home water tank and getting it set up in Home Assistant. It's been working great for the past almost 2 years now. Sure beats going out and measuring it with a yard stick.
At 12:10 -- The "outputs" are "potential free" like a relay basically. Think of it as basically just two switches: When "on" current can pass through (because the switch is "closed") and, when "off" current cannot flow because the switch is open. No voltage is supplied to these wires by the Shelly Uni itself.
Thanks Jeremy for the explanation. I realised this a bit after recording too, so really appreciate the help :) I have since used the potentially free/dry connection to switch a solenoid on and off (but not power it).
Thanks so much for this video. I did exactly was you outlined and can now see my tank fullness, and gleen some interesting info on my water usage. I added a 10W solar panel and controller, and 8ah battery to power it all, instead of using the power adaptor as you have. I have one Uni monitor the tank pressure , while the other monitors my battery charge. It's been up and running for just over a week. I live in Canada so long summer days, but short winter days and low sunlight. Going to be interesting on how it all fares over the year! Really love having the default history functions in HA to see how it will all trend.
You are so welcome mate, and love your setup with the solar. It is the best automation/monitoring I have of all the various things I manage. Water is critical and this kind of project just takes that little bit of stress out of your day 😊
Hi Lars. Probably the most anticipated TH-cam video ever on my part haha.... Thanks for the video and opening another can of worms for me... 🙂 I have the Shelly uni's ready to go (in fact it looks like I can use just the one to do two of my tanks). The pressure sensor looks solid so Aliexpress, here I come. Cheers.
You are most welcome mate. I think 😂 With the Shelly Uni I have now learnt the outputs are "dry outputs" so they don't provide the power, but can switch up to 36V. In other words, you need to provide the power (the Shelly doesn't), and then you can switch it through the Shelly. I have just ordered a second pressure sensor for another problematic water tank here. This seems to be a great solution after testing it for some time. 😊
Mate thanks for this. Just got the kit set up and mostly working. Using the pool to Calibrate it, before it goes down the tank (after I manage to find the bloody cable blocks I bought and now can't locate). Thanks again.
Update, found the cable blocks. Built the enclosure (think I might need to drill a hole to put the Uni Aerial outside the box....) Off to the pool shortly.
Thanks Lars, finally got a Shelly Uni and was able to install it all on my setup here in Thailand. I had the slight complication of a pressure sensor that ran on 5v so had to include a buck convertor into the mix rather than run another power supply. As is often the case I had issues with the yaml for the sensors but eventually I always find the missed quote mark, space, colon, hyphen or indent! I'd send you some photos but don't know how! Thanks for helping with this video, Leigh
Oh, I am so happy to hear that Leigh. That is great news. FWIW I always have issues with the YAML and redo it several times for any new project. If you look at my channel details, you can see my contact details as well. I'd love to see the photos of it 😊
Thanks for a great video! I've created this setup myself, however I used the 0 - 10V range sensor instead which gives a much smoother line to work with & does not require the median value like the 0 - 5V needs. I've also used a weather proof enclosor with a DIN rail to mount a DIN 12V PSU to power the sensor & shelly UNI. 🙂
Very good video. I have the same thing in progress. Note: Node Red can do the same thing using smooth and range nodes. In home assistant there should be a helper called "Combine the state of several sensors" it has a median option. Then less messing with yaml
Oh, very nice! Let me know how you go with it. Oh, very cool with Node Red. I am still learning a lot about that tool, so thanks for the tip. I do like just having the sensor "natively" in Home Assistant in this case though.
@@Thomas_Meelker This is the YAML for calculating the litres from the median voltage: house_tank_litres_shelly: value_template: > {% set voltage = states('sensor.house_water_tank_level_median_voltage') | float %} {{ ((voltage / 2.7) * 45804) | round(0) }} unit_of_measurement: l friendly_name: House Tank Litres
You might also consider using the "filter" sensor in Home Assistant, which doesn't rely on the recorder database and lets you chain a number of filter operations together. So you could have an outlier filter followed by a mean, which might get you less noisy data than median, maybe.
the two sets of black wires are relays 1 and 2. they are not voltage out. they are just open/close switches operated by home assistant or by the brown and orange wires.
0(2)-10V DC or 0(4) - 20mA are very common industrial signal levels. It might have said rs485 which is a 2 (or rarely 4) wire serial wire protocol like rs232, and it is quite common that devices speak Modbus RTU over the serial unless it is something proprietary. According to Shelly the outputs are potential free so the won't send any power just switch it. The Shelly wiring diagram (on the knowledge base) is kind of vague but you probably need to connect it in series with the power supply but don't take my word for it but that is how you connect a relay. It also states that it can max switch 0.1A.
Awesome, thank you for all those details. I am happy with the 0-5V, although 0-10V might have given me slightly more detailed/granular data. Are you saying the Shelly Uni can't power devices? Yes, I knew about the 0.1A max, which is fine for most devices. I am about to test one with a solenoid to turn water on and off, so we'll see if 0.1A is enough for that.
@@LarsKlintTech If it is as the manual says "potential free" the outputs are just a "switch". Kind of like the output on the "Shelly 1 Plus" but that is a relay. More signal resolution is always a good thing but if you want to use it with something that is 0-5V later on stay with that. Read the manual but a solenoid might sometimes require a snubber to last in the long run if the UNI is using a TRIAC for the switching.
@@LarsKlintTech My understanding about Shelly Uni's outputs is that they should be used more like button press simulators that to switch loads on or off. The "relay" function is done with the help of two small transistors, transistors that can handle a very low load - 0.3Watts or something.
@@valentinene yes, reading up on it, I kinda understand it now. It seems the voltage rated on the wiring diagram means that is how much power can flow through the switch, not how much it provides. So I could wire the sensor through the Shelly Uni output logically, but not power it from it. I think. 🤔
Great content/videos Lars. I am currently using a Arduino nano and a 16x2 lcd in my pump shed to display tank water level, but since seeing your implementation using the shelly UNI I will be replacing the Arduino and integrate that into HA alongside my victron off-grid dashboard on HA.
That is awesome. That sounds like a decent upgrade. I have 4 of them now, and they have never failed me. They work really well. I will have to go google "victron off-grid dashboard" now though....
@@LarsKlintTech can I ask what was the pressure transducer your using on the bore tank. The one I got from ali is returning some unstable voltages due to temperature drift. Not very stable. Mine is a 0 to 30 psi, measuring a 3 meter head of water. I'm figuring you get what you pay for when it comes to transducers.
@@Tek69 I can't remember tbh. They were off eBay or AliExpress. A couple of them failed too, so I replaced them. I think they were 5 and 15 psi. That is one of the reasons I went to the in-tank ones in this video.
Thank you this is very helpful. On my farm i dont have electricity at my tank, do you have any solutions for powering the shelly and depth sensor? I wouldnt know power requirements or what size batteries to use if i was to make the solar array myself, not sure if there is an off the shelf product to suit?
It is difficult to answer without seeing you setup, and then still difficult 😂 You probably need a solar panel, a solar controller, and then an output from the solar controller to power the sensor and Shelly.
Great Video! I have a question: Is there a way to display/convert the voltage into something meaningful, such as a percentage or a gauge, without the need to host a home automation platform at home? I am trying to monitor the water tank level without setting up a home automation server.
@LarsKlintTech thanks for the reply. I'm not looking for something analog, I'm looking for a free online service/website with a decent mobile app that might allow me to do that without needing to install HA software at home.
@@vickenk So you are after Home Assistant in the cloud? I don't think anything "free" will possibly solve your challenge. I am not sure anyone would host your data and provide an app without some form of compensation?
Great video as always mate - I wish there were more off the shelf solutions for this sort of thing. Would also love ideas on how to power if I don’t have power at all of my tanks - hmm 🤔 small solar maybe
There probably is some off the shelf stuff, but then it'll have its own app and no integration. This is reasonably simple, but only if you are familiar with HA of course. Small solar could definitely work. I did the water tap on solar video, which is a similar idea.
Thank you, very much! I added a depth sensor and Uni just like this last week. But I was flustered by the fluctuating readings. And other TH-cam explanations for building a template were overly complicated. So much appreciated.
Can you help me understand what I have configured wrong: wired the S. Uni as you did with a 12v power supply + power to the pressure sensor ( 0-10V). I am seeing voltage from about 7.5 to 8.3. I verified voltage 12v from the power brick to the Uni. How can I troubleshoot my configuration?
@@emilianoferrara5 my Shelly UNIs have been an excellent choice. They do drop out occasionally and then come back soon after. I haven't worked out why they do that. I still use the same sensors too without a single issue.
Lars - is there a way to set a retain value for the Shelly uni? My project is very similar to yours but powering with a 12v battery pack of 1860's with a solar panel. When the battery goes below power level to keep Shelly running - it goes offline until the sun comes out again next day. I know that when using esphome you can put in the yaml a retain: true line and the values are retained in the gauge card.
Hi Lars. Just questioning how the peaks and troughs can be ironed out in the output? I've gone from 149500L to 141000L pretty much in 24 hours (no its not leaking :-)). I presume the difference is barometric pressure but not entirely sure? Thanks. Keep the informative videos going, they are very useful.
Barometric can definitely make a difference on such a large volume, and you can include that measurements in your calculations, if you have access to it. You can also use a statistics sensor in HA, which gives you a bunch of different options for manipulating the values. www.home-assistant.io/integrations/statistics/
Thanks for watching Ralf. I use the 0-5V output version, and the 0-10V should work just fine as well. The Shelly UNI doesn't support mA output, so not sure what that is for.
@@LarsKlintTech Thanks for the clarification. You aliexpress link defaulted on the mA unit, which confused me. Perhaps the 0-10V has better resolution/less noise than the 0-5? Although at this price point I doubt that high accuracy is a thing. Really good find on both the sensor and the Shelly uni.
@@dmiller9786 No worries. Yeah, I couldn't link to the exact version I got of the sensor. They are remarkably accurate, and if you put the output through the statistics sensor as well, you can get a super stable measurement.
Hello I came across your video today, I am also playing with the Shelly Uni and the same 0-10v sensor level, your video has been handy in that I had to bridge the negative supply and the earth ground to get a feed back from the sensor into the Uni to read . Thanks, still yet to play with HA
Hi another Great Video.... On the Template you created i see you already have an idea of how many Liters of water are in the tank ...... I my case am using underground Well am not really sure how many liters of water is down there .... How do i get around that in my own template thanks
That is a tricky question. If you are lowering the sensor into the well, can you tell how far down the bottom is? If you can do that, then you know the height. If you don't know the width of the well, then you might be able to guestimate it by pumping out maybe 1000 litres and see how much the voltage drops. If you assume the voltage is 0V if the well is empty, you should be able to deduct how much water is in it, if you know the voltage drop for 1000 litres.
Hi Lars, Just finished installing some tanks, now looking to get a reliable level, bought a ultrasonic distance sensor a couple of years ago for another project but it seems faulty now I've installed in these tanks(after installing it so neatly too in the top of the tank, always the way), now looking at a pressure sensor as it would seem more reliable long term. Does the sensor sit on the bottom of the tank(i.e probably laying down), or does it hang? I'm not find a lot of info on that when I look around. Cheers,
Good question Ryan. I don't think it matters. The pressure sensor I use in this video is not very long relatively to the height of the tank, so at most you'd get a tiny voltage difference, which you can compensate for in Home Assistant anyway. I just plonk mine in the tank until it hits the bottom and I haven't had any issues with it. On a side note I am not a fan of the ultrasonic either, as I have heard other anecdotes of them being unreliable and unstable.
@@LarsKlintTech Yes, done that with ultrasonic sensors - A02YYUW. Hopeless, subject to noise (rain, wind, filling) in the tank and didn't survive in the damp atmosphere (despite the specs). Wasted a lot of my time, but not much money, on that idea. Moved on to the pressure sensors.
@@LarsKlintTech yes I did work on it simultaneously after I write this comment. Thank you for your replay. What I did I used template then I saw in my uni the max is 3V & the min is .10V. So I divide the Voltage on 3 then multiply on 100 then add % to have it after the the number but the problem is I have alot of digits. I think I have to use statistics After that I’m not sure. Thanks
Quick update note for anyone else as dumb as me, just to help out. I blew a power supply in a rain storm a few weeks back. I dried everything out, added a new power supply and redeployed it to the tank. I kept getting the same voltage at whatever depth. In short it had become useless. I assumed that the power spike had killed the sensor so I ordered a new one, which came today. connected it up and got the same result. After a bit of thinking time.............................. I realised that the ADC voltage has to work in conjunction with one of the power supply polarities and that I had (when replacing the original power supply) inadvertently reversed them. Corrected that and we're back in business. We now have a spare sensor (doh !), which I'm going to try and deploy at the dam after I get some wifi and battery power down there
Thanks for sharing Peter. We have all been there. I have gone wrong so many times with various projects, but we just keep iterating until we get it right 🤓
*_Quickly googling what a DAB Esybox Mini is_* No, this is the older generation, that don't have any smarts in it, but the same idea for a pump. If I have to replace any pumps, I am definitely looking to get them into HA though.
Hi Lars, great video! I ordered a sensor off eBay but it only has a red and black wire. Any idea how to connect these to the uni? I noticed yours is a three wire. Thanks in advance, Nik
Thank Nik. Appreciate the watch :) I am guessing you have gone for the 4-20mA sensor which sometimes has only a red and black wire. You need to power it in a loop where the measuring equipment sits between the sensors black wire and the power supply's black wire/negative. However, the Shelly Uni only measures voltage as far as I know, so I don't think you can use the sensor you have with the Shelly Uni. This is of course based on my assumption that you got a 4-20mA sensor and basic understanding of the Shelly :) I hope that helps a bit.
@@LarsKlintTech Hi Lars, thanks so much for the quick response! That's correct, the sensor I have is a 4-20mA, but I think you are correct and I may need to swap this out with another one! I read somewhere that I could potentially use a current sensor where "The module outputs a voltage proportional to current passing through the sense pins on the module." Honestly though this is all new to me, so it may not work. One things for sure, I've certainly learnt a lot from your channel and for that I'm very much appreciative! The detailed explanations are fantastic!
@@NikValentine No worries Nik. That current sensor solution sounds complicated imo. The Shelly Uni is a great device, and I would find a sensor that works with it, to keep things simple and stable. And thanks for the kind words. That is exactly why I create the videos, to share some of the knowledge I find on the way.
@@LarsKlintTech Hi Lars, I just wanted to send a quick message to say that after a lot of trial and error, I finally got the 4-20ma sensor to work, however it ended up involving a breadboard and two 1k ohm resistors run in parallel. Suffice to say, using the three wire sensor would have been much easier. In any event, I wouldn't have even thought this was possible without your channel, so thanks again for all your help and keep up the good work!
@@NikValentine Ah, you persevered! Good job mate, and it kinda make sense in my limited brain capacity that you need resistors to measure the current, rather than volts. Thanks for letting me know (and confirming I did the easier solution 😂). And thanks for your support of the channel too. You are the reason I do the videos.
I'm still trying to get my head about the sensor you have. I have a Taylex 31500 litre tank, which is 3450mm wide, and 4100mm high. So should I get the 5m or 4m sensor with a 5m cable ? BTW, I like your choice in water pumps, I have the same pump here on my house. :)
Hi Brendan. No worries, it took me a while to figure out the wording and how it all relate. The "range" length is the depth of your tank, or the max depth that your sensor will measure max voltage when the tank is full. So a 5m range will measure 5v in a full 5m deep tank. In your case you'd need the 5m range at least with possibly some extra meters to get the cable to your shelly UNI or whatever device you use. Perhaps a 7m/7m to give you about 3 meters extra coming out of the tank? You could also use the 5m/5m, but then you only have about .9m to play with outside the tank. With whatever range and cable length you choose, you'll have to calibrate your calculations, as there are always some fluctuations once installed.
Saw this one Submersible 0-10V 4-20mA Output Hydrostatic Level Sensor Transmitter DC12-36V Water Tank Liquids Transducer Meter , but is it the same thing? It comes in a 5m range, and 10m of cable, as a better price too. Wouldn't a 7m range in a 4.1m deep tank have a lesser resolution of depth ?
@@brendanpratt7760 It sounds like the same thing. And 5m/10m should give you plenty of cable to play with too. Yes, with 7m you would "lose" some voltage range in the measurement, so you are better at getting it as close to the depth as possible. However, overall, you wouldn't notice a huge difference, as the 0.01 increments are granular enough imo.
This is so good. I'm all over it. But how many of these analog pressure sensors could you add to one shelly uni? If I had 2 tank next to each other, could I run two sensors form them into the one shelly?
Thanks for the kind words Shaun. You can only have one sensor per Shelly UNI, as you need the ADC input (white wire) on the Shelly to receive the voltage from the pressure sensor. The signal/voltage is analogue so you need the Shelly to convert it into a digital value HA can use. Also, Shelly UNIs are cheap, so it isn't a huge problem?
Marvelous Lars, thanks for your efforts sharing with us all :) Could I ask, would it be possible to trigger a flashing alarm light when a specific water level is reached do you know? Haven't setup HA yet but will finally be getting round to it and first sensor will be a Shelly Uni and one of these tank sensors. I too want to monitor a couple of rain water tanks that is our water supply, but also to monitor and alert if our grey water tank level rises too high (indicating a fault with the pump) and council regs specify a flashing light on the tank. The one that was there is old and busted and rather than the old way I want to go this newer way and kick off my HA journey! Cheers from Northern NSW. Matt.
Hi Matt. Good question and YES, absolutely! You can get Home Assistant to trigger almost any kind of event. I would use something like a Shelly 1 to get the light wired up, and then you can control that from HA too. Oz Smart Things has all the Shelly units and use discount code LARSKLINT for 5% off too. Support the Aussies 😁
@@LarsKlintTech regrettably the code did not and I am under time pressure with council (overdue (on the extension) for my inspection) I would however like to buy you a coffee to even that out by way of thanks.
Hmmmm, excellent question Daniel. A skimmer box is very shallow usually, so a pressure sensor would be difficult to use there. This guy built a water level float sensor: neon.ninja/2017/11/smarter-swimming-pool-3-water-level/
@Lars Klint Awesome, thanks Lars I’m definitely going to take a look at that. On another topic, what font are you using for your HA? It’s something I’ve been meaning to do with my own dashboards.
I might pick up one of these 1m pressure sensors and give it a try with the Shelly Uni, found another video on YT which seems to look like it will work. Been looking at a way to monitor my pool water level for a while now.
As a fellow microsoft guy homesteading in Australia who has taken on many similar projects over the years, I really appreciate you! Silly question, when the sensor says its range and cable length (e.g. 5m range and 5m cable) does that mean that the supplied cable is actually longer (e.g. 5m of cable to get to bottom of 5m tank over ground and 5m of cable go get back down to ground) or would you need to extend the cable? Cheers
Thanks Dale for the kind words ☺ No silly questions here. That is a good one. It took me a bit to figure it out, but the "range" is how deep a body of water you want to measure. It is the calibration of the sensor, so a 3 meter range will be at near to max voltage (if you chose a voltage sensor) at 3 meters. A 5 meter range is close to max at 5 meters and so on. The cable length is the length of the cable at the end of the sensor.
Hi Lars, Great video, and I just got the components, and the voltage dat is flowing into HA. But I just can't get my configuration.yaml to work with the statistics and Template sensor for converting to litre. . So I assume it would help me a lot, if I could get a copy of your files as examples. På forhånd tak Ole 🇩🇰
@@OleSchmitto Hej Ole. Here is my YAML for the specific parts. - platform: statistics name: "House water tank level median voltage" entity_id: sensor.shelly_uni_house_tank_adc state_characteristic: median max_age: hours: 2 precision: 4 - platform: template sensors: house_tank_litres_shelly: value_template: > {% set voltage = states('sensor.house_water_tank_level_median_voltage') | float %} {{ ((voltage / 2.6) * 45804) | round(0) }}
@@LarsKlintTech Perfect... worked and also your code remove the decimal, which makes it nicer to look at. Decimals, remember, that for the incoming voltage from the Shelly device, I need to change the Shelly HA integration setting / voltage to 2 decimals. Tusind tak for hjælpen. 👍🇩🇰. Ole
@@LarsKlintTech In Home Assistant I am receiving data from the sensor every second, which in my opinion is to often, so do you see the same issues and maybe solved it.
Good question. I don't have one as such, but if you click the link to the sensor, you can see the wiring diagram based on which version you choose, and the wiring diagram for the Shelly UNI is at the link for that device. At 11:05 I show the wiring too. I hope that helps 😊
Can you provide some more details? Can you measure the voltage from them directly? What device is receiving the signal from the sensor? Did it work and then suddenly not? Can you explain a bit more about your setup?
Lars, you are a bloody genius. However, I am not. I have the Shelly Uni outputting varying voltages to my two tank sensors but for the life of me I can't work out how to convert the voltage to litres. I've got the diameter and depth (currently 64000L) but that yaml stuff is beyond me, I'm addled. I've been unable to find a video or tutorial that describes how to do this for simpletons. If you know of one please share. Thanks again 🙂
Haha, I don't know about that, but at least it is in writing now 😛 If you look at the screen in the video at 22:18 you can see the configuration.yaml file. This is the main config file for Home Assistant where you put everything that isn't "out the box" in HA. You can see a section in the YAML which says "-sensor" at the top. That starts all the various custom sensors I have. A sensor is just a data point that HA can read. Then it says "-platform: template" which means a template sensor. A template is pretty much any kind of calculation you want to do, where you take an input, such as the UNI voltage, and then converts it to another value. I have created a number of template sensors, each of which is a water tank litre measurement. For example, for the "house_tank_litres_2" sensor, I have use the voltage from the "sensor.sensor_house_tank_voltage_2" which is my Shelly UNI voltage. The main thing I always get wrong is the correct syntax with what is in quotes and what isn't. Does that make any sense?
@@LarsKlintTech Thank-you Lars for your prompt response. I shall have a go using this information, thank-you. My computer skills haven't improved since we filled out dozens of cards with 2B pencils (which were then sent to a nearby school lucky enough to have a computer) to run simple programs. We'd get the results back a week later usually with disappointing results. I digress 🙂 Thanks again.
@@lensman893 No worries. It is one of those things where once you get it working, you can copy paste it and get it working much faster the second time. If you send me your punch cards filled in with 2B pencil, I will make sure nothing happens with them 😂
@@lensman893 I had a similar problem with the template part. I realised that putting the code into something like notepad++ is much better as the formatting is crucial in yaml.
@@patraff1280 Thanks for the tip. I had a good crack at it a few days ago and made progress. I hadn't realised that the tiny hard to see - (in red) was important 🙂 Now I just need to work out why it doesn't show as a line graph as opposed to a long bar. Kudo to Lars for publishing his code for us to copy, I'd never be able to understand that yaml...
Good question. The level transmitters require more rigging to set up usually, and I didn't want a hole in the top of the tank in this case. Just lowering the sensor and plugging it into a Shelly Uni is very simple, so I chose that approach.
I don t know why, After 1 month that tl136 was working well, from today i have not signal from It, 0 voltage. I tried to Change shelly uni ... Always no signal ... Somebody can help me?
Step 1 is to confirm the sensor is the faulty part, and not somewhere else in your setup. Can you put a voltage through the sensor manually and see if you get a reading at all? Step 2, if the sensor is faulty, is go back to the seller and talk to them about a replacement under warranty.
Third time lucky in adding a comment....agghh I have similar hardware as but I flashed Tasmota onto the shelly UNI over the air. Why? Because I am familiar with it and I could slow down the number of times the data was being sent as the shelly didn't do that. Anyway the Tasmota does the calculation for the litres on the device and I send that via MQTT. Seems to work. I don't need to do any of the calculations on the home automation side and can pick the period of data transmission. Look for a video a ubeaut productions as I cannot add any links to the comments...agghh
I haven't done anything with Tasmota, but I can see why you'd go down that route. I'll see if I can find the video. And yes, YT really doesn't like links in the comments 🙄
Thanks for this. Just a note about the UNI - the two pairs of black wires are “relays” (not really relays, but they act like such) so there is no voltage on them, they just open and close circuits.
Thanks for watching and thanks for the tip. I did realise this after recording as well, I think they are called "dry loops". Cheers ☺
@@LarsKlintTech 'Dry' contacts just mean that they are isolated from the incoming voltage powering the control device. i.e. you can use a 12v relay controller to switch on or off a 240v circuit, or the other way around.
As opposed to 'wet' relays which you find on power metering relays where the relay output voltage is supplied by device incoming.
I like to think that I'm a tech-savvy, but you take the cake!, I'm about to start a hydroponics project, and I'm doing a checklist of what I might need to start it, what you just show here will save me lots of trips and money, I can't thank you enough.
I wish you and your family the best.
Thanks Master 😊 and you are so welcome. Thanks for watching, and good luck with your project. Let me know how you go.
Great video Lars, I was struggling to grasp the concept of how to do this but this video, this comments section and your recommend viewing suggestions have helped immensely and now my water anxiety is fueled by data and not guess work :-) Was also nice to discover the Shelly Uni, I've done a lot of home automation stuff with ESP boards but this little thing is powerful, now to think up another project where I can use another one.
That makes me so happy to hear that mate. That is part of the reason I do the videos: to break down the barriers for implementing these projects, so we can all benefit. The other reason is that explaining it on camera makes me think more about how to do it, and usually I get a better result. So, we all win!!
Good luck with the projects and feel free to report back when you get it going 🤓
Thanks for sharing the knowledge. I used your previous video for my home water tank and getting it set up in Home Assistant. It's been working great for the past almost 2 years now. Sure beats going out and measuring it with a yard stick.
You are most welcome James, and thanks for watching. Yes, home automation that saves us a bunch of time we can spend somewhere else is my favourite. 🥰
At 12:10 -- The "outputs" are "potential free" like a relay basically. Think of it as basically just two switches: When "on" current can pass through (because the switch is "closed") and, when "off" current cannot flow because the switch is open. No voltage is supplied to these wires by the Shelly Uni itself.
Thanks Jeremy for the explanation. I realised this a bit after recording too, so really appreciate the help :) I have since used the potentially free/dry connection to switch a solenoid on and off (but not power it).
Thanks so much for this, especially the YAML parts. Worked like a charm for my water butt setup.
So glad to hear that and you are most welcome John :)
Thanks so much for this video. I did exactly was you outlined and can now see my tank fullness, and gleen some interesting info on my water usage. I added a 10W solar panel and controller, and 8ah battery to power it all, instead of using the power adaptor as you have. I have one Uni monitor the tank pressure , while the other monitors my battery charge. It's been up and running for just over a week. I live in Canada so long summer days, but short winter days and low sunlight. Going to be interesting on how it all fares over the year!
Really love having the default history functions in HA to see how it will all trend.
You are so welcome mate, and love your setup with the solar. It is the best automation/monitoring I have of all the various things I manage. Water is critical and this kind of project just takes that little bit of stress out of your day 😊
Hi Lars. Probably the most anticipated TH-cam video ever on my part haha.... Thanks for the video and opening another can of worms for me... 🙂 I have the Shelly uni's ready to go (in fact it looks like I can use just the one to do two of my tanks). The pressure sensor looks solid so Aliexpress, here I come. Cheers.
You are most welcome mate. I think 😂
With the Shelly Uni I have now learnt the outputs are "dry outputs" so they don't provide the power, but can switch up to 36V. In other words, you need to provide the power (the Shelly doesn't), and then you can switch it through the Shelly.
I have just ordered a second pressure sensor for another problematic water tank here. This seems to be a great solution after testing it for some time. 😊
Mate thanks for this. Just got the kit set up and mostly working. Using the pool to Calibrate it, before it goes down the tank (after I manage to find the bloody cable blocks I bought and now can't locate). Thanks again.
Brilliant!! You are most welcome Peter. Clever idea to calibrate it in the pool. That should work a treat.
Update, found the cable blocks. Built the enclosure (think I might need to drill a hole to put the Uni Aerial outside the box....) Off to the pool shortly.
@@PCRoss2469 I 3D printed some enclosures, and the antenna needs to be outside that too.
@@LarsKlintTech I'm seeing 1.6v per metre roughly. Pool isnt deep enough !!
Thanks Lars, finally got a Shelly Uni and was able to install it all on my setup here in Thailand. I had the slight complication of a pressure sensor that ran on 5v so had to include a buck convertor into the mix rather than run another power supply. As is often the case I had issues with the yaml for the sensors but eventually I always find the missed quote mark, space, colon, hyphen or indent! I'd send you some photos but don't know how!
Thanks for helping with this video,
Leigh
Oh, I am so happy to hear that Leigh. That is great news. FWIW I always have issues with the YAML and redo it several times for any new project.
If you look at my channel details, you can see my contact details as well. I'd love to see the photos of it 😊
Thanks for a great video! I've created this setup myself, however I used the 0 - 10V range sensor instead which gives a much smoother line to work with & does not require the median value like the 0 - 5V needs.
I've also used a weather proof enclosor with a DIN rail to mount a DIN 12V PSU to power the sensor & shelly UNI. 🙂
Very nice work mate. That is perhaps what I should do when I upgrade the system again 😁
I definitely want to improve the enclosures I use too.
@@LarsKlintTech Happy to share my photos if you like. :-)
Would you mind sending me the link of the 0 - 10V range sensor you purchased? Thanks!
Very good video. I have the same thing in progress.
Note: Node Red can do the same thing using smooth and range nodes.
In home assistant there should be a helper called "Combine the state of several sensors" it has a median option. Then less messing with yaml
Oh, very nice! Let me know how you go with it.
Oh, very cool with Node Red. I am still learning a lot about that tool, so thanks for the tip. I do like just having the sensor "natively" in Home Assistant in this case though.
Export homeassistant info to Nodered
Great video! Just built my version and it works fine!
Brilliant! And well done 😊
@@LarsKlintTech I cant get the sensor for the value in liters to work. could you pls provide the yaml code from the voltage to the liter-sensor?
@@Thomas_Meelker This is the YAML for calculating the litres from the median voltage:
house_tank_litres_shelly:
value_template: >
{% set voltage = states('sensor.house_water_tank_level_median_voltage') | float %}
{{ ((voltage / 2.7) * 45804) | round(0) }}
unit_of_measurement: l
friendly_name: House Tank Litres
VERY USEFULL for me! Thank you.
You are most welcome mate. Thanks for watching 😊
You might also consider using the "filter" sensor in Home Assistant, which doesn't rely on the recorder database and lets you chain a number of filter operations together. So you could have an outlier filter followed by a mean, which might get you less noisy data than median, maybe.
That is a really good idea. I will investigate that option. Thanks mate 😊
the two sets of black wires are relays 1 and 2. they are not voltage out. they are just open/close switches operated by home assistant or by the brown and orange wires.
Awesome! Thanks a ton for the clarification mate. I guess I didn't technically wire it up wrong then 🤣
0(2)-10V DC or 0(4) - 20mA are very common industrial signal levels. It might have said rs485 which is a 2 (or rarely 4) wire serial wire protocol like rs232, and it is quite common that devices speak Modbus RTU over the serial unless it is something proprietary.
According to Shelly the outputs are potential free so the won't send any power just switch it. The Shelly wiring diagram (on the knowledge base) is kind of vague but you probably need to connect it in series with the power supply but don't take my word for it but that is how you connect a relay. It also states that it can max switch 0.1A.
Awesome, thank you for all those details. I am happy with the 0-5V, although 0-10V might have given me slightly more detailed/granular data.
Are you saying the Shelly Uni can't power devices?
Yes, I knew about the 0.1A max, which is fine for most devices. I am about to test one with a solenoid to turn water on and off, so we'll see if 0.1A is enough for that.
@@LarsKlintTech If it is as the manual says "potential free" the outputs are just a "switch". Kind of like the output on the "Shelly 1 Plus" but that is a relay.
More signal resolution is always a good thing but if you want to use it with something that is 0-5V later on stay with that.
Read the manual but a solenoid might sometimes require a snubber to last in the long run if the UNI is using a TRIAC for the switching.
@@Maaniic This is all really helpful. Thanks mate 😊
@@LarsKlintTech My understanding about Shelly Uni's outputs is that they should be used more like button press simulators that to switch loads on or off. The "relay" function is done with the help of two small transistors, transistors that can handle a very low load - 0.3Watts or something.
@@valentinene yes, reading up on it, I kinda understand it now. It seems the voltage rated on the wiring diagram means that is how much power can flow through the switch, not how much it provides. So I could wire the sensor through the Shelly Uni output logically, but not power it from it. I think. 🤔
Great content/videos Lars. I am currently using a Arduino nano and a 16x2 lcd in my pump shed to display tank water level, but since seeing your implementation using the shelly UNI I will be replacing the Arduino and integrate that into HA alongside my victron off-grid dashboard on HA.
That is awesome. That sounds like a decent upgrade. I have 4 of them now, and they have never failed me. They work really well.
I will have to go google "victron off-grid dashboard" now though....
@@LarsKlintTech can I ask what was the pressure transducer your using on the bore tank. The one I got from ali is returning some unstable voltages due to temperature drift. Not very stable. Mine is a 0 to 30 psi, measuring a 3 meter head of water. I'm figuring you get what you pay for when it comes to transducers.
@@Tek69 I can't remember tbh. They were off eBay or AliExpress. A couple of them failed too, so I replaced them. I think they were 5 and 15 psi. That is one of the reasons I went to the in-tank ones in this video.
HACS has the victron integration
By the way I'm going to do the auto gate setup on my property too. 👍
Thank you this is very helpful. On my farm i dont have electricity at my tank, do you have any solutions for powering the shelly and depth sensor? I wouldnt know power requirements or what size batteries to use if i was to make the solar array myself, not sure if there is an off the shelf product to suit?
It is difficult to answer without seeing you setup, and then still difficult 😂 You probably need a solar panel, a solar controller, and then an output from the solar controller to power the sensor and Shelly.
Great Video! I have a question: Is there a way to display/convert the voltage into something meaningful, such as a percentage or a gauge, without the need to host a home automation platform at home? I am trying to monitor the water tank level without setting up a home automation server.
Thanks mate for watching. Good question. I am not sure, but I would imagine so. There is probably a analog gauge you can plug it into directly.
@LarsKlintTech thanks for the reply. I'm not looking for something analog, I'm looking for a free online service/website with a decent mobile app that might allow me to do that without needing to install HA software at home.
@@vickenk So you are after Home Assistant in the cloud? I don't think anything "free" will possibly solve your challenge. I am not sure anyone would host your data and provide an app without some form of compensation?
Great video as always mate - I wish there were more off the shelf solutions for this sort of thing. Would also love ideas on how to power if I don’t have power at all of my tanks - hmm 🤔 small solar maybe
There probably is some off the shelf stuff, but then it'll have its own app and no integration. This is reasonably simple, but only if you are familiar with HA of course.
Small solar could definitely work. I did the water tap on solar video, which is a similar idea.
Thank you, very much! I added a depth sensor and Uni just like this last week. But I was flustered by the fluctuating readings. And other TH-cam explanations for building a template were overly complicated. So much appreciated.
@@timtrafford4718 Awesome! Glad you got it working, and there are many ways of configuring the beast (as you are finding).
Can you help me understand what I have configured wrong: wired the S. Uni as you did with a 12v power supply + power to the pressure sensor ( 0-10V). I am seeing voltage from about 7.5 to 8.3. I verified voltage 12v from the power brick to the Uni. How can I troubleshoot my configuration?
Are you seeing 7.5 to 8.3 volts from the pressure sensor? If it is measuring 0-10V, that seems like a valid measurement?
Hi, thank you for the tutorial! I have a tank that is 2.5 m deep. What length do you suggest for the sensor?
3 meter should do it. It really just affects the voltage you get, so it doesn't matter a lot.
@@LarsKlintTech Thank you very much for your reply! Is there anything else you could tell me after this period of use?
@@emilianoferrara5 my Shelly UNIs have been an excellent choice. They do drop out occasionally and then come back soon after. I haven't worked out why they do that. I still use the same sensors too without a single issue.
@@LarsKlintTech ok. thanks a lot
Lars - is there a way to set a retain value for the Shelly uni? My project is very similar to yours but powering with a 12v battery pack of 1860's with a solar panel. When the battery goes below power level to keep Shelly running - it goes offline until the sun comes out again next day. I know that when using esphome you can put in the yaml a retain: true line and the values are retained in the gauge card.
Very good question. As far as I know there isn't a memory feature on the Shelly Uni when the power is gone. Add more batteries?
Hi Lars. Just questioning how the peaks and troughs can be ironed out in the output? I've gone from 149500L to 141000L pretty much in 24 hours (no its not leaking :-)). I presume the difference is barometric pressure but not entirely sure? Thanks. Keep the informative videos going, they are very useful.
Barometric can definitely make a difference on such a large volume, and you can include that measurements in your calculations, if you have access to it. You can also use a statistics sensor in HA, which gives you a bunch of different options for manipulating the values.
www.home-assistant.io/integrations/statistics/
Thanks for this Video! Which type of sensor is the right one for the Shelly Uni:
4-20mA Output, 0-5V Output, 0-10V Output, RS485 Output?
Thanks for watching Ralf. I use the 0-5V output version, and the 0-10V should work just fine as well. The Shelly UNI doesn't support mA output, so not sure what that is for.
@@LarsKlintTech Thanks for the clarification. You aliexpress link defaulted on the mA unit, which confused me. Perhaps the 0-10V has better resolution/less noise than the 0-5? Although at this price point I doubt that high accuracy is a thing. Really good find on both the sensor and the Shelly uni.
@@dmiller9786 No worries. Yeah, I couldn't link to the exact version I got of the sensor. They are remarkably accurate, and if you put the output through the statistics sensor as well, you can get a super stable measurement.
Thank you for sharing!
Thanks for watching mate 😊
Nice videos Lars, I agree this sensor is great!
Thanks Simon. Yeah, I got another one after this video and very likely getting a third. They are super stable and accurate.
Hello I came across your video today, I am also playing with the Shelly Uni and the same 0-10v sensor level, your video has been handy in that I had to bridge the negative supply and the earth ground to get a feed back from the sensor into the Uni to read . Thanks, still yet to play with HA
Yeah, it took me a while to figure it all out too. Thanks for watching Ross, and let me know how you go with HA too 😊
Hi another Great Video.... On the Template you created i see you already have an idea of how many Liters of water are in the tank ...... I my case am using underground Well am not really sure how many liters of water is down there .... How do i get around that in my own template thanks
That is a tricky question. If you are lowering the sensor into the well, can you tell how far down the bottom is? If you can do that, then you know the height. If you don't know the width of the well, then you might be able to guestimate it by pumping out maybe 1000 litres and see how much the voltage drops. If you assume the voltage is 0V if the well is empty, you should be able to deduct how much water is in it, if you know the voltage drop for 1000 litres.
Hi Lars, Just finished installing some tanks, now looking to get a reliable level, bought a ultrasonic distance sensor a couple of years ago for another project but it seems faulty now I've installed in these tanks(after installing it so neatly too in the top of the tank, always the way), now looking at a pressure sensor as it would seem more reliable long term.
Does the sensor sit on the bottom of the tank(i.e probably laying down), or does it hang? I'm not find a lot of info on that when I look around.
Cheers,
Good question Ryan. I don't think it matters. The pressure sensor I use in this video is not very long relatively to the height of the tank, so at most you'd get a tiny voltage difference, which you can compensate for in Home Assistant anyway. I just plonk mine in the tank until it hits the bottom and I haven't had any issues with it.
On a side note I am not a fan of the ultrasonic either, as I have heard other anecdotes of them being unreliable and unstable.
@@LarsKlintTech Yes, done that with ultrasonic sensors - A02YYUW. Hopeless, subject to noise (rain, wind, filling) in the tank and didn't survive in the damp atmosphere (despite the specs). Wasted a lot of my time, but not much money, on that idea. Moved on to the pressure sensors.
Hello nice work over there
But I need to change voltage to % like 0.00 volt = 0% and 3.00 volt = 100% for example
Is that possible?
I am not sure what you mean 🤔 If you follow the math in the video at 18:00 you can adapt that to output a percentage instead of litres.
@@LarsKlintTech yes I did work on it simultaneously after I write this comment.
Thank you for your replay.
What I did I used template then I saw in my uni the max is 3V & the min is .10V. So I divide the Voltage on 3 then multiply on 100 then add % to have it after the the number but the problem is I have alot of digits.
I think I have to use statistics After that I’m not sure.
Thanks
@@Ibra96m Use the "round(x)" function in your template to get rid of the digits you don't want. I use it in the template as well.
@@LarsKlintTech okeyy
I sow it many times in examples but I don’t what it is meant
@@Ibra96m All good. We learn 😊
Quick update note for anyone else as dumb as me, just to help out. I blew a power supply in a rain storm a few weeks back. I dried everything out, added a new power supply and redeployed it to the tank. I kept getting the same voltage at whatever depth. In short it had become useless. I assumed that the power spike had killed the sensor so I ordered a new one, which came today. connected it up and got the same result. After a bit of thinking time.............................. I realised that the ADC voltage has to work in conjunction with one of the power supply polarities and that I had (when replacing the original power supply) inadvertently reversed them. Corrected that and we're back in business. We now have a spare sensor (doh !), which I'm going to try and deploy at the dam after I get some wifi and battery power down there
Thanks for sharing Peter. We have all been there. I have gone wrong so many times with various projects, but we just keep iterating until we get it right 🤓
Is that a DAB Esybox mini on the tank?
Is that connected to home assistant?
*_Quickly googling what a DAB Esybox Mini is_*
No, this is the older generation, that don't have any smarts in it, but the same idea for a pump. If I have to replace any pumps, I am definitely looking to get them into HA though.
Hi Lars, great video! I ordered a sensor off eBay but it only has a red and black wire. Any idea how to connect these to the uni? I noticed yours is a three wire. Thanks in advance, Nik
Thank Nik. Appreciate the watch :)
I am guessing you have gone for the 4-20mA sensor which sometimes has only a red and black wire. You need to power it in a loop where the measuring equipment sits between the sensors black wire and the power supply's black wire/negative. However, the Shelly Uni only measures voltage as far as I know, so I don't think you can use the sensor you have with the Shelly Uni. This is of course based on my assumption that you got a 4-20mA sensor and basic understanding of the Shelly :)
I hope that helps a bit.
@@LarsKlintTech Hi Lars, thanks so much for the quick response! That's correct, the sensor I have is a 4-20mA, but I think you are correct and I may need to swap this out with another one! I read somewhere that I could potentially use a current sensor where "The module outputs a voltage proportional to current passing through the sense pins on the module." Honestly though this is all new to me, so it may not work. One things for sure, I've certainly learnt a lot from your channel and for that I'm very much appreciative! The detailed explanations are fantastic!
@@NikValentine No worries Nik. That current sensor solution sounds complicated imo. The Shelly Uni is a great device, and I would find a sensor that works with it, to keep things simple and stable.
And thanks for the kind words. That is exactly why I create the videos, to share some of the knowledge I find on the way.
@@LarsKlintTech Hi Lars, I just wanted to send a quick message to say that after a lot of trial and error, I finally got the 4-20ma sensor to work, however it ended up involving a breadboard and two 1k ohm resistors run in parallel. Suffice to say, using the three wire sensor would have been much easier. In any event, I wouldn't have even thought this was possible without your channel, so thanks again for all your help and keep up the good work!
@@NikValentine Ah, you persevered! Good job mate, and it kinda make sense in my limited brain capacity that you need resistors to measure the current, rather than volts. Thanks for letting me know (and confirming I did the easier solution 😂). And thanks for your support of the channel too. You are the reason I do the videos.
I'm still trying to get my head about the sensor you have. I have a Taylex 31500 litre tank, which is 3450mm wide, and 4100mm high.
So should I get the 5m or 4m sensor with a 5m cable ?
BTW, I like your choice in water pumps, I have the same pump here on my house. :)
Hi Brendan. No worries, it took me a while to figure out the wording and how it all relate. The "range" length is the depth of your tank, or the max depth that your sensor will measure max voltage when the tank is full. So a 5m range will measure 5v in a full 5m deep tank. In your case you'd need the 5m range at least with possibly some extra meters to get the cable to your shelly UNI or whatever device you use. Perhaps a 7m/7m to give you about 3 meters extra coming out of the tank? You could also use the 5m/5m, but then you only have about .9m to play with outside the tank.
With whatever range and cable length you choose, you'll have to calibrate your calculations, as there are always some fluctuations once installed.
Saw this one Submersible 0-10V 4-20mA Output Hydrostatic Level Sensor Transmitter DC12-36V Water Tank Liquids Transducer Meter , but is it the same thing? It comes in a 5m range, and 10m of cable, as a better price too.
Wouldn't a 7m range in a 4.1m deep tank have a lesser resolution of depth ?
@@brendanpratt7760 It sounds like the same thing. And 5m/10m should give you plenty of cable to play with too. Yes, with 7m you would "lose" some voltage range in the measurement, so you are better at getting it as close to the depth as possible. However, overall, you wouldn't notice a huge difference, as the 0.01 increments are granular enough imo.
This is so good. I'm all over it. But how many of these analog pressure sensors could you add to one shelly uni? If I had 2 tank next to each other, could I run two sensors form them into the one shelly?
Thanks for the kind words Shaun. You can only have one sensor per Shelly UNI, as you need the ADC input (white wire) on the Shelly to receive the voltage from the pressure sensor. The signal/voltage is analogue so you need the Shelly to convert it into a digital value HA can use. Also, Shelly UNIs are cheap, so it isn't a huge problem?
Marvelous Lars, thanks for your efforts sharing with us all :)
Could I ask, would it be possible to trigger a flashing alarm light when a specific water level is reached do you know?
Haven't setup HA yet but will finally be getting round to it and first sensor will be a Shelly Uni and one of these tank sensors.
I too want to monitor a couple of rain water tanks that is our water supply, but also to monitor and alert if our grey water tank level rises too high (indicating a fault with the pump) and council regs specify a flashing light on the tank.
The one that was there is old and busted and rather than the old way I want to go this newer way and kick off my HA journey!
Cheers from Northern NSW.
Matt.
Hi Matt. Good question and YES, absolutely! You can get Home Assistant to trigger almost any kind of event. I would use something like a Shelly 1 to get the light wired up, and then you can control that from HA too. Oz Smart Things has all the Shelly units and use discount code LARSKLINT for 5% off too. Support the Aussies 😁
@@LarsKlintTech awesome man will use that code thank you :)
Oz Smart Things Stripe checkout says "Enter a valid discount code or gift card"
(Posting here in case it helps others...)
@@Ltech-ludditetechnologies It worked though?
@@LarsKlintTech regrettably the code did not and I am under time pressure with council (overdue (on the extension) for my inspection)
I would however like to buy you a coffee to even that out by way of thanks.
Hi Lars, the negative of the pressure sensor should be connected to Pin 6 (GND ) and not to the negative of your power source.
That is not what the documentation for the sensor states.
@@LarsKlintTech see fig.6 shellysa.co.za/wp-content/uploads/2021/04/Shelly-UNI-User-Guide.pdf
Is there a similar device that would work in skimmer box of pool in order to keep pool level topped up?
Hmmmm, excellent question Daniel. A skimmer box is very shallow usually, so a pressure sensor would be difficult to use there. This guy built a water level float sensor: neon.ninja/2017/11/smarter-swimming-pool-3-water-level/
@Lars Klint Awesome, thanks Lars I’m definitely going to take a look at that. On another topic, what font are you using for your HA? It’s something I’ve been meaning to do with my own dashboards.
I might pick up one of these 1m pressure sensors and give it a try with the Shelly Uni, found another video on YT which seems to look like it will work. Been looking at a way to monitor my pool water level for a while now.
Here is the other video i was talking about th-cam.com/video/T474YCr2574/w-d-xo.html
@@dsellars Ah, cool. Yeah, that could work. I might even do that too 😏
As a fellow microsoft guy homesteading in Australia who has taken on many similar projects over the years, I really appreciate you!
Silly question, when the sensor says its range and cable length (e.g. 5m range and 5m cable) does that mean that the supplied cable is actually longer (e.g. 5m of cable to get to bottom of 5m tank over ground and 5m of cable go get back down to ground) or would you need to extend the cable?
Cheers
Thanks Dale for the kind words ☺ No silly questions here. That is a good one. It took me a bit to figure it out, but the "range" is how deep a body of water you want to measure. It is the calibration of the sensor, so a 3 meter range will be at near to max voltage (if you chose a voltage sensor) at 3 meters. A 5 meter range is close to max at 5 meters and so on.
The cable length is the length of the cable at the end of the sensor.
Hi Lars, Great video, and I just got the components, and the voltage dat is flowing into HA.
But I just can't get my configuration.yaml to work with the statistics and Template sensor for converting to litre. .
So I assume it would help me a lot, if I could get a copy of your files as examples.
På forhånd tak Ole 🇩🇰
I manage to get the statistics part to work, but the conversion to liters is still not solved..
@@OleSchmitto Hej Ole. Here is my YAML for the specific parts.
- platform: statistics
name: "House water tank level median voltage"
entity_id: sensor.shelly_uni_house_tank_adc
state_characteristic: median
max_age:
hours: 2
precision: 4
- platform: template
sensors:
house_tank_litres_shelly:
value_template: >
{% set voltage = states('sensor.house_water_tank_level_median_voltage') | float %}
{{ ((voltage / 2.6) * 45804) | round(0) }}
@@LarsKlintTech Perfect... worked and also your code remove the decimal, which makes it nicer to look at. Decimals, remember, that for the incoming voltage from the Shelly device, I need to change the Shelly HA integration setting / voltage to 2 decimals.
Tusind tak for hjælpen. 👍🇩🇰. Ole
@@OleSchmitto Det var så lidt Ove. Du siger bare til hvis der er noget der ikke virker :)
@@LarsKlintTech In Home Assistant I am receiving data from the sensor every second, which in my opinion is to often, so do you see the same issues and maybe solved it.
Can give a wiring diagram of level sensor. Thanks
Good question. I don't have one as such, but if you click the link to the sensor, you can see the wiring diagram based on which version you choose, and the wiring diagram for the Shelly UNI is at the link for that device. At 11:05 I show the wiring too. I hope that helps 😊
Is the pressure transmitter food grade?
Yes, it is made from 304 stainless steel, which is food grade and commonly used for food preparation, dining, and storage.
I baught two of them sensor, now after a month, they are in tilt, no signal. Someone have same problem?
Can you provide some more details? Can you measure the voltage from them directly? What device is receiving the signal from the sensor? Did it work and then suddenly not? Can you explain a bit more about your setup?
There are a min/max helper in HA
For which part would you use it?
Lars, you are a bloody genius. However, I am not. I have the Shelly Uni outputting varying voltages to my two tank sensors but for the life of me I can't work out how to convert the voltage to litres. I've got the diameter and depth (currently 64000L) but that yaml stuff is beyond me, I'm addled. I've been unable to find a video or tutorial that describes how to do this for simpletons. If you know of one please share. Thanks again 🙂
Haha, I don't know about that, but at least it is in writing now 😛
If you look at the screen in the video at 22:18 you can see the configuration.yaml file. This is the main config file for Home Assistant where you put everything that isn't "out the box" in HA. You can see a section in the YAML which says "-sensor" at the top. That starts all the various custom sensors I have. A sensor is just a data point that HA can read. Then it says "-platform: template" which means a template sensor. A template is pretty much any kind of calculation you want to do, where you take an input, such as the UNI voltage, and then converts it to another value.
I have created a number of template sensors, each of which is a water tank litre measurement. For example, for the "house_tank_litres_2" sensor, I have use the voltage from the "sensor.sensor_house_tank_voltage_2" which is my Shelly UNI voltage. The main thing I always get wrong is the correct syntax with what is in quotes and what isn't.
Does that make any sense?
@@LarsKlintTech Thank-you Lars for your prompt response. I shall have a go using this information, thank-you. My computer skills haven't improved since we filled out dozens of cards with 2B pencils (which were then sent to a nearby school lucky enough to have a computer) to run simple programs. We'd get the results back a week later usually with disappointing results. I digress 🙂 Thanks again.
@@lensman893 No worries. It is one of those things where once you get it working, you can copy paste it and get it working much faster the second time.
If you send me your punch cards filled in with 2B pencil, I will make sure nothing happens with them 😂
@@lensman893 I had a similar problem with the template part. I realised that putting the code into something like notepad++ is much better as the formatting is crucial in yaml.
@@patraff1280 Thanks for the tip. I had a good crack at it a few days ago and made progress. I hadn't realised that the tiny hard to see - (in red) was important 🙂 Now I just need to work out why it doesn't show as a line graph as opposed to a long bar. Kudo to Lars for publishing his code for us to copy, I'd never be able to understand that yaml...
Why don't you use level transmitter instead of pressure transmitter.
Good question. The level transmitters require more rigging to set up usually, and I didn't want a hole in the top of the tank in this case. Just lowering the sensor and plugging it into a Shelly Uni is very simple, so I chose that approach.
Shelly Uni is not for sale in the U.S.
I can order them for delivery to the US using their main website: www.shelly.com/en-us/products/shop/shelly-uni
I don t know why, After 1 month that tl136 was working well, from today i have not signal from It, 0 voltage. I tried to Change shelly uni ... Always no signal ... Somebody can help me?
Step 1 is to confirm the sensor is the faulty part, and not somewhere else in your setup. Can you put a voltage through the sensor manually and see if you get a reading at all?
Step 2, if the sensor is faulty, is go back to the seller and talk to them about a replacement under warranty.
@@LarsKlintTech ok, thanks a lot. I Will try your steps.
@@antonioadragna1262 Let me know how you go with it.
Odd question…did I see you at Umina maccas last night?
Hahaha, nope.
Third time lucky in adding a comment....agghh
I have similar hardware as but I flashed Tasmota onto the shelly UNI over the air. Why? Because I am familiar with it and I could slow down the number of times the data was being sent as the shelly didn't do that. Anyway the Tasmota does the calculation for the litres on the device and I send that via MQTT. Seems to work. I don't need to do any of the calculations on the home automation side and can pick the period of data transmission. Look for a video a ubeaut productions as I cannot add any links to the comments...agghh
I haven't done anything with Tasmota, but I can see why you'd go down that route. I'll see if I can find the video.
And yes, YT really doesn't like links in the comments 🙄