#define CONFPAGE_DEVWIFI 1
#define CONFPAGE_WEB 2
#define CONFPAGE_MQTT 3

#define CONFPAGE_THERM 4
#define CONFPAGE_THERM_VALUES 14

#define CONFPAGE_ADD 5

#define CONFPAGE_TIME 6
#define CONFPAGE_LOG 7
#define CONFPAGE_SENS 8
#define CONFPAGE_DISPLAY 9

#define CONFPAGE_HEATC 12



void getConfig(char *_param)
{
  // gets and prints the corresponding config variable for '_param'

  //if (serialdebug)
  //{
  //  Serial.print("getConfig - '");
  //  Serial.print(_param);
  //  Serial.println("'");
  //}

  strlwr(_param);

  int _isConfPage = 0;

  if (strcmp(_param, "values") == 0)
    _isConfPage = 100;
  //else if (strcmp(_param, "confsecrets") == 0)
  //  _isConfPage = 0;
  else if (strcmp(_param, "confdevwifi") == 0)
    _isConfPage = CONFPAGE_DEVWIFI;
  else if (strcmp(_param, "confdev") == 0)
    _isConfPage = CONFPAGE_DEVWIFI;
  else if (strcmp(_param, "confwifi") == 0)
    _isConfPage = CONFPAGE_DEVWIFI;
  else if (strcmp(_param, "confweb") == 0)
    _isConfPage = CONFPAGE_WEB;
  else if (strcmp(_param, "confmqtt") == 0)
    _isConfPage = CONFPAGE_MQTT;
  
  else if (strcmp(_param, "conftherm") == 0)
    _isConfPage = CONFPAGE_THERM;
  
  else if (strcmp(_param, "confadd") == 0)
    _isConfPage = CONFPAGE_ADD;
  
  #ifdef ENABLE_FEATURE_NTP_TIME
  else if (strcmp(_param, "conftime") == 0)
    _isConfPage = CONFPAGE_TIME;
  #endif

  else if (strcmp(_param, "conflog") == 0)
    _isConfPage = CONFPAGE_LOG;

  else if (strcmp(_param, "confheatc") == 0)
    _isConfPage = CONFPAGE_HEATC;



  // confDevWiFi
  if (strcmp(_param, "devname") == 0 || _isConfPage == CONFPAGE_DEVWIFI)
  {
    sprintf_P(logBuf, "%s.devName: '%s'", PGMStr_confDevWiFi, confDevWiFi.deviceName);
    sendLog(logBuf);
  }

  if (strcmp(_param, "hostname") == 0 || _isConfPage == CONFPAGE_DEVWIFI)
  {
    sprintf_P(logBuf, "%s.hostName: '%s'", PGMStr_confDevWiFi, confDevWiFi.hostName);
    sendLog(logBuf);
  }

  if (strcmp(_param, "ssid1") == 0 || _isConfPage == CONFPAGE_DEVWIFI)
  {
    sprintf_P(logBuf, "%s.SSID1: '%s'", PGMStr_confDevWiFi, confDevWiFi.WiFiSSID1);
    sendLog(logBuf);
  }

  if (strcmp(_param, "wpw1") == 0 || _isConfPage == CONFPAGE_DEVWIFI)
  {
  #ifdef DEBUGMODE
    sprintf_P(logBuf, "%s.WPW1: '%s'", PGMStr_confDevWiFi, confSecrets.WiFiPW1);
  #else
    sprintf_P(logBuf, "%s.WPW1: '******'", PGMStr_confDevWiFi);
  #endif
    sendLog(logBuf);
  }

  if (strcmp(_param, "ssid2") == 0 || _isConfPage == CONFPAGE_DEVWIFI)
  {
    sprintf_P(logBuf, "%s.SSID2: '%s'", PGMStr_confDevWiFi, confDevWiFi.WiFiSSID2);
    sendLog(logBuf);
  }

  if (strcmp(_param, "wpw2") == 0 || _isConfPage == CONFPAGE_DEVWIFI)
  {
    #ifdef DEBUGMODE
        sprintf_P(logBuf, "%s.WPW2: '%s'", PGMStr_confDevWiFi, confSecrets.WiFiPW2);
    #else
        sprintf_P(logBuf, "%s.WPW2: '******'", PGMStr_confDevWiFi);
    #endif
    sendLog(logBuf);
  }

  if (strcmp(_param, "wpwap") == 0 || _isConfPage == CONFPAGE_DEVWIFI)
  {
    #ifdef DEBUGMODE
      sprintf_P(logBuf, "%s.WPWAp: '%s'", PGMStr_confDevWiFi, confSecrets.WiFiAPModePassword);
    #else
      sprintf_P(logBuf, "%s.WPWAp: '******'", PGMStr_confDevWiFi);
    #endif
    sendLog(logBuf);
  }

  if (strcmp(_param, "waptout") == 0 || _isConfPage == CONFPAGE_DEVWIFI)
  {
    sprintf_P(logBuf, "%s.WApTout: %d", PGMStr_confDevWiFi, confDevWiFi.WiFiAPModeTimeout);
    sendLog(logBuf);
  }

  if (strcmp(_param, "wconncheck") == 0 || _isConfPage == CONFPAGE_DEVWIFI)
  {
    sprintf_P(logBuf, "%s.WConnCheck: %d", PGMStr_confDevWiFi, confDevWiFi.WiFiConnCheckInterval);
    sendLog(logBuf);
  }

  if (strcmp(_param, "wretry") == 0 || _isConfPage == CONFPAGE_DEVWIFI)
  {
    sprintf_P(logBuf, "%s.WRetry: %d", PGMStr_confDevWiFi, confDevWiFi.WiFiRetryInterval);
    sendLog(logBuf);
  }

  if (strcmp(_param, "wreboot") == 0 || _isConfPage == CONFPAGE_DEVWIFI)
  {
    sprintf_P(logBuf, "%s.WReboot: %d", PGMStr_confDevWiFi, confDevWiFi.WiFiRebootOnNoConnect);
    sendLog(logBuf);
  }

  if (strcmp(_param, "ardota") == 0 || _isConfPage == CONFPAGE_DEVWIFI)
  {
    int _tmp;
    if (confDevWiFi.enableArduinoOTA) _tmp = 1;
    else _tmp = 0;
    sprintf_P(logBuf, "%s.ArdOTA: %d", PGMStr_confDevWiFi, _tmp);
    sendLog(logBuf);
  }
  // confDevWiFi



  //confWeb
  if (strcmp(_param, "apitoken") == 0 || _isConfPage == CONFPAGE_WEB)
  {
    sprintf_P(logBuf, "%s.apiToken: '%s'", PGMStr_confWeb, confSecrets.http_token);
    sendLog(logBuf);
  }
  
  if (strcmp(_param, "httpua") == 0 || _isConfPage == CONFPAGE_WEB)
  {
    sprintf_P(logBuf, "%s.httpUA: '%s'", PGMStr_confWeb, confSecrets.http_user);
    sendLog(logBuf);
  }
  if (strcmp(_param, "httppa") == 0 || _isConfPage == CONFPAGE_WEB)
  {
    #ifdef DEBUGMODE
        sprintf_P(logBuf, "%s.httpPA: '%s'", PGMStr_confWeb, confSecrets.http_pass);
    #else
        sprintf_P(logBuf, "%s.httpPA: '****'", PGMStr_confWeb);
    #endif
    sendLog(logBuf);
  }

  if (strcmp(_param, "httpu1") == 0 || _isConfPage == CONFPAGE_WEB)
  {
    sprintf_P(logBuf, "%s.httpU1: '%s'", PGMStr_confWeb, confSecrets.http_user1);
    sendLog(logBuf);
  }

  if (strcmp(_param, "httpp1") == 0 || _isConfPage == CONFPAGE_WEB)
  {
    #ifdef DEBUGMODE
        sprintf_P(logBuf, "%s.httpP1: '%s'", PGMStr_confWeb, confSecrets.http_pass1);
    #else
        sprintf_P(logBuf, "%s.httpP1: '****'", PGMStr_confWeb);
    #endif
    sendLog(logBuf);
  }

  if (strcmp(_param, "httpu2") == 0 || _isConfPage == CONFPAGE_WEB)
  {
    sprintf_P(logBuf, "%s.httpU2: '%s'", PGMStr_confWeb, confSecrets.http_user2);
    sendLog(logBuf);
  }

  if (strcmp(_param, "httpp2") == 0 || _isConfPage == CONFPAGE_WEB)
  {
    #ifdef DEBUGMODE
        sprintf_P(logBuf, "%s.httpP2: '%s'", PGMStr_confWeb, confSecrets.http_pass2);
    #else
        sprintf_P(logBuf, "%s.httpP2: '****'", PGMStr_confWeb);
    #endif
    sendLog(logBuf);
  }

  if (strcmp(_param, "httpauth") == 0 || _isConfPage == CONFPAGE_WEB)
  {
    int _tmp;
    if (confWeb.http_user_auth) _tmp = 1;
    else _tmp = 0;
    sprintf_P(logBuf, "%s.httpAuth: %d", PGMStr_confWeb, _tmp);
    sendLog(logBuf);
  }

  if (strcmp(_param, "wconsole") == 0 || _isConfPage == CONFPAGE_WEB)
  {
    int _tmp;
    if (confWeb.wConsole) _tmp = 1;
    else _tmp = 0;
    sprintf_P(logBuf, "%s.wConsole: %d", PGMStr_confWeb, _tmp);
    sendLog(logBuf);
  }
  if (strcmp(_param, "wsconsole") == 0 || _isConfPage == CONFPAGE_WEB)
  {
    int _tmp;
    if (confWeb.wsConsole) _tmp = 1;
    else _tmp = 0;
    sprintf_P(logBuf, "%s.wsConsole: %d", PGMStr_confWeb, _tmp);
    sendLog(logBuf);
  }
  if (strcmp(_param, "enableota") == 0 || _isConfPage == CONFPAGE_WEB)
  {
    int _tmp;
    if (confWeb.enableOTA) _tmp = 1;
    else _tmp = 0;
    sprintf_P(logBuf, "%s.enableOTA: %d", PGMStr_confWeb, _tmp);
    sendLog(logBuf);
  }
  if (strcmp(_param, "fsbrowser") == 0 || _isConfPage == CONFPAGE_WEB)
  {
    int _tmp;
    if (confWeb.FSbrowser) _tmp = 1;
    else _tmp = 0;
    sprintf_P(logBuf, "%s.FSbrowser: %d", PGMStr_confWeb, _tmp);
    sendLog(logBuf);
  }
  //confWeb



  //confMqtt
  if (strcmp(_param, "mqttenable") == 0 || _isConfPage == CONFPAGE_MQTT)
  {
    int _tmp;
    if (confMqtt.mqtt_enable) _tmp = 1;
    else _tmp = 0;
    sprintf_P(logBuf, "%s.mqttEnable: %d", PGMStr_confMqtt, _tmp);
    sendLog(logBuf);
  }

  if (strcmp(_param, "mqtthost") == 0 || _isConfPage == CONFPAGE_MQTT)
  {
    sprintf_P(logBuf, "%s.mqttHost: '%s'", PGMStr_confMqtt, confMqtt.mqtt_server);
    sendLog(logBuf);
  }

  if (strcmp(_param, "mqttport") == 0 || _isConfPage == CONFPAGE_MQTT)
  {
    sprintf_P(logBuf, "%s.mqttPort: %d", PGMStr_confMqtt, confMqtt.mqtt_port);
    sendLog(logBuf);
  }

  if (strcmp(_param, "mqttuser") == 0 || _isConfPage == CONFPAGE_MQTT)
  {
    sprintf_P(logBuf, "%s.mqttUser: '%s'", PGMStr_confMqtt, confSecrets.mqtt_user);
    sendLog(logBuf);
  }

  if (strcmp(_param, "mqttpass") == 0 || _isConfPage == CONFPAGE_MQTT)
  {
    #ifdef DEBUGMODE
        sprintf_P(logBuf, "%s.mqttPass: '%s'", PGMStr_confMqtt, confSecrets.mqtt_pass);
    #else
        sprintf_P(logBuf, "%s.mqttPass: '****'", PGMStr_confMqtt);
    #endif
    sendLog(logBuf);
  }

  if (strcmp(_param, "intop") == 0 || _isConfPage == CONFPAGE_MQTT)
  {
    sprintf_P(logBuf, "%s.inTop: '%s'", PGMStr_confMqtt, confMqtt.mqtt_topic_in);
    sendLog(logBuf);
  }

  if (strcmp(_param, "outtop") == 0 || _isConfPage == CONFPAGE_MQTT)
  {
    sprintf_P(logBuf, "%s.outTop: '%s'", PGMStr_confMqtt, confMqtt.mqtt_topic_out);
    sendLog(logBuf);
  }

  if (strcmp(_param, "outret") == 0 || _isConfPage == CONFPAGE_MQTT)
  {
    int _tmp;
    if (confMqtt.mqtt_outRetain) _tmp = 1;
    else _tmp = 0;
    sprintf_P(logBuf, "%s.outRet: %d", PGMStr_confMqtt, _tmp);
    sendLog(logBuf);
  }

  if (strcmp(_param, "outretsens") == 0 || _isConfPage == CONFPAGE_MQTT)
  {
    int _tmp;
    if (confMqtt.mqtt_outRetain_sensors) _tmp = 1;
    else _tmp = 0;
    sprintf_P(logBuf, "%s.outRetSens: %d", PGMStr_confMqtt, _tmp);
    sendLog(logBuf);
  }

  if (strcmp(_param, "outpubint") == 0 || _isConfPage == CONFPAGE_MQTT)
  {
    sprintf_P(logBuf, "%s.outPubInt: %d", PGMStr_confMqtt, confMqtt.mqtt_outPubInterval);
    sendLog(logBuf);
  }

  if (strcmp(_param, "outpubintsens") == 0 || _isConfPage == CONFPAGE_MQTT)
  {
    sprintf_P(logBuf, "%s.outPubIntSens: %d", PGMStr_confMqtt, confMqtt.mqtt_outPubInterval_sensors);
    sendLog(logBuf);
  }

  if (strcmp(_param, "willtop") == 0 || _isConfPage == CONFPAGE_MQTT)
  {
    sprintf_P(logBuf, "%s.willTop: '%s'", PGMStr_confMqtt, confMqtt.mqtt_willTopic);
    sendLog(logBuf);
  }

  if (strcmp(_param, "willqos") == 0 || _isConfPage == CONFPAGE_MQTT)
  {
    sprintf_P(logBuf, "%s.willQos: %d", PGMStr_confMqtt, confMqtt.mqtt_willQos);
    sendLog(logBuf);
  }

  if (strcmp(_param, "willret") == 0 || _isConfPage == CONFPAGE_MQTT)
  {
    int _tmp;
    if (confMqtt.mqtt_willRetain) _tmp = 1;
    else _tmp = 0;
    sprintf_P(logBuf, "%s.willRet: %d", PGMStr_confMqtt, _tmp);
    sendLog(logBuf);
  }

  if (strcmp(_param, "willmsg") == 0 || _isConfPage == CONFPAGE_MQTT)
  {
    sprintf_P(logBuf, "%s.willMsg: '%s'", PGMStr_confMqtt, confMqtt.mqtt_willMsg);
    sendLog(logBuf);
  }

  if (strcmp(_param, "connmsg") == 0 || _isConfPage == CONFPAGE_MQTT)
  {
    sprintf_P(logBuf, "%s.connMsg: '%s'", PGMStr_confMqtt, confMqtt.mqtt_connMsg);
    sendLog(logBuf);
  }

  if (strcmp(_param, "hbenable") == 0 || _isConfPage == CONFPAGE_MQTT)
  {
    int _tmp;
    if (confMqtt.mqtt_enable_heartbeat) _tmp = 1;
    else _tmp = 0;
    sprintf_P(logBuf, "%s.hbEnable: %d", PGMStr_confMqtt, _tmp);
    sendLog(logBuf);
  }

  if (strcmp(_param, "hbreconn") == 0 || _isConfPage == CONFPAGE_MQTT)
  {
    sprintf_P(logBuf, "%s.hbReconn: %d", PGMStr_confMqtt, confMqtt.mqtt_heartbeat_maxage_reconnect);
    sendLog(logBuf);
  }

  if (strcmp(_param, "hbreboot") == 0 || _isConfPage == CONFPAGE_MQTT)
  {
    sprintf_P(logBuf, "%s.hbReboot: %d", PGMStr_confMqtt, confMqtt.mqtt_heartbeat_maxage_reboot);
    sendLog(logBuf);
  }

  if (strcmp(_param, "reconsilent") == 0 || _isConfPage == CONFPAGE_MQTT)
  {
    int _tmp;
    if (confMqtt.mqtt_reconnect_silent) _tmp = 1;
    else _tmp = 0;
    sprintf_P(logBuf, "%s.reconSilent: %d", PGMStr_confMqtt, _tmp);
    sendLog(logBuf);
  }

  //confMqtt



  // confSens
  if (strcmp(_param, "measint") == 0 || _isConfPage == CONFPAGE_SENS)
  {
    sprintf_P(logBuf, "%s.measInt: %d", PGMStr_confSens, confSens.measureInterval);
    sendLog(logBuf);
  }
  if (strcmp(_param, "tempcorr") == 0 || _isConfPage == CONFPAGE_SENS)
  {
    sprintf_P(logBuf, "%s.tempCorr: %1.2f", PGMStr_confThermAdv, confSens.DHT_tempCorrVal);
    sendLog(logBuf);
  }
  if (strcmp(_param, "humcorr") == 0 || _isConfPage == CONFPAGE_SENS)
  {
    sprintf_P(logBuf, "%s.humCorr: %d", PGMStr_confThermAdv, confSens.DHT_humCorrVal);
    sendLog(logBuf);
  }
  // confSens



  // confDisplay
  if (strcmp(_param, "dispint") == 0 || _isConfPage == CONFPAGE_DISPLAY)
  {
    sprintf_P(logBuf, "%s.dispInt: %d", PGMStr_confDisplay, confDisplay.displayInterval);
    sendLog(logBuf);
  }

  if (strcmp(_param, "disptout") == 0 || _isConfPage == CONFPAGE_DISPLAY)
  {
    sprintf_P(logBuf, "%s.dispTout: %d", PGMStr_confDisplay, confDisplay.displayTimeout);
    sendLog(logBuf);
  }
  
  if (strcmp(_param, "pirendisp") == 0 || _isConfPage == CONFPAGE_DISPLAY)
  {
    int tmp;
    if (confDisplay.PIRenablesDisplay)
      tmp = 1;
    else
      tmp = 0;
    sprintf_P(logBuf, "%s.pirEnDisp: %d", PGMStr_confDisplay, tmp);
    sendLog(logBuf);
  }
  // confDisplay



  // confAdd
  if (strcmp(_param, "outtemptop") == 0 || _isConfPage == CONFPAGE_ADD)
  {
    sprintf_P(logBuf, "%s.outTempTop: '%s'", PGMStr_confAdd, confAdd.outTemp_topic_in);
    sendLog(logBuf);
  }
  if (strcmp(_param, "outhumtop") == 0 || _isConfPage == CONFPAGE_ADD)
  {
    sprintf_P(logBuf, "%s.outHumTop: '%s'", PGMStr_confAdd, confAdd.outHum_topic_in);
    sendLog(logBuf);
  }
  if (strcmp(_param, "pirtop") == 0 || _isConfPage == CONFPAGE_ADD)
  {
    sprintf_P(logBuf, "%s.PIRTop: '%s'", PGMStr_confAdd, confAdd.mqtt_topic_pir);
    sendLog(logBuf);
  }
  if (strcmp(_param, "pironpld") == 0 || _isConfPage == CONFPAGE_ADD)
  {
    sprintf_P(logBuf, "%s.PIROnPld: '%s'", PGMStr_confAdd, confAdd.mqtt_payload_pir_on);
    sendLog(logBuf);
  }
  if (strcmp(_param, "piroffpld") == 0 || _isConfPage == CONFPAGE_ADD)
  {
    sprintf_P(logBuf, "%s.PIROffPld: '%s'", PGMStr_confAdd, confAdd.mqtt_payload_pir_off);
    sendLog(logBuf);
  }
  // confAdd


  #ifdef ENABLE_FEATURE_NTP_TIME
  // confTime
  if (strcmp(_param, "tzstr") == 0 || _isConfPage == CONFPAGE_TIME)
  {
    sprintf_P(logBuf, "%s.TZstr: '%s'", PGMStr_confTime, confTime.timeZoneStr);
    sendLog(logBuf);
  }
  if (strcmp(_param, "ntpenable") == 0 || _isConfPage == CONFPAGE_TIME)
  {
    int tmp;
    if (confTime.ntpEnable)
      tmp = 1;
    else
      tmp = 0;
    sprintf_P(logBuf, "%s.ntpEnable: %d", PGMStr_confTime, tmp);
    sendLog(logBuf);
  }
  if (strcmp(_param, "ntpserver1") == 0 || _isConfPage == CONFPAGE_TIME)
  {
    sprintf_P(logBuf, "%s.ntpServer1: '%s'", PGMStr_confTime, confTime.ntpServer1);
    sendLog(logBuf);
  }
  if (strcmp(_param, "ntpserver2") == 0 || _isConfPage == CONFPAGE_TIME)
  {
    sprintf_P(logBuf, "%s.ntpServer2: '%s'", PGMStr_confTime, confTime.ntpServer2);
    sendLog(logBuf);
  }
  if (strcmp(_param, "ntpsyncint") == 0 || _isConfPage == CONFPAGE_TIME)
  {
    sprintf_P(logBuf, "%s.ntpSyncInt: %lu", PGMStr_confTime, confTime.ntpSyncInterval / 60);
    sendLog(logBuf);
  }
  // confTime
  #endif // ENABLE_FEATURE_NTP_TIME



  // confLog
  if (strcmp(_param, "loglevser") == 0 || _isConfPage == CONFPAGE_LOG)
  {
    sprintf_P(logBuf, "%s.logLevSer: %d", PGMStr_confLog, confLog.logLevelSerial);
    sendLog(logBuf);
  }
  if (strcmp(_param, "loglevweb") == 0 || _isConfPage == CONFPAGE_LOG)
  {
    sprintf_P(logBuf, "%s.logLevWeb: %d", PGMStr_confLog, confLog.logLevelWeb);
    sendLog(logBuf);
  }
  if (strcmp(_param, "loglevmqtt") == 0 || _isConfPage == CONFPAGE_LOG)
  {
    sprintf_P(logBuf, "%s.logLevMqtt: %d", PGMStr_confLog, confLog.logLevelMqtt);
    sendLog(logBuf);
  }
  if (strcmp(_param, "logwebrequests") == 0 || _isConfPage == CONFPAGE_LOG)
  {
    int tmp;
    if (confLog.logWebRequests)
      tmp = 1;
    else
      tmp = 0;
    sprintf_P(logBuf, "%s.logWebRequests: %d", PGMStr_confLog, tmp);
    sendLog(logBuf);
  }
  // confLog



  #ifdef FIRMWARE_VARIANT_THERMOSTAT

  // Thermostat - Values
  if (strcmp(_param, "temp") == 0 || _isConfPage == CONFPAGE_THERM_VALUES)
  {
    snprintf(logBuf, LOG_BUFFER_SIZE, "THERM_setTemp: %2.1f", thermostat_setTemp);
    sendLog(logBuf);
  }
  if (strcmp(_param, "templow") == 0 || _isConfPage == CONFPAGE_THERM_VALUES)
  {
    snprintf(logBuf, LOG_BUFFER_SIZE, "THERM_setTempLow: %2.1f", thermostat_setTempLow);
    sendLog(logBuf);
  }
  if (strcmp(_param, "templow2") == 0 || _isConfPage == CONFPAGE_THERM_VALUES)
  {
    snprintf(logBuf, LOG_BUFFER_SIZE, "THERM_setTempLow2: %2.1f", thermostat_setTempLow2);
    sendLog(logBuf);
  }
  if (strcmp(_param, "mode") == 0 || _isConfPage == CONFPAGE_THERM_VALUES)
  {
    snprintf(logBuf, LOG_BUFFER_SIZE, "THERM_heatingMode: %d", thermostat_heatingMode);
    sendLog(logBuf);
  }
  if (strcmp(_param, "preset") == 0 || _isConfPage == CONFPAGE_THERM_VALUES)
  {
    snprintf(logBuf, LOG_BUFFER_SIZE, "THERM_preset: %d", thermostat_preset);
    sendLog(logBuf);
  }

  // confTherm
  if (strcmp(_param, "autosavetemp") == 0 || _isConfPage == CONFPAGE_THERM)
  {
    int tmp;
    if (confTherm.autoSaveSetTemp)
      tmp = 1;
    else
      tmp = 0;
    sprintf_P(logBuf, "%s.autoSaveTemp: %d", PGMStr_confTherm, tmp);
    sendLog(logBuf);
  }
  if (strcmp(_param, "autosavemode") == 0 || _isConfPage == CONFPAGE_THERM)
  {
    int tmp;
    if (confTherm.autoSaveHeatingMode)
      tmp = 1;
    else
      tmp = 0;
    sprintf_P(logBuf, "%s.autoSaveMode: %d", PGMStr_confTherm, tmp);
    sendLog(logBuf);
  }
  if (strcmp(_param, "savetomqttret") == 0 || _isConfPage == CONFPAGE_THERM)
  {
    int tmp;
    if (confTherm.saveToMqttRetained)
      tmp = 1;
    else
      tmp = 0;
    sprintf_P(logBuf, "%s.savetoMqttRet: %d", PGMStr_confTherm, tmp);
    sendLog(logBuf);
  }
  if (strcmp(_param, "tempmin") == 0 || _isConfPage == CONFPAGE_THERM)
  {
    sprintf_P(logBuf, "%s.tempMin: '%2.1f'", PGMStr_confTherm, confTherm.setTempMin);
    sendLog(logBuf);
  }
  if (strcmp(_param, "tempmax") == 0 || _isConfPage == CONFPAGE_THERM)
  {
    sprintf_P(logBuf, "%s.tempMax: '%2.1f'", PGMStr_confTherm, confTherm.setTempMax);
    sendLog(logBuf);
  }

  if (strcmp(_param, "pirendispps0") == 0 || _isConfPage == CONFPAGE_THERM)
  {
    int tmp;
    if (confTherm.PIRenablesDisplay_preset0only)
      tmp = 1;
    else
      tmp = 0;
    sprintf_P(logBuf, "%s.pirEnDispPs0: %d", PGMStr_confTherm, tmp);
    sendLog(logBuf);
  }
  if (strcmp(_param, "togthdisp") == 0 || _isConfPage == CONFPAGE_THERM)
  {
    int tmp;
    if (confTherm.togglingTempHumAIDisplay)
      tmp = 1;
    else
      tmp = 0;
    sprintf_P(logBuf, "%s.togTHdisp: %d", PGMStr_confTherm, tmp);
    sendLog(logBuf);
  }
  if (strcmp(_param, "minofftime") == 0 || _isConfPage == CONFPAGE_THERM)
  {
    sprintf_P(logBuf, "%s.minOffTime: %d", PGMStr_confTherm, confTherm.heatingMinOffTime);
    sendLog(logBuf);
  }
  if (strcmp(_param, "tempdec") == 0 || _isConfPage == CONFPAGE_THERM)
  {
    sprintf_P(logBuf, "%s.tempDec: %1.2f", PGMStr_confTherm, confTherm.setTempDecreaseVal);
    sendLog(logBuf);
  }
  if (strcmp(_param, "hyst") == 0 || _isConfPage == CONFPAGE_THERM)
  {
    sprintf_P(logBuf, "%s.hyst: %1.2f", PGMStr_confTherm, confTherm.hysteresis);
    sendLog(logBuf);
  }
  if (strcmp(_param, "offmsg") == 0 || _isConfPage == CONFPAGE_THERM)
  {
    sprintf_P(logBuf, "%s.offMsg: '%s'", PGMStr_confTherm, confTherm.offMessage);
    sendLog(logBuf);
  }
  if (strcmp(_param, "modename0") == 0 || _isConfPage == CONFPAGE_THERM)
  {
    sprintf_P(logBuf, "%s.modeName0: '%s'", PGMStr_confTherm, confTherm.modeName0);
    sendLog(logBuf);
  }
  if (strcmp(_param, "modename1") == 0 || _isConfPage == CONFPAGE_THERM)
  {
    sprintf_P(logBuf, "%s.modeName1: '%s'", PGMStr_confTherm, confTherm.modeName1);
    sendLog(logBuf);
  }
  if (strcmp(_param, "psetname0") == 0 || _isConfPage == CONFPAGE_THERM)
  {
    sprintf_P(logBuf, "%s.psetName0: '%s'", PGMStr_confTherm, confTherm.psetName0);
    sendLog(logBuf);
  }
  if (strcmp(_param, "psetname1") == 0 || _isConfPage == CONFPAGE_THERM)
  {
    sprintf_P(logBuf, "%s.psetName1: '%s'", PGMStr_confTherm, confTherm.psetName1);
    sendLog(logBuf);
  }
  if (strcmp(_param, "psetname2") == 0 || _isConfPage == CONFPAGE_THERM)
  {
    sprintf_P(logBuf, "%s.psetName2: '%s'", PGMStr_confTherm, confTherm.psetName2);
    sendLog(logBuf);
  }
  if (strcmp(_param, "itemplab") == 0 || _isConfPage == CONFPAGE_THERM)
  {
    sprintf_P(logBuf, "%s.iTempLab: '%s'", PGMStr_confTherm, confTherm.iTempLabel);
    sendLog(logBuf);
  }
  if (strcmp(_param, "otemplab") == 0 || _isConfPage == CONFPAGE_THERM)
  {
    sprintf_P(logBuf, "%s.oTempLab: '%s'", PGMStr_confTherm, confTherm.oTempLabel);
    sendLog(logBuf);
  }
  if (strcmp(_param, "pausetout") == 0 || _isConfPage == CONFPAGE_THERM)
  {
    sprintf_P(logBuf, "%s.pauseTout: %d", PGMStr_confTherm, confTherm.pauseTout);
    sendLog(logBuf);
  }
  // confTherm
  #endif //FIRMWARE_VARIANT_THERMOSTAT



  #ifdef FIRMWARE_VARIANT_HEATCONTROL
  // confHeatc
  if (strcmp(_param, "heatc") == 0 || _isConfPage == CONFPAGE_HEATC)
  {
    
    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]);
    sendLog(logBuf);
  }
  if (strcmp(_param, "heatl") == 0 || _isConfPage == CONFPAGE_HEATC)
  {
    
    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]);
    sendLog(logBuf);
  }
  if (strcmp(_param, "pumpnl") == 0 || _isConfPage == CONFPAGE_HEATC)
  {
    sprintf_P(logBuf, "%s.pumpBacklash: %d", PGMStr_confHeatc, confHeatc.pumpBacklash);
    sendLog(logBuf);
  }
  if (strcmp(_param, "heatusehc") == 0 || _isConfPage == CONFPAGE_HEATC)
  {
    int tmp;
    if (confHeatc.useHeatCurve) tmp = 1;
    else tmp = 0;
    sprintf_P(logBuf, "%s.useHeatCurve: %d", PGMStr_confHeatc, tmp);
    sendLog(logBuf);
  }
  if (strcmp(_param, "heatforcehc") == 0 || _isConfPage == CONFPAGE_HEATC)
  {
    int tmp;
    if (confHeatc.forceHeatCurve) tmp = 1;
    else tmp = 0;
    sprintf_P(logBuf, "%s.forceHeatCurve: %d", PGMStr_confHeatc, tmp);
    sendLog(logBuf);
  }
  if (strcmp(_param, "heatcvhy0") == 0 || _isConfPage == CONFPAGE_HEATC)
  {
    sprintf_P(logBuf, "%s.hystereseOff: %d", PGMStr_confHeatc, confHeatc.hystereseOff);
    sendLog(logBuf);
  }
  if (strcmp(_param, "heatcvhy1") == 0 || _isConfPage == CONFPAGE_HEATC)
  {
    sprintf_P(logBuf, "%s.hystereseOn: %d", PGMStr_confHeatc, confHeatc.hystereseOn);
    sendLog(logBuf);
  }
  if (strcmp(_param, "heattempfeedlimit") == 0 || _isConfPage == CONFPAGE_HEATC)
  {
    sprintf_P(logBuf, "%s.tempFeedLimit: %d", PGMStr_confHeatc, confHeatc.tempFeedLimit);
    sendLog(logBuf);
  }
  if (strcmp(_param, "heatforcehcalsoon") == 0 || _isConfPage == CONFPAGE_HEATC)
  {
    int tmp;
    if (confHeatc.forceHeatCurveAlsoForSwitchOn) tmp = 1;
    else tmp = 0;
    sprintf_P(logBuf, "%s.forceHeatCurveAlsoForSwitchOn: %d", PGMStr_confHeatc, tmp);
    sendLog(logBuf);
  }
  // confHeatc
  #endif // FIRMWARE_VARIANT_HEATCONTROL



} // getConfig()
