config_get.ino 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767
  1. #define CONFPAGE_DEVWIFI 1
  2. #define CONFPAGE_WEB 2
  3. #define CONFPAGE_MQTT 3
  4. #define CONFPAGE_THERM 4
  5. #define CONFPAGE_THERM_VALUES 14
  6. #define CONFPAGE_ADD 5
  7. #define CONFPAGE_TIME 6
  8. #define CONFPAGE_LOG 7
  9. #define CONFPAGE_SENS 8
  10. #define CONFPAGE_DISPLAY 9
  11. #define CONFPAGE_HEATC 12
  12. void getConfig(char *_param)
  13. {
  14. // gets and prints the corresponding config variable for '_param'
  15. //if (serialdebug)
  16. //{
  17. // Serial.print("getConfig - '");
  18. // Serial.print(_param);
  19. // Serial.println("'");
  20. //}
  21. strlwr(_param);
  22. int _isConfPage = 0;
  23. if (strcmp(_param, "values") == 0)
  24. _isConfPage = 100;
  25. //else if (strcmp(_param, "confsecrets") == 0)
  26. // _isConfPage = 0;
  27. else if (strcmp(_param, "confdevwifi") == 0)
  28. _isConfPage = CONFPAGE_DEVWIFI;
  29. else if (strcmp(_param, "confdev") == 0)
  30. _isConfPage = CONFPAGE_DEVWIFI;
  31. else if (strcmp(_param, "confwifi") == 0)
  32. _isConfPage = CONFPAGE_DEVWIFI;
  33. else if (strcmp(_param, "confweb") == 0)
  34. _isConfPage = CONFPAGE_WEB;
  35. else if (strcmp(_param, "confmqtt") == 0)
  36. _isConfPage = CONFPAGE_MQTT;
  37. else if (strcmp(_param, "conftherm") == 0)
  38. _isConfPage = CONFPAGE_THERM;
  39. else if (strcmp(_param, "confadd") == 0)
  40. _isConfPage = CONFPAGE_ADD;
  41. #ifdef ENABLE_FEATURE_NTP_TIME
  42. else if (strcmp(_param, "conftime") == 0)
  43. _isConfPage = CONFPAGE_TIME;
  44. #endif
  45. else if (strcmp(_param, "conflog") == 0)
  46. _isConfPage = CONFPAGE_LOG;
  47. else if (strcmp(_param, "confheatc") == 0)
  48. _isConfPage = CONFPAGE_HEATC;
  49. // confDevWiFi
  50. if (strcmp(_param, "devname") == 0 || _isConfPage == CONFPAGE_DEVWIFI)
  51. {
  52. sprintf_P(logBuf, "%s.devName: '%s'", PGMStr_confDevWiFi, confDevWiFi.deviceName);
  53. sendLog(logBuf);
  54. }
  55. if (strcmp(_param, "hostname") == 0 || _isConfPage == CONFPAGE_DEVWIFI)
  56. {
  57. sprintf_P(logBuf, "%s.hostName: '%s'", PGMStr_confDevWiFi, confDevWiFi.hostName);
  58. sendLog(logBuf);
  59. }
  60. if (strcmp(_param, "ssid1") == 0 || _isConfPage == CONFPAGE_DEVWIFI)
  61. {
  62. sprintf_P(logBuf, "%s.SSID1: '%s'", PGMStr_confDevWiFi, confDevWiFi.WiFiSSID1);
  63. sendLog(logBuf);
  64. }
  65. if (strcmp(_param, "wpw1") == 0 || _isConfPage == CONFPAGE_DEVWIFI)
  66. {
  67. #ifdef DEBUGMODE
  68. sprintf_P(logBuf, "%s.WPW1: '%s'", PGMStr_confDevWiFi, confSecrets.WiFiPW1);
  69. #else
  70. sprintf_P(logBuf, "%s.WPW1: '******'", PGMStr_confDevWiFi);
  71. #endif
  72. sendLog(logBuf);
  73. }
  74. if (strcmp(_param, "ssid2") == 0 || _isConfPage == CONFPAGE_DEVWIFI)
  75. {
  76. sprintf_P(logBuf, "%s.SSID2: '%s'", PGMStr_confDevWiFi, confDevWiFi.WiFiSSID2);
  77. sendLog(logBuf);
  78. }
  79. if (strcmp(_param, "wpw2") == 0 || _isConfPage == CONFPAGE_DEVWIFI)
  80. {
  81. #ifdef DEBUGMODE
  82. sprintf_P(logBuf, "%s.WPW2: '%s'", PGMStr_confDevWiFi, confSecrets.WiFiPW2);
  83. #else
  84. sprintf_P(logBuf, "%s.WPW2: '******'", PGMStr_confDevWiFi);
  85. #endif
  86. sendLog(logBuf);
  87. }
  88. if (strcmp(_param, "wpwap") == 0 || _isConfPage == CONFPAGE_DEVWIFI)
  89. {
  90. #ifdef DEBUGMODE
  91. sprintf_P(logBuf, "%s.WPWAp: '%s'", PGMStr_confDevWiFi, confSecrets.WiFiAPModePassword);
  92. #else
  93. sprintf_P(logBuf, "%s.WPWAp: '******'", PGMStr_confDevWiFi);
  94. #endif
  95. sendLog(logBuf);
  96. }
  97. if (strcmp(_param, "waptout") == 0 || _isConfPage == CONFPAGE_DEVWIFI)
  98. {
  99. sprintf_P(logBuf, "%s.WApTout: %d", PGMStr_confDevWiFi, confDevWiFi.WiFiAPModeTimeout);
  100. sendLog(logBuf);
  101. }
  102. if (strcmp(_param, "wconncheck") == 0 || _isConfPage == CONFPAGE_DEVWIFI)
  103. {
  104. sprintf_P(logBuf, "%s.WConnCheck: %d", PGMStr_confDevWiFi, confDevWiFi.WiFiConnCheckInterval);
  105. sendLog(logBuf);
  106. }
  107. if (strcmp(_param, "wretry") == 0 || _isConfPage == CONFPAGE_DEVWIFI)
  108. {
  109. sprintf_P(logBuf, "%s.WRetry: %d", PGMStr_confDevWiFi, confDevWiFi.WiFiRetryInterval);
  110. sendLog(logBuf);
  111. }
  112. if (strcmp(_param, "wreboot") == 0 || _isConfPage == CONFPAGE_DEVWIFI)
  113. {
  114. sprintf_P(logBuf, "%s.WReboot: %d", PGMStr_confDevWiFi, confDevWiFi.WiFiRebootOnNoConnect);
  115. sendLog(logBuf);
  116. }
  117. if (strcmp(_param, "ardota") == 0 || _isConfPage == CONFPAGE_DEVWIFI)
  118. {
  119. int _tmp;
  120. if (confDevWiFi.enableArduinoOTA) _tmp = 1;
  121. else _tmp = 0;
  122. sprintf_P(logBuf, "%s.ArdOTA: %d", PGMStr_confDevWiFi, _tmp);
  123. sendLog(logBuf);
  124. }
  125. // confDevWiFi
  126. //confWeb
  127. if (strcmp(_param, "apitoken") == 0 || _isConfPage == CONFPAGE_WEB)
  128. {
  129. sprintf_P(logBuf, "%s.apiToken: '%s'", PGMStr_confWeb, confSecrets.http_token);
  130. sendLog(logBuf);
  131. }
  132. if (strcmp(_param, "httpua") == 0 || _isConfPage == CONFPAGE_WEB)
  133. {
  134. sprintf_P(logBuf, "%s.httpUA: '%s'", PGMStr_confWeb, confSecrets.http_user);
  135. sendLog(logBuf);
  136. }
  137. if (strcmp(_param, "httppa") == 0 || _isConfPage == CONFPAGE_WEB)
  138. {
  139. #ifdef DEBUGMODE
  140. sprintf_P(logBuf, "%s.httpPA: '%s'", PGMStr_confWeb, confSecrets.http_pass);
  141. #else
  142. sprintf_P(logBuf, "%s.httpPA: '****'", PGMStr_confWeb);
  143. #endif
  144. sendLog(logBuf);
  145. }
  146. if (strcmp(_param, "httpu1") == 0 || _isConfPage == CONFPAGE_WEB)
  147. {
  148. sprintf_P(logBuf, "%s.httpU1: '%s'", PGMStr_confWeb, confSecrets.http_user1);
  149. sendLog(logBuf);
  150. }
  151. if (strcmp(_param, "httpp1") == 0 || _isConfPage == CONFPAGE_WEB)
  152. {
  153. #ifdef DEBUGMODE
  154. sprintf_P(logBuf, "%s.httpP1: '%s'", PGMStr_confWeb, confSecrets.http_pass1);
  155. #else
  156. sprintf_P(logBuf, "%s.httpP1: '****'", PGMStr_confWeb);
  157. #endif
  158. sendLog(logBuf);
  159. }
  160. if (strcmp(_param, "httpu2") == 0 || _isConfPage == CONFPAGE_WEB)
  161. {
  162. sprintf_P(logBuf, "%s.httpU2: '%s'", PGMStr_confWeb, confSecrets.http_user2);
  163. sendLog(logBuf);
  164. }
  165. if (strcmp(_param, "httpp2") == 0 || _isConfPage == CONFPAGE_WEB)
  166. {
  167. #ifdef DEBUGMODE
  168. sprintf_P(logBuf, "%s.httpP2: '%s'", PGMStr_confWeb, confSecrets.http_pass2);
  169. #else
  170. sprintf_P(logBuf, "%s.httpP2: '****'", PGMStr_confWeb);
  171. #endif
  172. sendLog(logBuf);
  173. }
  174. if (strcmp(_param, "httpauth") == 0 || _isConfPage == CONFPAGE_WEB)
  175. {
  176. int _tmp;
  177. if (confWeb.http_user_auth) _tmp = 1;
  178. else _tmp = 0;
  179. sprintf_P(logBuf, "%s.httpAuth: %d", PGMStr_confWeb, _tmp);
  180. sendLog(logBuf);
  181. }
  182. if (strcmp(_param, "wconsole") == 0 || _isConfPage == CONFPAGE_WEB)
  183. {
  184. int _tmp;
  185. if (confWeb.wConsole) _tmp = 1;
  186. else _tmp = 0;
  187. sprintf_P(logBuf, "%s.wConsole: %d", PGMStr_confWeb, _tmp);
  188. sendLog(logBuf);
  189. }
  190. if (strcmp(_param, "wsconsole") == 0 || _isConfPage == CONFPAGE_WEB)
  191. {
  192. int _tmp;
  193. if (confWeb.wsConsole) _tmp = 1;
  194. else _tmp = 0;
  195. sprintf_P(logBuf, "%s.wsConsole: %d", PGMStr_confWeb, _tmp);
  196. sendLog(logBuf);
  197. }
  198. if (strcmp(_param, "enableota") == 0 || _isConfPage == CONFPAGE_WEB)
  199. {
  200. int _tmp;
  201. if (confWeb.enableOTA) _tmp = 1;
  202. else _tmp = 0;
  203. sprintf_P(logBuf, "%s.enableOTA: %d", PGMStr_confWeb, _tmp);
  204. sendLog(logBuf);
  205. }
  206. if (strcmp(_param, "fsbrowser") == 0 || _isConfPage == CONFPAGE_WEB)
  207. {
  208. int _tmp;
  209. if (confWeb.FSbrowser) _tmp = 1;
  210. else _tmp = 0;
  211. sprintf_P(logBuf, "%s.FSbrowser: %d", PGMStr_confWeb, _tmp);
  212. sendLog(logBuf);
  213. }
  214. //confWeb
  215. //confMqtt
  216. if (strcmp(_param, "mqttenable") == 0 || _isConfPage == CONFPAGE_MQTT)
  217. {
  218. int _tmp;
  219. if (confMqtt.mqtt_enable) _tmp = 1;
  220. else _tmp = 0;
  221. sprintf_P(logBuf, "%s.mqttEnable: %d", PGMStr_confMqtt, _tmp);
  222. sendLog(logBuf);
  223. }
  224. if (strcmp(_param, "mqtthost") == 0 || _isConfPage == CONFPAGE_MQTT)
  225. {
  226. sprintf_P(logBuf, "%s.mqttHost: '%s'", PGMStr_confMqtt, confMqtt.mqtt_server);
  227. sendLog(logBuf);
  228. }
  229. if (strcmp(_param, "mqttport") == 0 || _isConfPage == CONFPAGE_MQTT)
  230. {
  231. sprintf_P(logBuf, "%s.mqttPort: %d", PGMStr_confMqtt, confMqtt.mqtt_port);
  232. sendLog(logBuf);
  233. }
  234. if (strcmp(_param, "mqttuser") == 0 || _isConfPage == CONFPAGE_MQTT)
  235. {
  236. sprintf_P(logBuf, "%s.mqttUser: '%s'", PGMStr_confMqtt, confSecrets.mqtt_user);
  237. sendLog(logBuf);
  238. }
  239. if (strcmp(_param, "mqttpass") == 0 || _isConfPage == CONFPAGE_MQTT)
  240. {
  241. #ifdef DEBUGMODE
  242. sprintf_P(logBuf, "%s.mqttPass: '%s'", PGMStr_confMqtt, confSecrets.mqtt_pass);
  243. #else
  244. sprintf_P(logBuf, "%s.mqttPass: '****'", PGMStr_confMqtt);
  245. #endif
  246. sendLog(logBuf);
  247. }
  248. if (strcmp(_param, "intop") == 0 || _isConfPage == CONFPAGE_MQTT)
  249. {
  250. sprintf_P(logBuf, "%s.inTop: '%s'", PGMStr_confMqtt, confMqtt.mqtt_topic_in);
  251. sendLog(logBuf);
  252. }
  253. if (strcmp(_param, "outtop") == 0 || _isConfPage == CONFPAGE_MQTT)
  254. {
  255. sprintf_P(logBuf, "%s.outTop: '%s'", PGMStr_confMqtt, confMqtt.mqtt_topic_out);
  256. sendLog(logBuf);
  257. }
  258. if (strcmp(_param, "outret") == 0 || _isConfPage == CONFPAGE_MQTT)
  259. {
  260. int _tmp;
  261. if (confMqtt.mqtt_outRetain) _tmp = 1;
  262. else _tmp = 0;
  263. sprintf_P(logBuf, "%s.outRet: %d", PGMStr_confMqtt, _tmp);
  264. sendLog(logBuf);
  265. }
  266. if (strcmp(_param, "outretsens") == 0 || _isConfPage == CONFPAGE_MQTT)
  267. {
  268. int _tmp;
  269. if (confMqtt.mqtt_outRetain_sensors) _tmp = 1;
  270. else _tmp = 0;
  271. sprintf_P(logBuf, "%s.outRetSens: %d", PGMStr_confMqtt, _tmp);
  272. sendLog(logBuf);
  273. }
  274. if (strcmp(_param, "outpubint") == 0 || _isConfPage == CONFPAGE_MQTT)
  275. {
  276. sprintf_P(logBuf, "%s.outPubInt: %d", PGMStr_confMqtt, confMqtt.mqtt_outPubInterval);
  277. sendLog(logBuf);
  278. }
  279. if (strcmp(_param, "outpubintsens") == 0 || _isConfPage == CONFPAGE_MQTT)
  280. {
  281. sprintf_P(logBuf, "%s.outPubIntSens: %d", PGMStr_confMqtt, confMqtt.mqtt_outPubInterval_sensors);
  282. sendLog(logBuf);
  283. }
  284. if (strcmp(_param, "willtop") == 0 || _isConfPage == CONFPAGE_MQTT)
  285. {
  286. sprintf_P(logBuf, "%s.willTop: '%s'", PGMStr_confMqtt, confMqtt.mqtt_willTopic);
  287. sendLog(logBuf);
  288. }
  289. if (strcmp(_param, "willqos") == 0 || _isConfPage == CONFPAGE_MQTT)
  290. {
  291. sprintf_P(logBuf, "%s.willQos: %d", PGMStr_confMqtt, confMqtt.mqtt_willQos);
  292. sendLog(logBuf);
  293. }
  294. if (strcmp(_param, "willret") == 0 || _isConfPage == CONFPAGE_MQTT)
  295. {
  296. int _tmp;
  297. if (confMqtt.mqtt_willRetain) _tmp = 1;
  298. else _tmp = 0;
  299. sprintf_P(logBuf, "%s.willRet: %d", PGMStr_confMqtt, _tmp);
  300. sendLog(logBuf);
  301. }
  302. if (strcmp(_param, "willmsg") == 0 || _isConfPage == CONFPAGE_MQTT)
  303. {
  304. sprintf_P(logBuf, "%s.willMsg: '%s'", PGMStr_confMqtt, confMqtt.mqtt_willMsg);
  305. sendLog(logBuf);
  306. }
  307. if (strcmp(_param, "connmsg") == 0 || _isConfPage == CONFPAGE_MQTT)
  308. {
  309. sprintf_P(logBuf, "%s.connMsg: '%s'", PGMStr_confMqtt, confMqtt.mqtt_connMsg);
  310. sendLog(logBuf);
  311. }
  312. if (strcmp(_param, "hbenable") == 0 || _isConfPage == CONFPAGE_MQTT)
  313. {
  314. int _tmp;
  315. if (confMqtt.mqtt_enable_heartbeat) _tmp = 1;
  316. else _tmp = 0;
  317. sprintf_P(logBuf, "%s.hbEnable: %d", PGMStr_confMqtt, _tmp);
  318. sendLog(logBuf);
  319. }
  320. if (strcmp(_param, "hbreconn") == 0 || _isConfPage == CONFPAGE_MQTT)
  321. {
  322. sprintf_P(logBuf, "%s.hbReconn: %d", PGMStr_confMqtt, confMqtt.mqtt_heartbeat_maxage_reconnect);
  323. sendLog(logBuf);
  324. }
  325. if (strcmp(_param, "hbreboot") == 0 || _isConfPage == CONFPAGE_MQTT)
  326. {
  327. sprintf_P(logBuf, "%s.hbReboot: %d", PGMStr_confMqtt, confMqtt.mqtt_heartbeat_maxage_reboot);
  328. sendLog(logBuf);
  329. }
  330. if (strcmp(_param, "reconsilent") == 0 || _isConfPage == CONFPAGE_MQTT)
  331. {
  332. int _tmp;
  333. if (confMqtt.mqtt_reconnect_silent) _tmp = 1;
  334. else _tmp = 0;
  335. sprintf_P(logBuf, "%s.reconSilent: %d", PGMStr_confMqtt, _tmp);
  336. sendLog(logBuf);
  337. }
  338. //confMqtt
  339. // confSens
  340. if (strcmp(_param, "measint") == 0 || _isConfPage == CONFPAGE_SENS)
  341. {
  342. sprintf_P(logBuf, "%s.measInt: %d", PGMStr_confSens, confSens.measureInterval);
  343. sendLog(logBuf);
  344. }
  345. if (strcmp(_param, "tempcorr") == 0 || _isConfPage == CONFPAGE_SENS)
  346. {
  347. sprintf_P(logBuf, "%s.tempCorr: %1.2f", PGMStr_confThermAdv, confSens.DHT_tempCorrVal);
  348. sendLog(logBuf);
  349. }
  350. if (strcmp(_param, "humcorr") == 0 || _isConfPage == CONFPAGE_SENS)
  351. {
  352. sprintf_P(logBuf, "%s.humCorr: %d", PGMStr_confThermAdv, confSens.DHT_humCorrVal);
  353. sendLog(logBuf);
  354. }
  355. // confSens
  356. // confDisplay
  357. if (strcmp(_param, "dispint") == 0 || _isConfPage == CONFPAGE_DISPLAY)
  358. {
  359. sprintf_P(logBuf, "%s.dispInt: %d", PGMStr_confDisplay, confDisplay.displayInterval);
  360. sendLog(logBuf);
  361. }
  362. if (strcmp(_param, "disptout") == 0 || _isConfPage == CONFPAGE_DISPLAY)
  363. {
  364. sprintf_P(logBuf, "%s.dispTout: %d", PGMStr_confDisplay, confDisplay.displayTimeout);
  365. sendLog(logBuf);
  366. }
  367. if (strcmp(_param, "pirendisp") == 0 || _isConfPage == CONFPAGE_DISPLAY)
  368. {
  369. int tmp;
  370. if (confDisplay.PIRenablesDisplay)
  371. tmp = 1;
  372. else
  373. tmp = 0;
  374. sprintf_P(logBuf, "%s.pirEnDisp: %d", PGMStr_confDisplay, tmp);
  375. sendLog(logBuf);
  376. }
  377. // confDisplay
  378. // confAdd
  379. if (strcmp(_param, "outtemptop") == 0 || _isConfPage == CONFPAGE_ADD)
  380. {
  381. sprintf_P(logBuf, "%s.outTempTop: '%s'", PGMStr_confAdd, confAdd.outTemp_topic_in);
  382. sendLog(logBuf);
  383. }
  384. if (strcmp(_param, "outhumtop") == 0 || _isConfPage == CONFPAGE_ADD)
  385. {
  386. sprintf_P(logBuf, "%s.outHumTop: '%s'", PGMStr_confAdd, confAdd.outHum_topic_in);
  387. sendLog(logBuf);
  388. }
  389. if (strcmp(_param, "pirtop") == 0 || _isConfPage == CONFPAGE_ADD)
  390. {
  391. sprintf_P(logBuf, "%s.PIRTop: '%s'", PGMStr_confAdd, confAdd.mqtt_topic_pir);
  392. sendLog(logBuf);
  393. }
  394. if (strcmp(_param, "pironpld") == 0 || _isConfPage == CONFPAGE_ADD)
  395. {
  396. sprintf_P(logBuf, "%s.PIROnPld: '%s'", PGMStr_confAdd, confAdd.mqtt_payload_pir_on);
  397. sendLog(logBuf);
  398. }
  399. if (strcmp(_param, "piroffpld") == 0 || _isConfPage == CONFPAGE_ADD)
  400. {
  401. sprintf_P(logBuf, "%s.PIROffPld: '%s'", PGMStr_confAdd, confAdd.mqtt_payload_pir_off);
  402. sendLog(logBuf);
  403. }
  404. // confAdd
  405. #ifdef ENABLE_FEATURE_NTP_TIME
  406. // confTime
  407. if (strcmp(_param, "tzstr") == 0 || _isConfPage == CONFPAGE_TIME)
  408. {
  409. sprintf_P(logBuf, "%s.TZstr: '%s'", PGMStr_confTime, confTime.timeZoneStr);
  410. sendLog(logBuf);
  411. }
  412. if (strcmp(_param, "ntpenable") == 0 || _isConfPage == CONFPAGE_TIME)
  413. {
  414. int tmp;
  415. if (confTime.ntpEnable)
  416. tmp = 1;
  417. else
  418. tmp = 0;
  419. sprintf_P(logBuf, "%s.ntpEnable: %d", PGMStr_confTime, tmp);
  420. sendLog(logBuf);
  421. }
  422. if (strcmp(_param, "ntpserver1") == 0 || _isConfPage == CONFPAGE_TIME)
  423. {
  424. sprintf_P(logBuf, "%s.ntpServer1: '%s'", PGMStr_confTime, confTime.ntpServer1);
  425. sendLog(logBuf);
  426. }
  427. if (strcmp(_param, "ntpserver2") == 0 || _isConfPage == CONFPAGE_TIME)
  428. {
  429. sprintf_P(logBuf, "%s.ntpServer2: '%s'", PGMStr_confTime, confTime.ntpServer2);
  430. sendLog(logBuf);
  431. }
  432. if (strcmp(_param, "ntpsyncint") == 0 || _isConfPage == CONFPAGE_TIME)
  433. {
  434. sprintf_P(logBuf, "%s.ntpSyncInt: %lu", PGMStr_confTime, confTime.ntpSyncInterval / 60);
  435. sendLog(logBuf);
  436. }
  437. // confTime
  438. #endif // ENABLE_FEATURE_NTP_TIME
  439. // confLog
  440. if (strcmp(_param, "loglevser") == 0 || _isConfPage == CONFPAGE_LOG)
  441. {
  442. sprintf_P(logBuf, "%s.logLevSer: %d", PGMStr_confLog, confLog.logLevelSerial);
  443. sendLog(logBuf);
  444. }
  445. if (strcmp(_param, "loglevweb") == 0 || _isConfPage == CONFPAGE_LOG)
  446. {
  447. sprintf_P(logBuf, "%s.logLevWeb: %d", PGMStr_confLog, confLog.logLevelWeb);
  448. sendLog(logBuf);
  449. }
  450. if (strcmp(_param, "loglevmqtt") == 0 || _isConfPage == CONFPAGE_LOG)
  451. {
  452. sprintf_P(logBuf, "%s.logLevMqtt: %d", PGMStr_confLog, confLog.logLevelMqtt);
  453. sendLog(logBuf);
  454. }
  455. if (strcmp(_param, "logwebrequests") == 0 || _isConfPage == CONFPAGE_LOG)
  456. {
  457. int tmp;
  458. if (confLog.logWebRequests)
  459. tmp = 1;
  460. else
  461. tmp = 0;
  462. sprintf_P(logBuf, "%s.logWebRequests: %d", PGMStr_confLog, tmp);
  463. sendLog(logBuf);
  464. }
  465. // confLog
  466. #ifdef FIRMWARE_VARIANT_THERMOSTAT
  467. // Thermostat - Values
  468. if (strcmp(_param, "temp") == 0 || _isConfPage == CONFPAGE_THERM_VALUES)
  469. {
  470. snprintf(logBuf, LOG_BUFFER_SIZE, "THERM_setTemp: %2.1f", thermostat_setTemp);
  471. sendLog(logBuf);
  472. }
  473. if (strcmp(_param, "templow") == 0 || _isConfPage == CONFPAGE_THERM_VALUES)
  474. {
  475. snprintf(logBuf, LOG_BUFFER_SIZE, "THERM_setTempLow: %2.1f", thermostat_setTempLow);
  476. sendLog(logBuf);
  477. }
  478. if (strcmp(_param, "templow2") == 0 || _isConfPage == CONFPAGE_THERM_VALUES)
  479. {
  480. snprintf(logBuf, LOG_BUFFER_SIZE, "THERM_setTempLow2: %2.1f", thermostat_setTempLow2);
  481. sendLog(logBuf);
  482. }
  483. if (strcmp(_param, "mode") == 0 || _isConfPage == CONFPAGE_THERM_VALUES)
  484. {
  485. snprintf(logBuf, LOG_BUFFER_SIZE, "THERM_heatingMode: %d", thermostat_heatingMode);
  486. sendLog(logBuf);
  487. }
  488. if (strcmp(_param, "preset") == 0 || _isConfPage == CONFPAGE_THERM_VALUES)
  489. {
  490. snprintf(logBuf, LOG_BUFFER_SIZE, "THERM_preset: %d", thermostat_preset);
  491. sendLog(logBuf);
  492. }
  493. // confTherm
  494. if (strcmp(_param, "autosavetemp") == 0 || _isConfPage == CONFPAGE_THERM)
  495. {
  496. int tmp;
  497. if (confTherm.autoSaveSetTemp)
  498. tmp = 1;
  499. else
  500. tmp = 0;
  501. sprintf_P(logBuf, "%s.autoSaveTemp: %d", PGMStr_confTherm, tmp);
  502. sendLog(logBuf);
  503. }
  504. if (strcmp(_param, "autosavemode") == 0 || _isConfPage == CONFPAGE_THERM)
  505. {
  506. int tmp;
  507. if (confTherm.autoSaveHeatingMode)
  508. tmp = 1;
  509. else
  510. tmp = 0;
  511. sprintf_P(logBuf, "%s.autoSaveMode: %d", PGMStr_confTherm, tmp);
  512. sendLog(logBuf);
  513. }
  514. if (strcmp(_param, "savetomqttret") == 0 || _isConfPage == CONFPAGE_THERM)
  515. {
  516. int tmp;
  517. if (confTherm.saveToMqttRetained)
  518. tmp = 1;
  519. else
  520. tmp = 0;
  521. sprintf_P(logBuf, "%s.savetoMqttRet: %d", PGMStr_confTherm, tmp);
  522. sendLog(logBuf);
  523. }
  524. if (strcmp(_param, "tempmin") == 0 || _isConfPage == CONFPAGE_THERM)
  525. {
  526. sprintf_P(logBuf, "%s.tempMin: '%2.1f'", PGMStr_confTherm, confTherm.setTempMin);
  527. sendLog(logBuf);
  528. }
  529. if (strcmp(_param, "tempmax") == 0 || _isConfPage == CONFPAGE_THERM)
  530. {
  531. sprintf_P(logBuf, "%s.tempMax: '%2.1f'", PGMStr_confTherm, confTherm.setTempMax);
  532. sendLog(logBuf);
  533. }
  534. if (strcmp(_param, "pirendispps0") == 0 || _isConfPage == CONFPAGE_THERM)
  535. {
  536. int tmp;
  537. if (confTherm.PIRenablesDisplay_preset0only)
  538. tmp = 1;
  539. else
  540. tmp = 0;
  541. sprintf_P(logBuf, "%s.pirEnDispPs0: %d", PGMStr_confTherm, tmp);
  542. sendLog(logBuf);
  543. }
  544. if (strcmp(_param, "togthdisp") == 0 || _isConfPage == CONFPAGE_THERM)
  545. {
  546. int tmp;
  547. if (confTherm.togglingTempHumAIDisplay)
  548. tmp = 1;
  549. else
  550. tmp = 0;
  551. sprintf_P(logBuf, "%s.togTHdisp: %d", PGMStr_confTherm, tmp);
  552. sendLog(logBuf);
  553. }
  554. if (strcmp(_param, "minofftime") == 0 || _isConfPage == CONFPAGE_THERM)
  555. {
  556. sprintf_P(logBuf, "%s.minOffTime: %d", PGMStr_confTherm, confTherm.heatingMinOffTime);
  557. sendLog(logBuf);
  558. }
  559. if (strcmp(_param, "tempdec") == 0 || _isConfPage == CONFPAGE_THERM)
  560. {
  561. sprintf_P(logBuf, "%s.tempDec: %1.2f", PGMStr_confTherm, confTherm.setTempDecreaseVal);
  562. sendLog(logBuf);
  563. }
  564. if (strcmp(_param, "hyst") == 0 || _isConfPage == CONFPAGE_THERM)
  565. {
  566. sprintf_P(logBuf, "%s.hyst: %1.2f", PGMStr_confTherm, confTherm.hysteresis);
  567. sendLog(logBuf);
  568. }
  569. if (strcmp(_param, "offmsg") == 0 || _isConfPage == CONFPAGE_THERM)
  570. {
  571. sprintf_P(logBuf, "%s.offMsg: '%s'", PGMStr_confTherm, confTherm.offMessage);
  572. sendLog(logBuf);
  573. }
  574. if (strcmp(_param, "modename0") == 0 || _isConfPage == CONFPAGE_THERM)
  575. {
  576. sprintf_P(logBuf, "%s.modeName0: '%s'", PGMStr_confTherm, confTherm.modeName0);
  577. sendLog(logBuf);
  578. }
  579. if (strcmp(_param, "modename1") == 0 || _isConfPage == CONFPAGE_THERM)
  580. {
  581. sprintf_P(logBuf, "%s.modeName1: '%s'", PGMStr_confTherm, confTherm.modeName1);
  582. sendLog(logBuf);
  583. }
  584. if (strcmp(_param, "psetname0") == 0 || _isConfPage == CONFPAGE_THERM)
  585. {
  586. sprintf_P(logBuf, "%s.psetName0: '%s'", PGMStr_confTherm, confTherm.psetName0);
  587. sendLog(logBuf);
  588. }
  589. if (strcmp(_param, "psetname1") == 0 || _isConfPage == CONFPAGE_THERM)
  590. {
  591. sprintf_P(logBuf, "%s.psetName1: '%s'", PGMStr_confTherm, confTherm.psetName1);
  592. sendLog(logBuf);
  593. }
  594. if (strcmp(_param, "psetname2") == 0 || _isConfPage == CONFPAGE_THERM)
  595. {
  596. sprintf_P(logBuf, "%s.psetName2: '%s'", PGMStr_confTherm, confTherm.psetName2);
  597. sendLog(logBuf);
  598. }
  599. if (strcmp(_param, "itemplab") == 0 || _isConfPage == CONFPAGE_THERM)
  600. {
  601. sprintf_P(logBuf, "%s.iTempLab: '%s'", PGMStr_confTherm, confTherm.iTempLabel);
  602. sendLog(logBuf);
  603. }
  604. if (strcmp(_param, "otemplab") == 0 || _isConfPage == CONFPAGE_THERM)
  605. {
  606. sprintf_P(logBuf, "%s.oTempLab: '%s'", PGMStr_confTherm, confTherm.oTempLabel);
  607. sendLog(logBuf);
  608. }
  609. if (strcmp(_param, "pausetout") == 0 || _isConfPage == CONFPAGE_THERM)
  610. {
  611. sprintf_P(logBuf, "%s.pauseTout: %d", PGMStr_confTherm, confTherm.pauseTout);
  612. sendLog(logBuf);
  613. }
  614. // confTherm
  615. #endif //FIRMWARE_VARIANT_THERMOSTAT
  616. #ifdef FIRMWARE_VARIANT_HEATCONTROL
  617. // confHeatc
  618. if (strcmp(_param, "heatc") == 0 || _isConfPage == CONFPAGE_HEATC)
  619. {
  620. sprintf_P(logBuf, "%s.heatCurve: [%d, %d, %d, %d, %d, %d, %d, %d, %d]", PGMStr_confHeatc, confHeatc.heatCurve[0], confHeatc.heatCurve[1], confHeatc.heatCurve[2], confHeatc.heatCurve[3], confHeatc.heatCurve[4], confHeatc.heatCurve[5], confHeatc.heatCurve[6], confHeatc.heatCurve[7], confHeatc.heatCurve[8]);
  621. sendLog(logBuf);
  622. }
  623. if (strcmp(_param, "heatl") == 0 || _isConfPage == CONFPAGE_HEATC)
  624. {
  625. sprintf_P(logBuf, "%s.heatLocktime: [%d, %d, %d, %d, %d, %d, %d, %d, %d]", PGMStr_confHeatc, confHeatc.heatLocktime[0], confHeatc.heatLocktime[1], confHeatc.heatLocktime[2], confHeatc.heatLocktime[3], confHeatc.heatLocktime[4], confHeatc.heatLocktime[5], confHeatc.heatLocktime[6], confHeatc.heatLocktime[7], confHeatc.heatLocktime[8]);
  626. sendLog(logBuf);
  627. }
  628. if (strcmp(_param, "pumpnl") == 0 || _isConfPage == CONFPAGE_HEATC)
  629. {
  630. sprintf_P(logBuf, "%s.pumpBacklash: %d", PGMStr_confHeatc, confHeatc.pumpBacklash);
  631. sendLog(logBuf);
  632. }
  633. if (strcmp(_param, "heatusehc") == 0 || _isConfPage == CONFPAGE_HEATC)
  634. {
  635. int tmp;
  636. if (confHeatc.useHeatCurve) tmp = 1;
  637. else tmp = 0;
  638. sprintf_P(logBuf, "%s.useHeatCurve: %d", PGMStr_confHeatc, tmp);
  639. sendLog(logBuf);
  640. }
  641. if (strcmp(_param, "heatforcehc") == 0 || _isConfPage == CONFPAGE_HEATC)
  642. {
  643. int tmp;
  644. if (confHeatc.forceHeatCurve) tmp = 1;
  645. else tmp = 0;
  646. sprintf_P(logBuf, "%s.forceHeatCurve: %d", PGMStr_confHeatc, tmp);
  647. sendLog(logBuf);
  648. }
  649. if (strcmp(_param, "heatcvhy0") == 0 || _isConfPage == CONFPAGE_HEATC)
  650. {
  651. sprintf_P(logBuf, "%s.hystereseOff: %d", PGMStr_confHeatc, confHeatc.hystereseOff);
  652. sendLog(logBuf);
  653. }
  654. if (strcmp(_param, "heatcvhy1") == 0 || _isConfPage == CONFPAGE_HEATC)
  655. {
  656. sprintf_P(logBuf, "%s.hystereseOn: %d", PGMStr_confHeatc, confHeatc.hystereseOn);
  657. sendLog(logBuf);
  658. }
  659. if (strcmp(_param, "heattempfeedlimit") == 0 || _isConfPage == CONFPAGE_HEATC)
  660. {
  661. sprintf_P(logBuf, "%s.tempFeedLimit: %d", PGMStr_confHeatc, confHeatc.tempFeedLimit);
  662. sendLog(logBuf);
  663. }
  664. if (strcmp(_param, "heatforcehcalsoon") == 0 || _isConfPage == CONFPAGE_HEATC)
  665. {
  666. int tmp;
  667. if (confHeatc.forceHeatCurveAlsoForSwitchOn) tmp = 1;
  668. else tmp = 0;
  669. sprintf_P(logBuf, "%s.forceHeatCurveAlsoForSwitchOn: %d", PGMStr_confHeatc, tmp);
  670. sendLog(logBuf);
  671. }
  672. // confHeatc
  673. #endif // FIRMWARE_VARIANT_HEATCONTROL
  674. } // getConfig()