diff -r 0ab5c3fd7c77 -r ffc4b8aa824f thermferm/thermferm.c --- a/thermferm/thermferm.c Wed Apr 01 15:20:05 2015 +0200 +++ b/thermferm/thermferm.c Wed Apr 01 15:56:04 2015 +0200 @@ -1432,16 +1432,13 @@ } device_out(unit->cooler_address, unit->cooler_state); } - if (unit->heater_address && unit->cooler_address && unit->fan_address) { + + if ((unit->heater_address || unit->cooler_address) && unit->fan_address) { /* - * If the temperature difference between air and beer is more then - * xxx degrees, turn the fan on to make an airflow. - * Maybe, run the fan too if the heater is on because the heater in - * most cases will be some sort of radiating heat device. - * For cooling ??? dunno yet. + * If there is a heater or cooler and we have a fan, turn fan on if + * cooling or heating. */ - if (((unit->air_temperature - unit->beer_temperature) > 1000) || - ((unit->air_temperature - unit->beer_temperature) < -1000)) { + if ((unit->heater_address && unit->heater_state) || (unit->cooler_address && unit->cooler_state)) { if (! unit->fan_state) syslog(LOG_NOTICE, "Fan Off => On"); unit->fan_state = 100; @@ -1452,6 +1449,7 @@ } device_out(unit->fan_address, unit->fan_state); } + } else { P_err = 0.0; unit->PID_iState = 0.0;