|  | @@ -27,8 +27,18 @@ bool setConfig(char* param, char* value) {
 | 
	
		
			
				|  |  |  #endif
 | 
	
		
			
				|  |  |      setTempLowTo(valueFloat);
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  | +  else if ( strcmp(param, "tempLow2") == 0 ) {
 | 
	
		
			
				|  |  | +    float valueFloat = round(atof(value) * 2.0) / 2.0;
 | 
	
		
			
				|  |  | +#ifdef DEBUG_VERBOSE
 | 
	
		
			
				|  |  | +    Serial.print(valueFloat);
 | 
	
		
			
				|  |  | +#endif
 | 
	
		
			
				|  |  | +    setTempLow2To(valueFloat);
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  |    else if ( strcmp(param, "mode") == 0 ) {
 | 
	
		
			
				|  |  | -    setHeatingmodeTo(atoi(value));
 | 
	
		
			
				|  |  | +    int val = atoi(value);
 | 
	
		
			
				|  |  | +    if (val >= 0 && val <= 3) {
 | 
	
		
			
				|  |  | +      setHeatingmodeTo(val);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    //confdata
 | 
	
	
		
			
				|  | @@ -214,6 +224,12 @@ void getConfig(char* param) {
 | 
	
		
			
				|  |  |      sprintf(buf, "setTempLow: '%s'", buf2);
 | 
	
		
			
				|  |  |      sendStatus(buf);
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  | +  else if ( strcmp(param, "tempLow2") == 0 ) {
 | 
	
		
			
				|  |  | +    char buf2[11];
 | 
	
		
			
				|  |  | +    dtostrf(setTempLow2, 2, 1, buf2);
 | 
	
		
			
				|  |  | +    sprintf(buf, "setTempLow2: '%s'", buf2);
 | 
	
		
			
				|  |  | +    sendStatus(buf);
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  |    else if ( strcmp(param, "mode") == 0 ) {
 | 
	
		
			
				|  |  |      sprintf(buf, "heatingMode: '%d'", heatingMode);
 | 
	
		
			
				|  |  |      sendStatus(buf);
 | 
	
	
		
			
				|  | @@ -458,6 +474,8 @@ void printConfig2() {
 | 
	
		
			
				|  |  |    Serial.println(setTempMax);
 | 
	
		
			
				|  |  |    Serial.print("tempLow: ");
 | 
	
		
			
				|  |  |    Serial.print(setTempLow);
 | 
	
		
			
				|  |  | +  Serial.print("tempLow2: ");
 | 
	
		
			
				|  |  | +  Serial.print(setTempLow2);
 | 
	
		
			
				|  |  |    Serial.print("tempDec: ");
 | 
	
		
			
				|  |  |    Serial.println(setTempDecreaseVal);
 | 
	
		
			
				|  |  |    Serial.print("hyst: ");
 | 
	
	
		
			
				|  | @@ -598,7 +616,7 @@ bool loadConfig2() {
 | 
	
		
			
				|  |  |        domoticzIdx_ThermostatMode = atoi(json["domIdxMode"] | "");
 | 
	
		
			
				|  |  |        domoticzIdx_TempHumSensor = atoi(json["domIdxTempHum"] | "");
 | 
	
		
			
				|  |  |        domoticzIdx_Heating = atoi(json["domIdxHeating"] | "");
 | 
	
		
			
				|  |  | -      
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |        domoticzIdx_PIR = atoi(json["domIdxPIR"] | "");
 | 
	
		
			
				|  |  |        strlcpy(outTemp_topic_in, json["outTempTop"] | "", 51);
 | 
	
		
			
				|  |  |        strlcpy(outHum_topic_in, json["outHumTop"] | "", 51);
 | 
	
	
		
			
				|  | @@ -613,6 +631,7 @@ bool loadConfig2() {
 | 
	
		
			
				|  |  |        setTempMin = atof(json["tempMin"] | "");
 | 
	
		
			
				|  |  |        setTempMax = atof(json["tempMax"] | "");
 | 
	
		
			
				|  |  |        setTempLow = atof(json["tempLow"] | "");
 | 
	
		
			
				|  |  | +      setTempLow2 = atof(json["tempLow2"] | "");
 | 
	
		
			
				|  |  |        setTempDecreaseVal = atof(json["tempDec"] | "");
 | 
	
		
			
				|  |  |        hysteresis = atof(json["hyst"] | "");
 | 
	
		
			
				|  |  |        tempCorrVal = atof(json["tempCorr"] | "");
 | 
	
	
		
			
				|  | @@ -623,7 +642,7 @@ bool loadConfig2() {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |        if (atoi(json["PIRenDisp"] | "") == 1) PIR_enablesDisplay = true;
 | 
	
		
			
				|  |  |        else PIR_enablesDisplay = false;
 | 
	
		
			
				|  |  | -     
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |        Serial.println("Loaded config values:");
 | 
	
		
			
				|  |  |        printConfig2();
 | 
	
		
			
				|  |  |        return true;
 | 
	
	
		
			
				|  | @@ -685,15 +704,15 @@ bool saveConfig() { // safeConfig
 | 
	
		
			
				|  |  |    json["inTop"] = mqtt_topic_in;
 | 
	
		
			
				|  |  |    json["outTop"] = mqtt_topic_out;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -  if(mqtt_outRetain) json["outRet"] = 1;
 | 
	
		
			
				|  |  | +  if (mqtt_outRetain) json["outRet"] = 1;
 | 
	
		
			
				|  |  |    else json["outRet"] = 0;
 | 
	
		
			
				|  |  | -  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |    json["willTop"] = mqtt_willTopic;
 | 
	
		
			
				|  |  |    json["willQos"] = mqtt_willQos;
 | 
	
		
			
				|  |  | -  
 | 
	
		
			
				|  |  | -  if(mqtt_willRetain) json["willRet"] = 1;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  if (mqtt_willRetain) json["willRet"] = 1;
 | 
	
		
			
				|  |  |    else json["willRet"] = 0;
 | 
	
		
			
				|  |  | -  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |    json["willMsg"] = mqtt_willMsg;
 | 
	
		
			
				|  |  |    json["domOutTop"] = domoticz_out_topic;
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -723,16 +742,17 @@ bool saveConfig2() { // safeConfig2
 | 
	
		
			
				|  |  |    json["outTempTop"] = outTemp_topic_in;
 | 
	
		
			
				|  |  |    json["outHumTop"] = outHum_topic_in;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -  if(autoSaveSetTemp) json["autoSaveTemp"] = 1;
 | 
	
		
			
				|  |  | +  if (autoSaveSetTemp) json["autoSaveTemp"] = 1;
 | 
	
		
			
				|  |  |    else json["autoSaveTemp"] = 0;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -  if(autoSaveHeatingMode) json["autoSaveMode"] = 1;
 | 
	
		
			
				|  |  | +  if (autoSaveHeatingMode) json["autoSaveMode"] = 1;
 | 
	
		
			
				|  |  |    else json["autoSaveMode"] = 0;
 | 
	
		
			
				|  |  | -  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |    json["minOffTime"] = heatingMinOffTime;
 | 
	
		
			
				|  |  |    json["tempMin"] = setTempMin;
 | 
	
		
			
				|  |  |    json["tempMax"] = setTempMax;
 | 
	
		
			
				|  |  |    json["tempLow"] = setTempLow;
 | 
	
		
			
				|  |  | +  json["tempLow2"] = setTempLow2;
 | 
	
		
			
				|  |  |    json["tempDec"] = setTempDecreaseVal;
 | 
	
		
			
				|  |  |    json["hyst"] = hysteresis;
 | 
	
		
			
				|  |  |    json["tempCorr"] = tempCorrVal;
 | 
	
	
		
			
				|  | @@ -741,7 +761,7 @@ bool saveConfig2() { // safeConfig2
 | 
	
		
			
				|  |  |    json["dispInt"] = displayInterval;
 | 
	
		
			
				|  |  |    json["dispTout"] = displayTimeout;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -  if(PIR_enablesDisplay) json["PIRenDisp"] = 1;
 | 
	
		
			
				|  |  | +  if (PIR_enablesDisplay) json["PIRenDisp"] = 1;
 | 
	
		
			
				|  |  |    else json["PIRenDisp"] = 0;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    yield();
 |