Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Watering my Christmas tree with ESPHome (johnzanussi.com)
100 points by johnz 10 months ago | hide | past | favorite | 43 comments



I love ESPHome. The declarative language makes it fun and easy to do so many little tasks like this. Used with Home Assistant it makes it easy to create graphs of everything. Do I NEED to know how much water my tree consumes? No, but I like seeing it anyway!

When controlling physical systems I try to limit the damage they can do with simple interlocks. For instance, the relay I added to control my central heat is in series with a conventional thermostat which is set for a few degrees above pleasant.

Likewise, you can splice a float switch in line with the pump's power cable, positioned so it will cut off power if the water level nears the top of the tree stand. This will prevent the flood when the software decides to rebel against you.


You can also use a float sensor and relay to control the pump, and use ESPhome for monitoring only.


That’s what I’m thinking I’ll do if/when the sensor fails. Or for v2.


My thoughts exactly on using ESPHome.

My familiarity with float switches is limited to boats. Any you would recommend for this application?


Something like this: https://www.amazon.com/dp/B007CZ6PD2

I just noticed that you're using a mains-powered pump, so don't splice its wires directly. Instead, insert the float switch on one of the wires between the QT Py and the relay.



Perfect. Thank you


A number of years ago I set up a siphon tube running into our Christmas tree stand from a nearby bucket. The bucket had a false—gift wrapped box over it to hide it. Through some empirical testing I found the right water height for the stand and marked it with tape.

I wanted to make an electronic solution, but I think this fared better than whatever code I could write.


Also made one for this year. My particular challenge is that we need a heavy-duty tree stand to account for feline perturbations. This means the water capacity is pitiful (0.5 litres, perhaps). Also there's not a lot of room for float switches.

My design has an optical water level sensor and a cheap peristaltic pump, plus an ESP8266 for sanity ("if on for more than 5 mins, sound the alarm").

Sensor: https://a.aliexpress.com/_mtzF1L6 Pump: https://a.aliexpress.com/_mrGsfVO


It's a cool project. If you don't need a ton of capacity what I did in the past is used a bucket and just some rubber tubing. Once you pull the water through, it will auto-siphon to be the same level as the bucket. Lasted me a week while I was in san diego! :)


I bought one of these off Amazon a few years ago, called the HoHoHoH20.

https://www.amazon.com/HoHoHoH2o-Automatic-Christmas-Waterin...


That is what inspired me to try building something myself. How do you like it? Does it have any reliability issues?


Congratulations on your DIY project, posting the commercial version was not at all intended to throw shade on it. I've reverse engineered plenty of commercial products, both for fun and for profit and know the challenges.

HoHoHoH20 has been ok but not perfect. I had to 3D print a secure mount for the probe to fit my tree stand. They don't really include any kind of mount, the probe kind of hangs on hope and prayers.

The pump doesn't develop enough head pressure to lift water more than 8" or so, which it needs to in order to get over the rim of my tree stand. So when the reservoir is getting low, but not empty enough to trigger the low water level alarm, the pump just runs continuously but water does not flow. Found this out because my cat was curious about the pump noise. The easy solution was to put it on an 8" pedestal.

Anecdotally - we have found that Nordsman Fir trees consume a lot less water, drop a lot fewer needles, and have strong branches that can withstand heavy ornaments and cats. Worth seeking out.


I built something like this but found that the electric arduino water sensor quickly became corroded after a week and a half and ended up replacing it with a float switch.


I also built something along these lines about three years ago and use it every year. I started off with a stainless steel hall effect float switch and it's lasted so far, on its fourth year. I don't have a pump for my water, I use my RO system as a source and a solenoid as a valve. I do use a peristaltic pump to meter out Christmas tree preservative according to the readings from a flow meter on the water side though. It's worked wonderfully, even when changing tree stands.


Good to know. I thought about using both a float switch and an ultrasonic distance sensor.


They have capacitive moisture sensors too


Make sure to read up or watch a YouTube video about which ones are trash, though, since they mostly look alike (and some can be solved with a bit of soldering).


I love this. Great work!

I’ve thought about doing the same thing for years. But in my experience, those cheap capacitive sensors fail quickly. Might be worse when the water gets all sappy or filled with needles.

