as winter is approaching (at least in the northern hemisphere), I always struggle to keep the indoor humidity at a good level. Usually it keeps getting too dry and only a humidifier will help.
But sometimes, it will also help to open the windows at the right time and I thought it would be nice to know when.
So here is a rule, that will calculate the expected indoor humidity based on the outside conditions - but at indoor temperature. So If you’d open your windows, let the outside air in and then heat it up to your current indoor temperature - you will know what humidity to expect.
With this, you can do some stuff like:
- Open automated bathroom windows if there’s a possibility to decrease humidity (expected humidity lower than current indoor bathroom humidity).
- Advise to open window to increase/decrease humidity
- Monitor absolute outdoor humidity (rho_D)
- Warn if windows are open too long and expected humidity will be low etc.
What you’ll need:
- Outdoor temperature and humidity sensor
- Indoor temperature sensor (and for comparisons also an indoor humidity sensor)
- Outdoor Temperature: Outdoor_Temp in °C
- Indoor Temperature: Indoor_Temp in °C
- Outdoor Humidity: Outdoor_Humidity in Percent
- Expected Humidity: Humidity_Expected
You probably want to change the items according to the names you already use.
Here is the rule code (It might not be the most elaborate use of openhab code, but I was struggling with unit conversions here and there…)
rule "Expected Humidity" when Item Outdoor_Temp changed or Item Outdoor_Humidity changed then var Number e_sat_w var Number e_sat_w_in var Number e_par var Number e_par_in var Number rho_D var Number humidity_ex val Number t_out = (Outdoor_Temp.state as Number) val Number t_in = (Indoor_Temp.state as Number) logInfo("math.rules","T out is " + t_out) logInfo("math.rules","T in is " + t_in) e_sat_w = 611.2 * Math.exp((17.62*t_out)/(243.12+t_out)) logInfo("math.rules","Saturation vapor pressure ambient: " + e_sat_w) e_sat_w_in = 611.2 * Math.exp((17.62*t_in)/(243.12+t_in)) logInfo("math.rules","Saturation vapor pressure indoors: " + e_sat_w_in) e_par = (Outdoor_Humidity.state as Number) / 100 * e_sat_w logInfo("math.rules","Partial water vapor pressure: " + e_par) rho_D = e_par / (461.51 * (t_out + 273.15)) logInfo("math.rules","Absolute humidity in kg/m^3 " + rho_D) e_par_in = rho_D * (461.51 *(t_in + 273.15)) humidity_ex = 100 * e_par_in / e_sat_w_in logInfo("math.rules","Expected indoor humidity: " + humidity_ex) Humidity_Expected.postUpdate(humidity_ex) end
So maybe someone will find it useful, I’m also open for some improvement hints on my sloppy unit conversion!