enum modes {
mode_heat = 'C', /* Normal heating */
+ mode_delay = 'D', /* Delayed heating */
mode_ext_disable = 'E', /* Forced heating disabled by external input */
mode_forced = 'F', /* Auto Forced heating */
mode_manual = 'M', /* Manual Forced heating */
- mode_delayed_heat_prod = 'P', /* Pause */
+ mode_delayed_heat_prod = 'P', /* Paused forced heating */
mode_temp_OK = 'T', /* Max temperature reached */
mode_overvoltage = 'V', /* Overvoltage detected */
mode_overtemp = 'H', /* Mosfet over-temperature detected */
}
}
break;
+ case mode_delay:
+ /* FALTHROUGH */
case mode_temp_OK:
/* FALTHROUGH */
default:
msg = "Forced mode disabled by configuration\n";
}
}
+
+ /* Delayed heating ? */
+ if ((mode == mode_heat) && (solar_prod_value < home_conso_value) && (command_val == 0)) {
+ mode = mode_delay;
+ }
+
}