To line dry the laundry, or use the drying machine?
Seems like a simple enough question, but there were a number of variables to consider, BUT homeassistant has information on many of those things already…
First thing is how long will it take the clothes to dry… seems like evaporation calculations could be done, and I found a paper with a formula here:
https://journals.le.ac.uk/ojs1/index.php/pst/article/viewFile/2010/1912
So I started by working that down to something I could put into home assistant as a template sensor…
That gave me this mess (which i think is mostly right, but if you want to double check feel free.):
{%set weather_entity="weather.kane_daynight"-%}
{%set sunshine_percent=(states.sensor.solaredge_current_power.state|float/6000) -%}
{%set temp = ((state_attr(weather_entity,temperature)|int)-32)*5/9+273-%}
{%set wind = (state_attr(weather_entity,wind_speed)|float)/2.237-%}
{%set humidity = state_attr(weather_entity,humidity)|float/100 -%}
{%set pressure = state_attr(weather_entity,pressure)|float*33.86389/10-%}
{%set rn = 9.4*sunshine_percent-%}
{%set delta=((5336/temp)**(21.07-(5336/temp))) -%}
{%set lamda=2.501-0.002361*(temp-273)-%}
{%set y=(0.0016286*pressure)/lamda-%}
{%set ea=1**(21.07-(5336/temp))-%}
{%set d=(1-humidity)*ea-%}
{%set e=(delta*rn+y*(6.43*(1+0.536*wind)*d))/(lamda*(delta+y))-%}
{{((0.2/(e))*1440)|round(2)}}
That should return the number of minutes for a towel to dry on the line, based off of the temperature, windspeed, relative humidity, pressure and “net irradiance of sunlight”. (better measures could probably be made around my thickeest towels and how much water my washing machine squeezes out in a spin cycle, but for now I just used the towel example from the paper and rounded generously, seems over estimating the dry time is preferable to under estimating it.)
The first 4 data points I can pull from any weather station, the “net irradiance of sunlight” is a function of the time of year, and location (which should be something that could be calculated), but also the clouds, and any shade that might be cast on the clothes line. for my needs right now put in some close enough numbers for the max irradiance this time of year by me, and multiplied it out by the percentage of solar power my panels are creating (6kw being the inverter is maxed out).
If you think my math is off, feel free to fix it, but the results I’m getting seem to be in the ball park of what I’d expect.
Now that I know roughly how long clothes will take to dry I can start to look at other items… like will they dry before the sun sets (don’t want to leave them out over night) and will there be rain before they are dry?
So for that I used another template in the notifications I send when the washing machine is done:
The Washing Machine is done.{% if
(states.sensor.line_dry_time.state|int/60)|int <
((as_timestamp(state_attr('sun.sun','next_setting'))-as_timestamp(now()))/60/60)|int
and states.sensor.line_dry_time.state|int+1 > 0 %}You have time to line dry
before sunset.Estimated Time to dry is
{{(states.sensor.line_dry_time.state|int/60)|round(1)}} hours.{%- for cat in
states.weather.kane_hourly.attributes.forecast -%}{%- if
cat.precipitation_probability >0 and loop.index <
(states.sensor.line_dry_time.state|int/60)|int+1%}There is a
{{cat.precipitation_probability}}% chance of rain in {{loop.index}} hours
from now.{%- endif %}{%- endfor %}{%- endif %}
There is probably lots of room for improvements, looking at forecast data and breaking it down that way could probably give a more accurate result (things like putting clothes out 3 hours before sunset and expecting them to dry as the line gets less and less sun would be problematic.)
But over all I thought this would be an interesting project to undertake. I’ve only had one load of laundry out with an estimated time, and only one or two garments were still damp after the initial estimated time passed, so we’ll see how much I need to refine it to get an accurate estimate if the weather holds out for drying laundry on the line.