thermostat RC25 additions

This commit is contained in:
MichaelDvP
2021-09-09 18:44:43 +02:00
parent b8c07e31cf
commit 1d259d14c8

View File

@@ -638,19 +638,25 @@ void Thermostat::process_RC20Set(std::shared_ptr<const Telegram> telegram) {
// type 0xAE - data from the RC20 thermostat (0x17) - not for RC20's
// 17 00 AE 00 80 12 2E 00 D0 00 00 64 (#data=8)
// https://github.com/emsesp/EMS-ESP/issues/361
void Thermostat::process_RC20Monitor_2(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
has_update(telegram->read_bitvalue(hc->modetype, 0, 7)); // day/night MSB 7th bit is day
// has_update(telegram->read_bitvalue(hc->modetype, 0, 7)); // day/night-mode MSB 7th bit is day
// modes byte 0,1: day: 8002, night: 0000, auto-day:0402, auto-night:0400
has_update(telegram->read_bitvalue(hc->modetype, 1, 1)); // day/night
has_update(telegram->read_value(hc->setpoint_roomTemp, 2, 1)); // is * 2, force as single byte
has_update(telegram->read_value(hc->curr_roomTemp, 3)); // is * 10
// RC25 extension:
has_update(telegram->read_bitvalue(hc->summermode, 1, 0));
}
// 0xAD - for reading the mode from the RC20/ES72 thermostat (0x17)
// see https://github.com/emsesp/EMS-ESP/issues/334#issuecomment-611698259
// offset: 01-nighttemp, 02-daytemp, 03-mode, 0B-program(1-9), 0D-setpoint_roomtemp(temporary)
// RC25(0x17) -> All(0x00), ?(0xAD), data: 01 27 2D 00 44 05 01 FF 28 19 0A 07 00 00 F6 12 5A 11 00 28 05 05 00
void Thermostat::process_RC20Set_2(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
if (hc == nullptr) {
@@ -661,6 +667,11 @@ void Thermostat::process_RC20Set_2(std::shared_ptr<const Telegram> telegram) {
has_update(telegram->read_value(hc->mode, 3));
hc->hamode = hc->mode; // set special HA mode
has_update(telegram->read_value(hc->program, 11)); // 1 .. 9 predefined programs
// RC25 extension:
has_update(telegram->read_value(ibaMinExtTemperature_, 14));
has_update(telegram->read_value(hc->minflowtemp, 15));
has_update(telegram->read_value(hc->maxflowtemp, 16));
has_update(telegram->read_value(hc->summertemp, 17));
}
// 0xAF - for reading the roomtemperature from the RC20/ES72 thermostat (0x18, 0x19, ..)
@@ -2603,6 +2614,13 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
register_device_value(tag, &hc->daytemp, DeviceValueType::UINT, FL_(div2), FL_(daytemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_daytemp));
register_device_value(tag, &hc->nighttemp, DeviceValueType::UINT, FL_(div2), FL_(nighttemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_nighttemp));
register_device_value(tag, &hc->program, DeviceValueType::UINT, nullptr, FL_(program), DeviceValueUOM::NONE, MAKE_CF_CB(set_program));
// RC25 additions, guess, not validated by users, see:https://github.com/emsesp/EMS-ESP32/issues/106
register_device_value(tag, &hc->minflowtemp, DeviceValueType::UINT, nullptr, FL_(minflowtemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_minflowtemp));
register_device_value(tag, &hc->maxflowtemp, DeviceValueType::UINT, nullptr, FL_(maxflowtemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_maxflowtemp));
register_device_value(tag, &hc->tempautotemp, DeviceValueType::UINT, FL_(div2), FL_(tempautotemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_tempautotemp));
register_device_value(tag, &hc->heatingtype, DeviceValueType::ENUM, FL_(enum_heatingtype), FL_(heatingtype), DeviceValueUOM::LIST, MAKE_CF_CB(set_heatingtype));
register_device_value(tag, &hc->summertemp, DeviceValueType::UINT, nullptr, FL_(summertemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_summertemp));
register_device_value(tag, &hc->summermode, DeviceValueType::BOOL, nullptr, FL_(summermode), DeviceValueUOM::BOOLEAN);
break;
case EMS_DEVICE_FLAG_RC30_N:
case EMS_DEVICE_FLAG_RC35: