Replies: 4 comments 3 replies
|
@Megalos apologies for the six weeks of silence on this. It deserved an answer, and it turns out half of it is now shipped. Your second proposal is in v2026.9.0Triggering on the management allowed depletion rather than on the first millimetre missing is exactly what the new per-zone Irrigation threshold does. Below it a zone waters nothing; once the deficit reaches it, the run covers the whole deficit. Set it to 0 and you get the old behaviour, which is the default so nobody's setup changed under them. It came in through #815, from a different direction (someone wanting deep, infrequent watering for trees), and I did not connect it to this discussion at the time. You proposed it first, in July. Your first proposal: the physics is right, the arithmetic is milder than you thinkYour worry is a real one, and it is the right way round: gravitational water above field capacity drains past the root zone within a day or two and should not be counted on. But the phantom reserve you describe does not survive our defaults, because drainage is not linear. Drainage is applied only above 0, scaled by
So your worked example, 20 mm of rain buying ten dry days, does not happen: that surplus is gone by the next calculation. What does happen is the small version of it, and it is the opposite end of your example. A surplus of two or three millimetres barely drains at all, because the fourth power makes the curve nearly flat down there. It sits until evapotranspiration eats it, which at 2 mm/day is about a day. So the effect you describe is real, bounded to a couple of millimetres and roughly one day, rather than to 20 mm and ten days. Whether that is worth clamping is a genuine question. Clamping at 0 would also discard water that really is available in the first hours after rain, which is not nothing. My inclination is to leave the model alone and be honest about the residue, but I would rather hear your view than decide it alone. The case that does behave the way you describe is a zone with its drainage rate set to 0 and a large maximum bucket. Then nothing removes the surplus and your ten days are exact. That combination is reachable from the UI today and nothing warns about it. That is worth addressing, and it is a smaller change than reworking the convention. On the convention itself, you were right and the documentation was wrongYou said the integration mixes the deficit and absolute conventions, and that the documentation confuses field capacity with the maximum bucket. That is correct, and the documentation said so literally: the Maximum bucket entry described itself as "the soil's water holding capacity", which it is not. It caps the surplus held above field capacity before the rest runs off, and it doubles as the saturation reference for the drainage curve above. It has no effect at all on the deficit side, so it never changes when a zone starts watering. That is fixed, along with a second place where I had repeated it: the new irrigation threshold told people to derive their value from the maximum bucket. It now carries the actual method, total available water times a depletion fraction, as you set out here. Thank you for writing this up properly. It has been the most useful thing in the tracker this week, and it should not have sat unanswered. |
|
Thanks @altmenorg for taking a critical look at this! :) Regarding the MAD-based trigger for irrigation: indeed, this is now available in the latest version through the irrigation threshold. That's a very useful feature. Regarding the maximum bucket value cap: you're right that in my example I implicitly assumed a drainage rate of 0 mm/h. The reason for this is that this is currently what the documentation recommends. The default drainage rate is indeed 50.8 mm/h, but the documentation advises starting with 0 mm/h: https://altmenorg.github.io/HAsmartirrigation/configuration-zones.html. This recommendation seems to originate from an older discussion where @jeroenterheerdt mentioned that there might be a bug and suggested setting the drainage rate to 0 mm/h for the time being: https://community.home-assistant.io/t/smart-irrigation-save-water-by-precisely-watering-your-lawn-garden/197377/694. I'm not sure whether that was actually a bug, or whether it was related to the confusion between the two different bucket conventions. In any case, I agree that simply capping the bucket at 0 mm is not a good substitute for having a proper drainage rate. In this case, I think the documentation should probably be updated so that it no longer recommends setting the drainage rate to 0 mm/h as the default approach. Regarding the Maximum bucket value,I am still unsure about the ideal value for the Maximum Bucket field. Since the drainage rate relies on the The current documentation links this to Available Water Capacity (AWC), but that logic only applies to the Absolute Content Convention, not the Deficit Convention as the integration seems to use. Until we have a better alternative, it might be best to stick with the values from the referenced discussion for now (which appear to use the Management Allowed Depletion (MAD), or 50% of the AWC). I'm curious to learn in case you find a better suitable reference value for the Maximum bucket entry :). |
|
A possible next step could be to make the drainage calculation more continuous. Currently, the drainage rate is effectively calculated from the resulting bucket value and then applied over the entire calculation interval (typically 24 hours). Because the drainage rate depends strongly on the bucket value through For example, with the default An hourly drainage update could already improve this substantially. Open-Meteo provides hourly precipitation data, so the integration could process the water balance chronologically, hour by hour, and recalculate the drainage rate after each step. This would also address another source of inaccuracy: the timing of precipitation within the calculation interval. For example, there is a large physical difference between:
With the current daily calculation, this timing difference is not really taken into account, and the calculated drainage can end up being essentially the same in both cases. In the second example this can significantly overestimate drainage, because the positive surplus has only existed for a short period of time. Using the hourly precipitation data already available from the weather provider could avoid this. The integration could update the bucket sequentially, for example: The drainage rate would then be recalculated for the next hour using the updated bucket value. This would preserve the useful concept of a temporary positive bucket above field capacity, while making both the drainage rate itself and the timing of rainfall much more realistic. It should therefore result in considerably more accurate bucket estimates, especially after heavy rainfall or rainfall late in the calculation period. Would this make sense? I'm not sure how easy or difficult this would be to implement. |
|
@Megalos the exact drainage is released in v2026.9.1-beta2: your 8 mm example now drains 3.74 mm and leaves 4.26, and a test integrates the rate law step by step to check it. The documentation no longer recommends a drainage rate of 0, and derives the drainage rate and the maximum bucket from the soil. The same beta has the hourly evapotranspiration from #818 behind a switch, which is the first half of the hourly water balance you described. Thank you again for the arithmetic. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi all, I had the following thoughts and idea. Let me know what you think. Thanks!
Issue: Inconsistent Soil Moisture Conventions (Deficit vs. Absolute)
In irrigation theory, soil water balance bucket models typically follow one of two conventions:
0 mmrepresents Field Capacity (FC) — the maximum moisture the soil can retain against gravity. Negative values represent a moisture deficit (down to the Wilting Point). Any precipitation exceeding FC cannot be stored and is lost to surface runoff or deep percolation.0 mmrepresents the Wilting Point, while Field Capacity is represented by a positive maximum bucket capacity (e.g.,+20 mm).The integration currently mixes both conventions. It resets the bucket to
0 mmafter a full irrigation (following the Deficit Convention), yet it treatsmaximum_bucketas a positive upper limit above0 mm(e.g., allowing the bucket to accumulate up to+20 mm). Physically, soil in a deficit model cannot store water beyond Field Capacity (0 mm); excess rainfall simply drains away past the root zone.Consequence: Phantom Water Reserves Leading to Under-Irrigation
Mixing these conventions creates an unrealistic "water buffer" after heavy rainfall.
Example:
bucket = 0 mm).20 mmof rain, pushing the bucket to+20 mm.2 mm/day, the integration calculates that no irrigation is needed for the next 20 / 2 = 10 days.In reality: That excess
20 mmof gravitational water percolates deep into the subsoil within 24-48 hours and is out of reach for the roots. By day 10, the soil has actually built up a deficit of-16 mmto-20 mm, severely exceeding the Management Allowed Depletion (MAD) threshold (typically 50% of FC, or-10 mmin this setup). This results in unexpected plant drought stress.Proposal: Enforce Deficit Clamping and MAD-Based Triggers
bucketat0 mmin Deficit Mode: Strictly cap the maximum bucket value at0 mm. Any precipitation occurring whenbucket = 0 mmshould be discarded, accurately reflecting runoff and deep percolation.-10 mm), replenishing the bucket back to0 mm.Benefits:
All reactions