Skip to content

Commit cbb7d46

Browse files
committed
add cooling emsesp#1198, fix min limit of noreducetemp
1 parent 3efe16c commit cbb7d46

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/devices/thermostat.cpp

+17-1
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,7 @@ void Thermostat::process_RC300Set(std::shared_ptr<const Telegram> telegram) {
10191019
has_update(telegram, hc->reducetemp, 9);
10201020
has_update(telegram, hc->noreducetemp, 12);
10211021
has_update(telegram, hc->remoteseltemp, 17); // see https://github.com/emsesp/EMS-ESP32/issues/590
1022+
has_update(telegram, hc->cooling, 28);
10221023
}
10231024

10241025
// types 0x2AF ff
@@ -1970,6 +1971,20 @@ bool Thermostat::set_wwprio(const char * value, const int8_t id) {
19701971
return true;
19711972
}
19721973

1974+
// set cooling
1975+
bool Thermostat::set_cooling(const char * value, const int8_t id) {
1976+
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit((id == -1) ? AUTO_HEATING_CIRCUIT : id);
1977+
if (hc == nullptr) {
1978+
return false;
1979+
}
1980+
1981+
bool b;
1982+
if (!Helpers::value2bool(value, b)) {
1983+
return false;
1984+
}
1985+
write_command(set_typeids[hc->hc()], 28, b ? 0x01 : 0x00, set_typeids[hc->hc()]);
1986+
return true;
1987+
}
19731988

19741989
// sets the thermostat ww circulation working mode, where mode is a string
19751990
bool Thermostat::set_wwcircmode(const char * value, const int8_t id) {
@@ -4178,6 +4193,7 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
41784193
register_device_value(tag, &hc->noreducetemp, DeviceValueType::INT, FL_(noreducetemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_noreducetemp));
41794194
register_device_value(tag, &hc->reducetemp, DeviceValueType::INT, FL_(reducetemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_reducetemp));
41804195
register_device_value(tag, &hc->wwprio, DeviceValueType::BOOL, FL_(wwprio), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwprio));
4196+
register_device_value(tag, &hc->cooling, DeviceValueType::BOOL, FL_(cooling), DeviceValueUOM::NONE, MAKE_CF_CB(set_cooling));
41814197

41824198
register_device_value(tag, &hc->hpmode, DeviceValueType::ENUM, FL_(enum_hpmode), FL_(hpmode), DeviceValueUOM::NONE, MAKE_CF_CB(set_hpmode));
41834199
register_device_value(tag, &hc->dewoffset, DeviceValueType::UINT, FL_(dewoffset), DeviceValueUOM::K, MAKE_CF_CB(set_dewoffset));
@@ -4350,7 +4366,7 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
43504366
MAKE_CF_CB(set_tempautotemp),
43514367
0,
43524368
30);
4353-
register_device_value(tag, &hc->noreducetemp, DeviceValueType::INT, FL_(noreducetemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_noreducetemp), -30, 10);
4369+
register_device_value(tag, &hc->noreducetemp, DeviceValueType::INT, FL_(noreducetemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_noreducetemp), -31, 10);
43544370
register_device_value(tag, &hc->reducetemp, DeviceValueType::INT, FL_(reducetemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_reducetemp), -20, 10);
43554371
register_device_value(tag, &hc->vacreducetemp, DeviceValueType::INT, FL_(vacreducetemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_vacreducetemp), -20, 10);
43564372
register_device_value(

src/devices/thermostat.h

+2
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ class Thermostat : public EMSdevice {
9494
uint8_t roomtempdiff;
9595
uint8_t hpminflowtemp;
9696
uint8_t hpmode;
97+
uint8_t cooling;
9798

9899
uint8_t hc_num() const {
99100
return hc_num_;
@@ -565,6 +566,7 @@ class Thermostat : public EMSdevice {
565566
bool set_dewoffset(const char * value, const int8_t id);
566567
bool set_hpminflowtemp(const char * value, const int8_t id);
567568
bool set_hpmode(const char * value, const int8_t id);
569+
bool set_cooling(const char * value, const int8_t id);
568570
};
569571

570572
} // namespace emsesp

0 commit comments

Comments
 (0)