fwsettings.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. // PRE-COMPILE CONFIGURATION
  2. //#define FORCE_SPIFFS_FORMAT
  3. //#define DEBUG_VERBOSE
  4. //#define DEBUGMODE // WARNING - DEBUGMODE reveals saved passwords on serial connection and shows note in web interface
  5. //#define DEBUG_SERIAL true
  6. #define DEBUG_MQTT true
  7. //#define USE_MQTT_TLS
  8. // currently does not work
  9. // ENABLE FEATURES
  10. #define ENABLE_FEATURE_NTP_TIME
  11. #define ENABLE_FEATURE_WEB_CONSOLE
  12. //#define ENABLE_FEATURE_WEB_CONSOLE_WEBSOCKETS
  13. #define ENABLE_FEATURE_PW_ENCRYPTION
  14. #define ENABLE_FEATURE_HTTP_UPDATER
  15. #define WEB_CONSOLE_BUFFER_SIZE 4000
  16. #ifdef ENABLE_FEATURE_NTP_TIME
  17. #include <time.h>
  18. #endif
  19. //#ifdef ENABLE_FEATURE_WEB_CONSOLE_WEBSOCKETS
  20. #include <WebSocketsServer.h>
  21. //#endif
  22. // ENCRYPTION KEY used for passwords - up to 100 chars
  23. #define PW_ENCRYPTION_KEY "PLhg2i7fPoYSoipq1hTF1KOqyzp3OPWtUzufCDWmD9KgxbaKYOG5WbxoO4QoLDj3F6Iif4R55UbHX1nRo7GKNqT6QXQCTsdFvFem"
  24. // default values, can later be overridden via configuration
  25. #define MAX_MEASUREMENT_AGE 30000 // in ms, for measured inside Temp/Hum
  26. #define MAX_MEASUREMENT_AGE_OUT 300000 // in ms, for received outside Temp/Hum
  27. // NTP defaults
  28. #ifdef ENABLE_FEATURE_NTP_TIME
  29. #define DEFAULT_NTP_ENABLED true
  30. #define DEFAULT_NTP_SERVER "pool.ntp.org"
  31. #define DEFAULT_NTP_SYNC_INTERVAL 7200
  32. #define DEFAULT_TIMEZONE "CET-1CEST,M3.5.0/02,M10.5.0/03"
  33. #endif
  34. // confDevWiFi
  35. //#define DEVICE_NAME "WTherm-1" // now created from FIRMWARE_SHORTNAME + last 2 octets of MAC address
  36. //#define DEFAULT_HOST_NAME "" // now created from FIRMWARE_SHORTNAME + last 2 octets of MAC address
  37. #define DEFAULT_WIFI_APMODE_PASSWORD "nichtsicher" // min 8 chars!
  38. #define DEFAULT_WIFI_APMODE_TIMEOUT 5 //min
  39. #define DEFAULT_WIFI_RETRY_INTERVAL 5 //min
  40. #define DEFAULT_WIFI_CONNCHECK_INTERVAL 20 //s
  41. #define DEFAULT_WIFI_REBOOT_ONNOCONNECT 60 //min
  42. // confWeb
  43. #define HTTP_SET_TOKEN ""
  44. #define DEFAULT_HTTP_USER ""
  45. #define DEFAULT_HTTP_PASS ""
  46. #define DEFAULT_HTTP_USER_AUTH false
  47. #define DEFAULT_ENABLE_WEBCONSOLE true
  48. // confMqtt
  49. #define MQTT_ENABLE false
  50. #define MQTT_SERVER ""
  51. #define MQTT_PORT 1883
  52. #define MQTT_USER ""
  53. #define MQTT_PASS ""
  54. #define MQTT_TOPIC_IN "Test/WTherm"
  55. #define MQTT_TOPIC_OUT "Test/WTherm/stat"
  56. #define MQTT_OUT_RETAIN false
  57. #define MQTT_OUT_RETAIN_SENSORS false
  58. #define MQTT_OUT_PUBLISH_INTERVAL 0 // min, 0=only on change
  59. #define MQTT_OUT_PUBLISH_INTERVAL_SENSORS 5 // min, 0=only on change
  60. #define MQTT_WILLTOPIC "Test/WTherm/availability"
  61. #define MQTT_WILLQOS 2
  62. #define MQTT_WILLRETAIN false
  63. #define MQTT_WILLMSG "offline"
  64. #define MQTT_CONNMSG "online"
  65. #define MQTT_ENABLE_HEARTBEAT true
  66. // max interval for MQTT heartbeat message. only applicable if MQTT
  67. // IN-topic is defined. after this timeout MQTT reconnect is forced
  68. #define MQTT_HEARTBEAT_MAXAGE 180000
  69. // max interval for MQTT heartbeat message. only applicable if MQTT
  70. // IN-topic is defined. after this timeout the ESP will reboot
  71. #define MQTT_HEARTBEAT_MAXAGE_REBOOT 1800000
  72. // confBas
  73. #define DEFAULT_SETTEMP_MIN 16.0 // minimal temperature that can be set
  74. #define DEFAULT_SETTEMP_MAX 26.0 // maximal temperature that can be set
  75. #define AUTOSAVE_SETTEMP true
  76. #define AUTOSAVE_SETMODE false
  77. #define SAVE_TO_MQTT_RETAINED false
  78. #define DEFAULT_MEASURE_INTERVAL 15 // interval for temp/hum measurement
  79. // interval for display updates (if out-temp is active, display will toggle
  80. // in this interval)
  81. #define DEFAULT_DISPLAY_INTERVAL 5
  82. #define DEFAULT_DISPLAY_TIMEOUT 30 // display timeout after keypress (illumination)
  83. #define DEFAULT_PIR_ENABLES_DISPLAY false
  84. #define DEFAULT_PIR_ENABLES_DISPLAY_PRESET0_ONLY true
  85. #define DEFAULT_TOGGLING_I_O_TEMPHUM false
  86. // confAdv
  87. #define DEFAULT_HYSTERESIS 0.15 // hysteresis, normally 0.1 - 0.3
  88. #define DEFAULT_HEATING_MIN_OFFTIME 300 // minimal time the heating must keep turned off until it can start again, in s
  89. // correction value for temperature sensor reading
  90. #define TEMPSENSOR_CORRECTION_VALUE 0.0
  91. #define HUMSENSOR_CORRECTION_VALUE 0 // correction value for humidity sensor reading
  92. // decreases the set temp to overcome further temperature rise when the
  93. // heating is already switched off
  94. #define SETTEMP_DECREASE_VALUE 0.0
  95. #define OFF_MESSAGE "HEATING OFF"
  96. #define INSIDE_TEMP_LABEL "I"
  97. #define OUTSIDE_TEMP_LABEL "O"
  98. #define MODE_NAME_0 "off"
  99. #define MODE_NAME_1 "heat"
  100. #define PRESET_NAME_0 "Normal"
  101. #define PRESET_NAME_1 "Reduction 1"
  102. #define PRESET_NAME_2 "Reduction 2"
  103. // confAdd
  104. #define OUTTEMP_TOPIC_IN ""
  105. #define OUTHUM_TOPIC_IN ""
  106. #define MQTT_TOPIC_PIR "" // extra publish topic for PIR sensor
  107. #define MQTT_TOPIC_PIR_ON "ON"
  108. #define MQTT_TOPIC_PIR_OFF "OFF"
  109. // confLog
  110. #define DEFAULT_LOGLEVEL_SERIAL LOGLEVEL_DEBUG
  111. #define DEFAULT_LOGLEVEL_WEB LOGLEVEL_INFO
  112. #define DEFAULT_LOGLEVEL_MQTT LOGLEVEL_INFO
  113. #define DEFAULT_LOGLEVEL_SYSLOG LOGLEVEL_DEBUG // SYSLOG not implemented yet
  114. #define LOG_WEB_REQUESTS false
  115. // other (not configurable via commands/WebIF)
  116. #define DEFAULT_SETTEMP_HEATOFF 5.0 // heating target temperature in OFF mode (freezing guard, therefore > 0)
  117. #define SETTEMP_LOW_MIN 14.0 // minimal configurable temperature for reduction mode
  118. #define SETTEMP_LOW_MAX 21.5 // maximal configurable temperature for reduction mode
  119. // default initial values
  120. #define DEFAULT_SETTEMP 21.5
  121. #define DEFAULT_HEATINGMODE 1
  122. #define DEFAULT_PRESET 1
  123. #define DEFAULT_SETTEMP_LOW 20.0 // set temperature in night/low mode
  124. #define DEFAULT_SETTEMP_LOW2 17.0 // set temperature in night/low mode
  125. // COMPILE TIME SETTINGS
  126. // default values that can only be configured at compile time / hardware configuration
  127. #define BUTTON_DEBOUNCE_TIME 120
  128. #define BUTTON_HOLD_TIME 750
  129. // pin assignments and I2C addresses
  130. #define PIN_DHTSENSOR 13
  131. #define PIN_RELAIS 15 // 16
  132. #define PIN_BUTTON_PLUS 2
  133. #define PIN_BUTTON_MINUS 0
  134. #define PIN_BUTTON_MODE 14
  135. #define PIN_PIRSENSOR 12
  136. #define DHTTYPE DHT22 // DHT sensor type
  137. #define LCDADDR 0x27 // I2C address LCD
  138. #define LCDCOLS 16 // LCD cols
  139. #define LCDLINES 2 // LCD lines
  140. // default logic levels
  141. #define RELAISONSTATE HIGH
  142. #define BUTTONONSTATE LOW
  143. // SPIFFS settings
  144. #define SPIFFS_DBG
  145. #define SPIFFS_USE_MAGIC
  146. // LOG LEVELS
  147. #define LOGLEVEL_OFF 0
  148. #define LOGLEVEL_ERROR 1
  149. #define LOGLEVEL_WARN 2
  150. #define LOGLEVEL_INFO 3
  151. #define LOGLEVEL_DEBUG 4
  152. #define LOGLEVEL_VERBOSE 5
  153. // END PRE-COMPILE CONFIGURATION
  154. #ifdef USE_MQTT_TLS
  155. static const char *MQTT_TLS_fingerprint PROGMEM = "EC 0E 4B 32 77 6B 6A 03 C6 60 37 A4 DD 0C 4C 47 BC 2D 11 23";
  156. //static const char *MQTT_TLS_fingerprint PROGMEM = "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00";
  157. #endif