I now changed this to dew point control: if the dew point temperature in the bathroom comes too close to the lowest temperature in house, the fan is turned on. The calculation is quite simple and is easy to integrate in python: Tdewpoint = Temp - (100 - RH) / 5. This should provide better control in both summer and winter. My $0.02.
I use the following python code triggered by temp/humidity changes in the bathroom. It sets 3 variables which are used for plotting and fan control:
- Code: Select all
# determine minimum in-house temperature
T1 = float(indigo.devices[1341195411].displayStateValRaw) # "0.garage.temperature"
T2 = float(indigo.devices[1715241931].displayStateValRaw) # "0.keuken.temperature"
T3 = float(indigo.devices[391429136].displayStateValRaw) # "0.woonkamer.eethoek.temperature"
T4 = float(indigo.devices[740772309].displayStateValRaw) # "0.woonkamer.zithoek.temperature"
T5 = float(indigo.devices[102683172].displayStateValRaw) # "1.badkamer.temperature1"
T6 = float(indigo.devices[1635136217].displayStateValRaw) # "1.badkamer.temperature2"
T7 = float(indigo.devices[1572729555].displayStateValRaw) # "2.slaapkamer.temperature"
mintemp = min(T1, T2, T3, T4, T5, T6, T7)
indigo.variable.updateValue(1201762210, value=unicode(mintemp)) # "afzuiging_mintemp"
# calculate dew point
temperature = float(indigo.devices[102683172].displayStateValRaw) # "1.badkamer.temperature1"
humidity = float(indigo.devices[687813397].displayStateValRaw) # "1.badkamer.humidity1"
dewpoint = temperature - (100.0 - humidity) / 5 # accurate +/-1 C for RH > 50%
indigo.variable.updateValue(1092135224, value=unicode(dewpoint)) # "afzuiging_dewpoint"
# determine whether to humid
if dewpoint > mintemp - 4.0:
humid = "true"
else:
humid = "false"
indigo.variable.updateValue(1955231371, value=humid) # "afzuiging_humid"