What sort of fail safe do you have for when the sensor becomes inaccurate?


Thanks!

No fail-safe besides the limit of only running the pump for 10 seconds at a time. I will continue to keep an eye on the data being pumped to Home Assistant and look to add a condition if/when the sensor fails.


You're on your way!

Part of the joy of process control is thinking about all of the ways that things can fail. Adding to your woes...

Relays can fail, and it's actually a common failure mode for them to get stuck in the "closed" position, meaning that your pump runs forever. I learned this the hard way controlling heaters.

Amusing anecdote: I wanted to set something up to water my tree while my family was on a trip, and I ended up with a large pail of water next to the tree and a siphon tube running between them. Totally passive.


Love the project! One thing that would give me the Krepps is to have a 10 liter water bucket next to a mains power outlet. Just thinking about all kinds of ways Murphy could be right here.

Edit: I’m from Europe so for me that feels twice as dangerous. (Don’t know if double the voltage means double the danger though)


I love it, but if you just want to water a tree the siphons work really really well.


Heard those moisture sensors rust. Anybody have insight into whether that’s true ?



A lazier version for the rest of us would be measuring how much time it takes to replenish the water once a day, and then turn on the pump for that amount of time each day.

You can do this with a IFTTT routine and a smart plug.


An issue with that is that the tree will (at least based on my experience) soak up a variable about of water while it is set up. And in general, it will decrease as time goes on (as the tree dies more and more). If you set up the routine based on the first few days, you will likely end up overflowing.


I see. What if you drill a hole at a high water level and drain excess water?

Or use a toilet water tank kind of mechanism so that it turns off the thing manually through a switch if the water level is too high?


That mechanism is called a float valve. They’re really handy in all kinds of situations where you want something to fill, but not too much.


The tech is interesting, but what I like even more is that it may increase the chances of survival of the tree if the root ball hasn't been cut!

I hope there will be an effort to collect and replant Christmas trees, as the cultural practice of cutting down tree and letting them die slowly in front of us (just for our seasonal enjoyment!) strikes me as barbaric.


The trees are planted and farmed specifically to be Christmas trees. If nobody bought them, they wouldn’t be planted in the first place, so the act of cutting down then disposing of a Christmas tree has no net impact to the overall tree population (barring the small amount of Clark Griswolds out there who get their tree from a forest somewhere rather than a Christmas tree farm).


> If nobody bought them, they wouldn’t be planted in the first place, so the act of cutting down then disposing of a Christmas tree has no net impact to the overall tree population

From a carbon capture perspective, you could argue planting, cutting then burying trees is a net positive - but cutting is killing.

From a moral perspective, financially helping an industry based on planting and cutting trees while not using them for shelter (wood is used in housing) or even heat (in a stove or a fireplace) strikes me as barbaric, because it's the purposeless killing of a living creature.

Killing and eating animals (if not vegan) or plants (if vegan) is necessary as we can't opt out of food (but maybe there will be a fully synthetic replacement someday)

Yet I can opt out of killing trees for ornamental purposes - and this tech may help other people save trees, if they can't opt out of having a live Christmas tree, say for cultural or familial reasons (tradition, etc)


After Christmas they don't just end up in the landfill. They are often recycled into mulch. The material used for mulch needs to come from somewhere... So better for the tree to bring some joy in someone's home temporarily rather than just growing and being cut down.


I would find it morally better if mulch could be made from leaves collected in the fall, but knowing about this recycling helps think more positively about the cutting.

Thank you.


Luckily trees' whole purpose in life is for their offspring to grow so we're doing them a favor.


That’s all true, but most of the Christmas tree farms by me exist in land that would otherwise still be natural forest (and border forest land). There would still be trees there, as well as a whole ecosystem. So for at least the ones by me, one might consider them a net negative, ecologically?


I wonder if they can cut the top off and let the rest grow


Why choose a pump over a siphon?


because you can't program a siphon? a siphon isn't going to give you any data that you can then plot on a graph (if that's your kink). also, what kind of Show HN post would a siphon make? You'd just get a bunch of uninspired questions like this.


you could use a solenoid to control a siphon


the relay should just be <$5. no need for a whole 4 plug controllable power strip


What a great post. Thank you!


Cheers!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: