globalVars_thermostat.h 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifdef FIRMWARE_VARIANT_THERMOSTAT
  2. // thermostat - set values
  3. float thermostat_setTemp = DEFAULT_SETTEMP;
  4. float thermostat_setTempLow = DEFAULT_SETTEMP_LOW; // set temperature in night/low mode
  5. float thermostat_setTempLow2 = DEFAULT_SETTEMP_LOW2; // set temperature in night/low mode
  6. float thermostat_currSetTemp = DEFAULT_SETTEMP;
  7. float thermostat_currActualSetTemp = DEFAULT_SETTEMP;
  8. uint8_t thermostat_heatingMode = DEFAULT_HEATINGMODE; // 0 = off, 1 = heat
  9. uint16_t thermostat_heatingPause = 0;
  10. uint8_t thermostat_preset = DEFAULT_PRESET; // 0 = normal/day, 1 = night/reduction 1, 2 =
  11. // reduction 2 (long term leave)
  12. // saved set values (same as above, held in memory additionally to prevent
  13. // saving unchanged values)
  14. float thermostat_setTempSaved;
  15. float thermostat_setTempLowSaved;
  16. float thermostat_setTempLow2Saved;
  17. uint8_t thermostat_heatingModeSaved;
  18. uint8_t thermostat_presetSaved;
  19. float thermostat_setTempLowMin = SETTEMP_LOW_MIN;
  20. float thermostat_setTempLowMax = SETTEMP_LOW_MAX;
  21. bool thermostat_turnHeatingOn = false; // true if heating is active (relais switched on)
  22. //bool heatingLockTimeActive = false; // true if heating is not active due to active lock time
  23. uint16_t thermostat_heatingLockTime = 0;
  24. unsigned long thermostat_heatingLastOnMillis; // last time heating was switched on
  25. unsigned long thermostat_heatingLastOffMillis; // last time heating was switched off
  26. char thermostat_currentModeName[15];
  27. char thermostat_currentPresetName[15];
  28. unsigned long thermostat_heatingOnTime;
  29. unsigned long thermostat_heatingOffTime;
  30. unsigned long thermostat_lastUpdate_setTemp = 0; // set to millis() every time setTemp value is changed
  31. unsigned long thermostat_lastUpdate_setTempLow = 0; // set to millis() every time setTemp value is changed
  32. unsigned long thermostat_lastUpdate_setTempLow2 = 0; // set to millis() every time setTemp value is changed
  33. unsigned long thermostat_lastUpdate_heatingMode = 0; // set to millis() every time heatingMode value is changed
  34. unsigned long thermostat_lastUpdate_preset = 0; // set to millis() every time preset value is changed
  35. bool thermostat_setTempAlreadySaved = true; // only save if not yet done
  36. bool thermostat_setTempLowAlreadySaved = true; // only save if not yet done
  37. bool thermostat_setTempLow2AlreadySaved = true; // only save if not yet done
  38. bool thermostat_heatingModeAlreadySaved = true; // only save if not yet done
  39. bool thermostat_presetAlreadySaved = true; // only save if not yet done
  40. bool thermostat_pendingPresetToggle = false;
  41. uint8_t thermostat_pendingPreset;
  42. char thermostat_pendingPresetName[15];
  43. uint16_t thermostat_saveValuesTimeout = 5000;
  44. unsigned long thermostat_lastValueChange; // is set to millis() whenever setTemp value
  45. // and/or heatingMode value is changed. used for
  46. // autoSave function with hardcoded 5s timeout
  47. uint8_t display_whichTempToDisplay; // 1=temp inside (from DHT sensor), 2= temp outside
  48. // (via MQTT) - if out temp/hum available this value
  49. // and the displayed value pair toggles with every
  50. // displayInterval
  51. #endif