thermferm/thermferm.c

changeset 361
308f6a436779
parent 355
8f946f9d125a
child 362
c92651a54969
equal deleted inserted replaced
360:0f3fe4fa0977 361:308f6a436779
1390 } else if (unit->mode == UNITMODE_PROFILE) { 1390 } else if (unit->mode == UNITMODE_PROFILE) {
1391 sp = unit->prof_target; 1391 sp = unit->prof_target;
1392 } 1392 }
1393 1393
1394 P_err = sp - pv; 1394 P_err = sp - pv;
1395 if (P_err < unit->idle_rangeH && P_err > unit->idle_rangeL) { 1395 if (P_err < unit->idle_rangeH && P_err > unit->idle_rangeL && usePid == FALSE) {
1396 P_err = 0.0; 1396 P_err = 0.0;
1397 } 1397 }
1398 1398
1399 if (usePid) { 1399 if (usePid) {
1400 /* 1400 /*
1510 * cooling or heating. The Fan has a start/stop delay. 1510 * cooling or heating. The Fan has a start/stop delay.
1511 */ 1511 */
1512 if ((unit->heater_address && unit->heater_state) || (unit->cooler_address && unit->cooler_state)) { 1512 if ((unit->heater_address && unit->heater_state) || (unit->cooler_address && unit->cooler_state)) {
1513 if (unit->fan_wait < unit->fan_delay) { 1513 if (unit->fan_wait < unit->fan_delay) {
1514 unit->fan_wait++; 1514 unit->fan_wait++;
1515 // syslog(LOG_NOTICE, "fan_wait + %d/%d", unit->fan_wait, unit->fan_delay);
1516 } else { 1515 } else {
1517 if (! unit->fan_state) { 1516 if (! unit->fan_state) {
1518 syslog(LOG_NOTICE, "Unit `%s' Fan Off => On", unit->name); 1517 syslog(LOG_NOTICE, "Unit `%s' Fan Off => On", unit->name);
1519 unit->fan_state = 100; 1518 unit->fan_state = 100;
1520 } 1519 }
1521 } 1520 }
1522 } else { 1521 } else {
1523 if (unit->fan_wait > 0) { 1522 if (unit->fan_wait > 0) {
1524 unit->fan_wait--; 1523 unit->fan_wait--;
1525 // syslog(LOG_NOTICE, "fan_wait - %d/%d", unit->fan_wait, unit->fan_delay);
1526 } else { 1524 } else {
1527 if (unit->fan_state) { 1525 if (unit->fan_state) {
1528 syslog(LOG_NOTICE, "Unit `%s' Fan On => Off", unit->name); 1526 syslog(LOG_NOTICE, "Unit `%s' Fan On => Off", unit->name);
1529 unit->fan_state = 0; 1527 unit->fan_state = 0;
1530 } 1528 }

mercurial