mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 00:39:50 +03:00
seltemp for CR120 thermostat, #1779
This commit is contained in:
@@ -1093,8 +1093,13 @@ void Thermostat::process_RC300Set(std::shared_ptr<const Telegram> telegram) {
|
|||||||
// has_update(telegram, hc->selTemp, 8, 1); // single byte conversion, value is * 2 - auto?
|
// has_update(telegram, hc->selTemp, 8, 1); // single byte conversion, value is * 2 - auto?
|
||||||
// has_update(telegram, hc->selTemp, 10, 1); // single byte conversion, value is * 2 - manual
|
// has_update(telegram, hc->selTemp, 10, 1); // single byte conversion, value is * 2 - manual
|
||||||
|
|
||||||
has_update(telegram, hc->mode_new, 21); // for BC400
|
has_update(telegram, hc->mode_new, 21); // for BC400
|
||||||
has_bitupdate(telegram, hc->mode, 0, 0); // RC300, RC100
|
// set mode for CR120, https://github.com/emsesp/EMS-ESP32/discussions/1779
|
||||||
|
if (Helpers::hasValue(hc->mode_new)) {
|
||||||
|
has_update(hc->mode, hc->mode_new == 2 ? 1 : 0);
|
||||||
|
} else {
|
||||||
|
has_bitupdate(telegram, hc->mode, 0, 0); // RC300, RC100
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
telegram->read_value(hc->mode_new, 21); // 0-off, 1-manual, 2-auto
|
telegram->read_value(hc->mode_new, 21); // 0-off, 1-manual, 2-auto
|
||||||
if (Helpers::hasValue(hc->mode_new)) {
|
if (Helpers::hasValue(hc->mode_new)) {
|
||||||
@@ -2815,8 +2820,14 @@ bool Thermostat::set_mode_n(const uint8_t mode, const int8_t id) {
|
|||||||
case EMSdevice::EMS_DEVICE_FLAG_RC300:
|
case EMSdevice::EMS_DEVICE_FLAG_RC300:
|
||||||
case EMSdevice::EMS_DEVICE_FLAG_RC100:
|
case EMSdevice::EMS_DEVICE_FLAG_RC100:
|
||||||
case EMSdevice::EMS_DEVICE_FLAG_R3000:
|
case EMSdevice::EMS_DEVICE_FLAG_R3000:
|
||||||
offset = EMS_OFFSET_RCPLUSSet_mode;
|
// CR120, https://github.com/emsesp/EMS-ESP32/discussions/1779
|
||||||
set_mode_value = set_mode_value == 2 ? 0xFF : 0;
|
if (Helpers::hasValue(hc->mode_new)) { // enum: 0- off, 1- manual, 2- auto
|
||||||
|
offset = EMS_OFFSET_RCPLUSSet_mode_new;
|
||||||
|
set_mode_value = set_mode_value == 1 ? 2 : 1;
|
||||||
|
} else { // enum: 0- manual, 1- auto
|
||||||
|
offset = EMS_OFFSET_RCPLUSSet_mode;
|
||||||
|
set_mode_value = set_mode_value == 1 ? 0xFF : 0;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case EMSdevice::EMS_DEVICE_FLAG_JUNKERS:
|
case EMSdevice::EMS_DEVICE_FLAG_JUNKERS:
|
||||||
if (has_flags(EMSdevice::EMS_DEVICE_FLAG_JUNKERS_OLD)) {
|
if (has_flags(EMSdevice::EMS_DEVICE_FLAG_JUNKERS_OLD)) {
|
||||||
@@ -3546,7 +3557,11 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co
|
|||||||
factor = 1;
|
factor = 1;
|
||||||
break;
|
break;
|
||||||
case HeatingCircuit::Mode::MANUAL:
|
case HeatingCircuit::Mode::MANUAL:
|
||||||
offset = 0x0A; // manual offset
|
if (Helpers::hasValue(hc->mode_new)) {
|
||||||
|
offset = 22; // manual offset CR120
|
||||||
|
} else {
|
||||||
|
offset = 10; // manual offset
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case HeatingCircuit::Mode::TEMPAUTO:
|
case HeatingCircuit::Mode::TEMPAUTO:
|
||||||
offset = 0x08; // auto offset
|
offset = 0x08; // auto offset
|
||||||
@@ -3617,13 +3632,14 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co
|
|||||||
offset = 9;
|
offset = 9;
|
||||||
factor = 1;
|
factor = 1;
|
||||||
break;
|
break;
|
||||||
default:
|
default: // seltemp
|
||||||
// HeatingCircuit::Mode::AUTO:
|
|
||||||
uint8_t mode_ = hc->get_mode();
|
uint8_t mode_ = hc->get_mode();
|
||||||
if (mode_ == HeatingCircuit::Mode::MANUAL) {
|
if (Helpers::hasValue(hc->mode_new) && mode_ == HeatingCircuit::Mode::MANUAL) {
|
||||||
offset = 0x0A; // manual offset
|
offset = 22; // manual offset CR120
|
||||||
|
} else if (mode_ == HeatingCircuit::Mode::MANUAL) {
|
||||||
|
offset = 10; // manual offset
|
||||||
} else {
|
} else {
|
||||||
offset = 0x08; // auto offset
|
offset = 8; // auto offset
|
||||||
// special case to reactivate auto temperature, see #737, #746
|
// special case to reactivate auto temperature, see #737, #746
|
||||||
if (temperature == -1) {
|
if (temperature == -1) {
|
||||||
factor = 1;
|
factor = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user