Garden Irrigation

@chairstacker, @walt
Thanks to you two I think I am making progress. I changed to a different weather station and it looks like I might be getting the right data. I just have to hope whoever has provided the weather station doesn’t take it away!

One further question, pws_precip_1d_mm is ‘intensity of precipitation’.

Do you know if that equates to the forecast amount of rain expected today?

Thanks for all your help.

looking strange today, and makes absolutely no sense to me


I’m still getting breaks in my graph too but it hasn’t gone down today.
Although that would be really weird because it shows on 0 mm rain!!! (which is correct at least).

I might have to give up on adjusting my irrigation times based on rainfall for now…

i can’t imagine that there is no useable weather api that gives us the data we need. and you’ve come too far to give up. an irrigation control w/o and temperature or rain input is just a stupid timer. don’t you agree?

I agree absolutely but I have gone round and round with this.
I will revisit it but unfortunately not now.

It is a shame because as you say with the right data I think the calculations are quite useful.

I searched the community and found some links which might be useful
7 Day accumulated rain fall
How to: Daily rain sensor from cumulative sensor using MQTT and template_sensor

Yeah, I’ve seen all of these except the GitHub link but I think that just documents a change to the DarkSky component to include precip_accumulation

According to the DarkSky sensor docs though, this only relates to snow so I have never even looked into it.
Now, I suppose the docs could be wrong :roll_eyes:


As for the other links they are more about collecting data over a period of time, I have a (probably inelegant) way of doing that, it is the raw data I am having trouble finding.

Well this has been an interesting topic to read. This is very similar to how I’ve imagined building an irrigation system for my yard.

I plan on starting small and using a solenoid to control some drip irrigation for my deck. Currently I plan on using a Sonoff SV to control a 12v solenoid to turn the water on and off. This seems like the most straightforward way to do it for me as I really have no experience writing code for arduino or python scripts. So a sonoff flashed with tasmota just seems like the way to go for me.

Which brings me to my main stumbling point for this project. I would like to implement soil moisture sensors into this setup. I’ve found plenty of examples of simple arduino sketches that will read the sensor. What I haven’t been able to locate is a sketch that has the script for the soil moisture sensor and then communicate the data via MQTT. I was planning on using a nodeMCU attached to the soil moisture sensor for this.

This guy appears to have exactly what I’m looking for:

However, I have no idea how to get his coding onto the nodeMCU. The only way I know how to flash one is with the arduino software.

Any help would be appreciated.


@Ciwyn you don’t need a seperate arduino/nodemcu …
you can connect the moisure sensor directly to the sonoff. each of them has one or more free i/o where you can connect sensors. those sensors just go high/low, so can be treated as an external switch.
the tasmota operated sonoff will then send the state of the sensor to homeassistant via mqtt. then you need to program the logic (which is fairly simple) to turn the sonoff relais on/off.

not very meaningful :frowning:


1 Like

Hi @klogg, the variable pws_precip_1d_mm is indeed a forecast value.
Not sure if this would be for the maximum number of mm per hour or the average or if it would be for the next 24 hours or just the rest of the day.
Never tried to use it as all the weather forecasts are wrong all the time :-1:

That does sound easier. I did try a google search on that but didn’t come up with anything. Good to know though. I’m not sure if I could even be in the home automation game without sonoffs and tasmota. They dumb it down to where I can actually understand what’s going on! lol


I’m starting to agree with you!

wanted to share my finished irrigation controller hardware. it’s really simple, and one of the most straight forward wirings ever. :slight_smile: just 4 digital i/o to connect.
it’s powered by a dc/dc 5V 3A converter. as the power supply for the valves is 24VAC (corrected, was 48V before) there is a small recitifer to modify AC to DC at the step down converter. that way i can power the valves and the nodemcu AND the power hungry relais with one power supply.

if anyone is interested i can share the .stl and aliexpress parts list. it’s just a few euros/dollars.


Just for a reference point, I integrated a DC-DC converter ( onto a 4-channel (non-pro, non-R2) so that it would run on a standard US 24VAC irrigation transformer. The module is a 40V input 2A output adjustable supply. I attached it to the bridge rectifier on the 4CH and back to the 5V rails. The input voltage tolerance is a little tight if you account for over-voltage conditions on the supply, so make sure your input is between 10 and 30VAC. The same can be done with a Sonoff Basic. I just hot-glued the DC-DC on.

On a side note, anyone using the new Tasmota built-in timer functions?

1 Like

@klogg: looks reasonably now. the “precipitation_today” value seems to work somehow at least.
i will need to setup some high sophisticated rain level measuring system to get mm-rainfall per day (a glass with a ruler :slight_smile:) and then see if the values are somehow correct.


for comparison: “dark_sky_precip_accumulation” gives “unknown”, so it may really be snow only.#

btw: this really makes no sense to me:


at 00:00 it was 5mm (for the whole day?). and it was still at 00:01 etc … was then corrected to 4mm from 04:00-04:30, then reduced to 2mm from 04:30-05:30, then further reduced to 1mm for the rest of the day.

maybe we should refrain from using online weather data, and use REAL data from outside?
something like this may work?


rain gauge on aliexpress

@iz3man That looks interesting. I can’t look now but does it ‘talk’ to HA?

it’s 433Mhz. so there may be some more tinkering involved. unfortunately it doesn’t look very well thought out - to me.

looks like it’s counting drops (or a multitude of those) by a swivel mechanism and a hall sensor. and it looks like there’s a wire attached to it - no idea where this goes to.

who’s like to be the guinea pig and order one? :slight_smile:


@klogg: did a lot of thinking over the last days. at the moment i’m irrigating every day. which is suboptimal.
regarding professional lawn shops it’s best to water ONCE A WEEK, in hot summer season TWICE a week.
in our region (center of europe) an estimate of 20-25 l/m2 per week is the optimal amount of water.
maybe we should rethink the algorithm in a way like: “set desired amount of water per area” and then water twice a week until you reach that amount.
so maybe water 10l on monday, then add the rain fall on mon, tue, wed, thu, and the expected rain for fri-son, and then water the difference left to 25l on friday. that way you could be quite sure to not overwater the lawn.
what do you think?

edit: it would also be cool to add something like: water used / today / this week etc …
i guess every household worldwide has a water meter where the water pipe enters the house. your irrigation setup won’t change a lot over time, so once setup it’s quite stable. so i took a stop watch, and counted liters/min for every zone activated. if i could enter this number in the package’s setup it could calculate liters used.