seltemp command, check mode first for RC30_n and Junkers

This commit is contained in:
MichaelDvP
2022-03-31 12:44:39 +02:00
parent 608d5e332d
commit efd758d627

View File

@@ -2680,16 +2680,15 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co
default: default:
// automatic selection, if no type is defined, we use the standard code // automatic selection, if no type is defined, we use the standard code
validate_typeid = monitor_typeids[hc->hc()]; //get setpoint roomtemp back validate_typeid = monitor_typeids[hc->hc()]; //get setpoint roomtemp back
if (model == EMS_DEVICE_FLAG_RC35) {
uint8_t mode_ = hc->get_mode(); uint8_t mode_ = hc->get_mode();
if (mode_ == HeatingCircuit::Mode::NIGHT) { if (mode_ == HeatingCircuit::Mode::NIGHT) {
offset = EMS_OFFSET_RC35Set_temp_night; offset = EMS_OFFSET_RC35Set_temp_night;
} else if (mode_ == HeatingCircuit::Mode::DAY) { } else if (mode_ == HeatingCircuit::Mode::DAY) {
offset = EMS_OFFSET_RC35Set_temp_day; offset = EMS_OFFSET_RC35Set_temp_day;
} else { } else if (model == EMS_DEVICE_FLAG_RC35) {
offset = EMS_OFFSET_RC35Set_seltemp; // https://github.com/emsesp/EMS-ESP/issues/310 offset = EMS_OFFSET_RC35Set_seltemp; // https://github.com/emsesp/EMS-ESP/issues/310
}
} else { } else {
// RC30_N missing temporary auto temperature https://github.com/emsesp/EMS-ESP32/issues/395
uint8_t modetype = hc->get_mode_type(); uint8_t modetype = hc->get_mode_type();
offset = (modetype == HeatingCircuit::Mode::NIGHT) ? EMS_OFFSET_RC35Set_temp_night : EMS_OFFSET_RC35Set_temp_day; offset = (modetype == HeatingCircuit::Mode::NIGHT) ? EMS_OFFSET_RC35Set_temp_night : EMS_OFFSET_RC35Set_temp_day;
} }
@@ -2714,7 +2713,16 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co
offset = EMS_OFFSET_JunkersSetMessage_day_temp; offset = EMS_OFFSET_JunkersSetMessage_day_temp;
break; break;
default: default:
// automatic selection, if no type is defined, we use the standard code // automatic selection, if no type is defined, we check mode and modetype
uint8_t mode_ = hc->get_mode();
if (mode_ == HeatingCircuit::Mode::NIGHT || mode_ == HeatingCircuit::Mode::ECO) {
offset = EMS_OFFSET_JunkersSetMessage_night_temp;
} else if (mode_ == HeatingCircuit::Mode::DAY || mode_ == HeatingCircuit::Mode::HEAT) {
offset = EMS_OFFSET_JunkersSetMessage_day_temp;
} else if (mode_ == HeatingCircuit::Mode::NOFROST) {
offset = EMS_OFFSET_JunkersSetMessage_no_frost_temp;
} else {
// auto mode, missing temporary parameter, use modetype https://github.com/emsesp/EMS-ESP32/issues/400
uint8_t modetype = hc->get_mode_type(); uint8_t modetype = hc->get_mode_type();
if (modetype == HeatingCircuit::Mode::NIGHT || modetype == HeatingCircuit::Mode::ECO) { if (modetype == HeatingCircuit::Mode::NIGHT || modetype == HeatingCircuit::Mode::ECO) {
offset = EMS_OFFSET_JunkersSetMessage_night_temp; offset = EMS_OFFSET_JunkersSetMessage_night_temp;
@@ -2723,6 +2731,7 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co
} else { } else {
offset = EMS_OFFSET_JunkersSetMessage_no_frost_temp; offset = EMS_OFFSET_JunkersSetMessage_no_frost_temp;
} }
}
break; break;
} }
@@ -2741,7 +2750,16 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co
offset = EMS_OFFSET_JunkersSetMessage2_heat_temp; offset = EMS_OFFSET_JunkersSetMessage2_heat_temp;
break; break;
default: default:
// automatic selection, if no type is defined, we use the standard code // automatic selection, if no type is defined, we check mode and modetype
uint8_t mode_ = hc->get_mode();
if (mode_ == HeatingCircuit::Mode::NIGHT || mode_ == HeatingCircuit::Mode::ECO) {
offset = EMS_OFFSET_JunkersSetMessage2_eco_temp;
} else if (mode_ == HeatingCircuit::Mode::DAY || mode_ == HeatingCircuit::Mode::HEAT) {
offset = EMS_OFFSET_JunkersSetMessage2_heat_temp;
} else if (mode_ == HeatingCircuit::Mode::NOFROST) {
offset = EMS_OFFSET_JunkersSetMessage2_no_frost_temp;
} else {
// auto mode, missing temporary parameter, use modetype https://github.com/emsesp/EMS-ESP32/issues/400
uint8_t modetype = hc->get_mode_type(); uint8_t modetype = hc->get_mode_type();
if (modetype == HeatingCircuit::Mode::NIGHT || modetype == HeatingCircuit::Mode::ECO) { if (modetype == HeatingCircuit::Mode::NIGHT || modetype == HeatingCircuit::Mode::ECO) {
offset = EMS_OFFSET_JunkersSetMessage2_eco_temp; offset = EMS_OFFSET_JunkersSetMessage2_eco_temp;
@@ -2750,6 +2768,7 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co
} else { } else {
offset = EMS_OFFSET_JunkersSetMessage2_no_frost_temp; offset = EMS_OFFSET_JunkersSetMessage2_no_frost_temp;
} }
}
break; break;
} }
} }