mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
add some thermostat values
This commit is contained in:
@@ -878,6 +878,7 @@ void Thermostat::process_RC300Summer(std::shared_ptr<const Telegram> telegram) {
|
||||
}
|
||||
|
||||
has_update(telegram->read_value(hc->minflowtemp, 8));
|
||||
has_update(telegram->read_value(hc->fastHeatupFactor, 10));
|
||||
}
|
||||
|
||||
// types 0x29B ff
|
||||
@@ -913,6 +914,7 @@ void Thermostat::process_RC300WWmode(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram->read_value(wwMode_, 2)); // 0=off, 1=low, 2=high, 3=auto, 4=own prog
|
||||
has_update(telegram->read_value(wwCircMode_, 3)); // 0=off, 1=on, 2=auto, 4=own?
|
||||
has_update(telegram->read_value(wwChargeDuration_, 10)); // value in steps of 15 min
|
||||
has_update(telegram->read_value(wwCharge_, 11));
|
||||
}
|
||||
|
||||
// types 0x31D and 0x31E
|
||||
@@ -1017,6 +1019,7 @@ void Thermostat::process_RC35Set(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram->read_value(hc->mode, 7)); // night, day, auto
|
||||
hc->hamode = hc->mode; // set special HA mode
|
||||
|
||||
has_update(telegram->read_value(hc->wwprio, 21)); // 0xFF for on
|
||||
has_update(telegram->read_value(hc->summertemp, 22)); // is * 1
|
||||
has_update(telegram->read_value(hc->nofrosttemp, 23)); // is * 1
|
||||
has_update(telegram->read_value(hc->flowtempoffset, 24)); // is * 1, only in mixed circuits
|
||||
@@ -1324,6 +1327,18 @@ bool Thermostat::set_wwtemplow(const char * value, const int8_t id) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Set ww charge RC300, ems+
|
||||
bool Thermostat::set_wwcharge(const char * value, const int8_t id) {
|
||||
bool b = false;
|
||||
if (!Helpers::value2bool(value, b)) {
|
||||
LOG_WARNING(F("Set warm water charge: Invalid value"));
|
||||
return false;
|
||||
}
|
||||
LOG_INFO(F("Setting warm water charge to %s"), b ? F_(on) : F_(off));
|
||||
write_command(0x02F5, 11, b, 0x02F5);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Set ww charge duration in steps of 15 min, ems+
|
||||
bool Thermostat::set_wwchargeduration(const char * value, const int8_t id) {
|
||||
uint8_t t = 0xFF;
|
||||
@@ -1403,7 +1418,7 @@ bool Thermostat::set_wwDisinfect(const char * value, const int8_t id) {
|
||||
}
|
||||
bool Thermostat::set_wwDisinfectDay(const char * value, const int8_t id) {
|
||||
uint8_t set = 0xFF;
|
||||
if (!Helpers::value2enum(value, set, FL_(enum_wwDisinfectDay))) {
|
||||
if (!Helpers::value2enum(value, set, FL_(enum_dayOfWeek))) {
|
||||
LOG_WARNING(F("Set warm water disinfection day: Invalid day"));
|
||||
return false;
|
||||
}
|
||||
@@ -1799,6 +1814,24 @@ bool Thermostat::set_summermode(const char * value, const int8_t id) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Set fastheatupfactor, ems+
|
||||
bool Thermostat::set_fastheatupfactor(const char * value, const int8_t id) {
|
||||
uint8_t hc_num = (id == -1) ? AUTO_HEATING_CIRCUIT : id;
|
||||
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(hc_num);
|
||||
if (hc == nullptr) {
|
||||
LOG_WARNING(F("Setfast heatup factor: Heating Circuit %d not found or activated for device ID 0x%02X"), hc_num, device_id());
|
||||
return false;
|
||||
}
|
||||
int set = 0;
|
||||
if (!Helpers::value2number(value, set)) {
|
||||
LOG_WARNING(F("Set fast heatup factor: Invalid value"));
|
||||
return false;
|
||||
}
|
||||
LOG_INFO(F("Setting fast heatup factor to %d"), set);
|
||||
write_command(summer_typeids[hc->hc_num() - 1], 10, set, summer_typeids[hc->hc_num() - 1]);
|
||||
return true;
|
||||
}
|
||||
|
||||
// sets the thermostat reducemode for RC35
|
||||
bool Thermostat::set_reducemode(const char * value, const int8_t id) {
|
||||
uint8_t hc_num = (id == -1) ? AUTO_HEATING_CIRCUIT : id;
|
||||
@@ -1817,6 +1850,28 @@ bool Thermostat::set_reducemode(const char * value, const int8_t id) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// sets the thermostat heatingtype for RC35, RC300
|
||||
bool Thermostat::set_heatingtype(const char * value, const int8_t id) {
|
||||
uint8_t hc_num = (id == -1) ? AUTO_HEATING_CIRCUIT : id;
|
||||
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(hc_num);
|
||||
if (hc == nullptr) {
|
||||
LOG_WARNING(F("Setting heating type: Heating Circuit %d not found or activated"), hc_num);
|
||||
return false;
|
||||
}
|
||||
uint8_t set = 0xFF;
|
||||
if (Helpers::value2enum(value, set, FL_(enum_heatingtype))) {
|
||||
LOG_INFO(F("Setting heating type to %d for heating circuit %d"), set, hc->hc_num());
|
||||
if (model() == EMS_DEVICE_FLAG_RC35 || model() == EMS_DEVICE_FLAG_RC30_N) {
|
||||
write_command(set_typeids[hc->hc_num() - 1], 0, set, set_typeids[hc->hc_num() - 1]);
|
||||
} else {
|
||||
write_command(curve_typeids[hc->hc_num() - 1], 1, set, curve_typeids[hc->hc_num() - 1]);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
LOG_WARNING(F("Setting heating type: Invalid mode"));
|
||||
return false;
|
||||
}
|
||||
|
||||
// sets the thermostat controlmode for RC35, RC300
|
||||
bool Thermostat::set_controlmode(const char * value, const int8_t id) {
|
||||
uint8_t hc_num = (id == -1) ? AUTO_HEATING_CIRCUIT : id;
|
||||
@@ -2332,6 +2387,8 @@ void Thermostat::register_device_values() {
|
||||
FL_(wwChargeDuration),
|
||||
DeviceValueUOM::LIST,
|
||||
MAKE_CF_CB(set_wwchargeduration));
|
||||
register_device_value(
|
||||
TAG_THERMOSTAT_DATA, &wwCharge_, DeviceValueType::BOOL, nullptr, FL_(wwCharge), DeviceValueUOM::BOOLEAN, MAKE_CF_CB(set_wwcharge));
|
||||
register_device_value(TAG_THERMOSTAT_DATA, &wwExtra1_, DeviceValueType::UINT, nullptr, FL_(wwExtra1), DeviceValueUOM::DEGREES);
|
||||
register_device_value(TAG_THERMOSTAT_DATA, &wwExtra2_, DeviceValueType::UINT, nullptr, FL_(wwExtra2), DeviceValueUOM::DEGREES);
|
||||
break;
|
||||
@@ -2393,6 +2450,7 @@ void Thermostat::register_device_values() {
|
||||
MAKE_CF_CB(set_minexttemp));
|
||||
register_device_value(TAG_THERMOSTAT_DATA, &tempsensor1_, DeviceValueType::USHORT, FL_(div10), FL_(tempsensor1), DeviceValueUOM::DEGREES);
|
||||
register_device_value(TAG_THERMOSTAT_DATA, &tempsensor2_, DeviceValueType::USHORT, FL_(div10), FL_(tempsensor2), DeviceValueUOM::DEGREES);
|
||||
register_device_value(TAG_THERMOSTAT_DATA, &ibaDamping_, DeviceValueType::BOOL, nullptr, FL_(damping), DeviceValueUOM::BOOLEAN, MAKE_CF_CB(set_damping));
|
||||
register_device_value(TAG_THERMOSTAT_DATA, &dampedoutdoortemp_, DeviceValueType::INT, nullptr, FL_(dampedoutdoortemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(TAG_THERMOSTAT_DATA,
|
||||
&ibaBuildingType_,
|
||||
@@ -2413,7 +2471,7 @@ void Thermostat::register_device_values() {
|
||||
register_device_value(TAG_THERMOSTAT_DATA,
|
||||
&wwDisinfectDay_,
|
||||
DeviceValueType::ENUM,
|
||||
FL_(enum_wwDisinfectDay),
|
||||
FL_(enum_dayOfWeek),
|
||||
FL_(wwDisinfectDay),
|
||||
DeviceValueUOM::LIST,
|
||||
MAKE_CF_CB(set_wwDisinfectDay));
|
||||
@@ -2528,6 +2586,7 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
|
||||
tag, &hc->controlmode, DeviceValueType::ENUM, FL_(enum_controlmode), FL_(controlmode), DeviceValueUOM::LIST, MAKE_CF_CB(set_controlmode));
|
||||
register_device_value(tag, &hc->program, DeviceValueType::UINT, nullptr, FL_(program), DeviceValueUOM::NONE, MAKE_CF_CB(set_program));
|
||||
register_device_value(tag, &hc->tempautotemp, DeviceValueType::UINT, FL_(div2), FL_(tempautotemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_tempautotemp));
|
||||
register_device_value(tag, &hc->fastHeatupFactor, DeviceValueType::UINT, nullptr, FL_(fastheatupfactor), DeviceValueUOM::NONE, MAKE_CF_CB(set_fastheatupfactor));
|
||||
break;
|
||||
case EMS_DEVICE_FLAG_CRF:
|
||||
register_device_value(tag, &hc->mode, DeviceValueType::ENUM, FL_(enum_mode5), FL_(mode), DeviceValueUOM::LIST);
|
||||
@@ -2562,7 +2621,7 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
|
||||
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->flowtempoffset, DeviceValueType::UINT, nullptr, FL_(flowtempoffset), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_flowtempoffset));
|
||||
register_device_value(tag, &hc->heatingtype, DeviceValueType::ENUM, FL_(enum_heatingtype), FL_(heatingtype), DeviceValueUOM::LIST);
|
||||
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->reducemode, DeviceValueType::ENUM, FL_(enum_reducemode), FL_(reducemode), DeviceValueUOM::LIST, MAKE_CF_CB(set_reducemode));
|
||||
register_device_value(
|
||||
tag, &hc->controlmode, DeviceValueType::ENUM, FL_(enum_controlmode2), FL_(controlmode), DeviceValueUOM::LIST, MAKE_CF_CB(set_controlmode));
|
||||
@@ -2573,8 +2632,8 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
|
||||
register_device_value(tag, &hc->tempautotemp, DeviceValueType::UINT, FL_(div2), FL_(tempautotemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_tempautotemp));
|
||||
register_device_value(tag, &hc->noreducetemp, DeviceValueType::INT, nullptr, FL_(noreducetemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_noreducetemp));
|
||||
register_device_value(tag, &hc->remotetemp, DeviceValueType::SHORT, FL_(div10), FL_(remotetemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_remotetemp));
|
||||
register_device_value(tag, &dummy_, DeviceValueType::CMD, nullptr, FL_(switchtime), DeviceValueUOM::NONE, MAKE_CF_CB(set_switchtime));
|
||||
register_device_value(tag, &hc->wwprio, DeviceValueType::BOOL, nullptr, FL_(wwprio), DeviceValueUOM::BOOLEAN, MAKE_CF_CB(set_wwprio));
|
||||
register_device_value(tag, &dummy_, DeviceValueType::CMD, nullptr, FL_(switchtime), DeviceValueUOM::NONE, MAKE_CF_CB(set_switchtime));
|
||||
break;
|
||||
case EMS_DEVICE_FLAG_JUNKERS:
|
||||
register_device_value(tag, &hc->mode, DeviceValueType::ENUM, FL_(enum_mode4), FL_(mode), DeviceValueUOM::LIST, MAKE_CF_CB(set_mode));
|
||||
|
||||
@@ -66,6 +66,7 @@ class Thermostat : public EMSdevice {
|
||||
uint8_t party;
|
||||
int8_t noreducetemp; // signed -20°C to +10°C
|
||||
uint8_t wwprio;
|
||||
uint8_t fastHeatupFactor;
|
||||
|
||||
uint8_t hc_num() const {
|
||||
return hc_num_;
|
||||
@@ -172,6 +173,7 @@ class Thermostat : public EMSdevice {
|
||||
uint8_t wwCircMode_;
|
||||
uint8_t wwSetTemp_;
|
||||
uint8_t wwSetTempLow_;
|
||||
uint8_t wwCharge_;
|
||||
uint8_t wwChargeDuration_;
|
||||
uint8_t wwDisinfect_;
|
||||
uint8_t wwDisinfectDay_;
|
||||
@@ -342,6 +344,7 @@ class Thermostat : public EMSdevice {
|
||||
bool set_program(const char * value, const int8_t id);
|
||||
bool set_controlmode(const char * value, const int8_t id);
|
||||
bool set_wwprio(const char * value, const int8_t id);
|
||||
bool set_fastheatupfactor(const char * value, const int8_t id);
|
||||
|
||||
// set functions - these don't use the id/hc, the parameters are ignored
|
||||
bool set_wwmode(const char * value, const int8_t id);
|
||||
@@ -349,6 +352,7 @@ class Thermostat : public EMSdevice {
|
||||
bool set_wwtemplow(const char * value, const int8_t id);
|
||||
bool set_wwonetime(const char * value, const int8_t id);
|
||||
bool set_wwcircmode(const char * value, const int8_t id);
|
||||
bool set_wwcharge(const char * value, const int8_t id);
|
||||
bool set_wwchargeduration(const char * value, const int8_t id);
|
||||
bool set_wwDisinfect(const char * value, const int8_t id);
|
||||
bool set_wwDisinfectDay(const char * value, const int8_t id);
|
||||
@@ -366,6 +370,7 @@ class Thermostat : public EMSdevice {
|
||||
bool set_building(const char * value, const int8_t id);
|
||||
bool set_damping(const char * value, const int8_t id);
|
||||
bool set_language(const char * value, const int8_t id);
|
||||
bool set_heatingtype(const char * value, const int8_t id);
|
||||
};
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
@@ -315,7 +315,7 @@ MAKE_PSTR_LIST(enum_ibaMainDisplay,
|
||||
F_(smoke_temperature))
|
||||
MAKE_PSTR_LIST(enum_ibaLanguage, F_(german), F_(dutch), F_(french), F_(italian))
|
||||
MAKE_PSTR_LIST(enum_floordrystatus, F_(off), F_(start), F_(heat), F_(hold), F_(cool), F_(end))
|
||||
MAKE_PSTR_LIST(enum_ibaBuildingType, F_(light), F_(medium), F_(heavy)) // RC300
|
||||
MAKE_PSTR_LIST(enum_ibaBuildingType, F_(light), F_(medium), F_(heavy))
|
||||
MAKE_PSTR_LIST(enum_wwMode, F_(off), F_(low), F_(high), F_(auto), F_(own_prog))
|
||||
MAKE_PSTR_LIST(enum_wwCircMode, F_(off), F_(on), F_(auto), F_(own_prog))
|
||||
MAKE_PSTR_LIST(enum_wwMode2, F_(off), F_(on), F_(auto))
|
||||
@@ -345,7 +345,7 @@ MAKE_PSTR_LIST(enum_controlmode3, F_(off), F_(room), F_(outdoor), F("room+outdoo
|
||||
MAKE_PSTR_LIST(enum_control, F_(off), F_(rc20), F_(rc3x))
|
||||
|
||||
MAKE_PSTR_LIST(enum_wwProgMode, F("std prog"), F_(own_prog))
|
||||
MAKE_PSTR_LIST(enum_wwDisinfectDay, F("mo"), F("tu"), F("we"), F("th"), F("fr"), F("sa"), F("so"), F("every day"))
|
||||
MAKE_PSTR_LIST(enum_dayOfWeek, F("mo"), F("tu"), F("we"), F("th"), F("fr"), F("sa"), F("so"), F("all"))
|
||||
MAKE_PSTR_LIST(enum_wwChargeDuration, F_(off), F("15min"), F("30min"), F("45min"), F("60min"), F("75min"), F("90min"), F("105min"), F("120min"))
|
||||
|
||||
// solar list
|
||||
@@ -520,6 +520,7 @@ MAKE_PSTR_LIST(floordrystatus, F("floordry"), F("floor drying"))
|
||||
MAKE_PSTR_LIST(floordrytemp, F("floordrytemp"), F("floor drying temperature"))
|
||||
MAKE_PSTR_LIST(wwMode, F("wwmode"), F("mode"))
|
||||
MAKE_PSTR_LIST(wwSetTempLow, F("wwsettemplow"), F("set low temperature"))
|
||||
MAKE_PSTR_LIST(wwCharge, F("wwcharge"), F("charge"))
|
||||
MAKE_PSTR_LIST(wwChargeDuration, F("wwchargeduration"), F("charge duration"))
|
||||
MAKE_PSTR_LIST(wwExtra1, F("wwextra1"), F("circuit 1 extra"))
|
||||
MAKE_PSTR_LIST(wwExtra2, F("wwextra2"), F("circuit 2 extra"))
|
||||
@@ -527,7 +528,7 @@ MAKE_PSTR_LIST(setpoint_roomTemp, F("seltemp"), F("selected room temperature"))
|
||||
MAKE_PSTR_LIST(curr_roomTemp, F("currtemp"), F("current room temperature"))
|
||||
MAKE_PSTR_LIST(mode, F("mode"), F("mode"))
|
||||
MAKE_PSTR_LIST(modetype, F("modetype"), F("mode type"))
|
||||
|
||||
MAKE_PSTR_LIST(fastheatupfactor, F("fastheatupfactor"), F("fast heatup factor"))
|
||||
MAKE_PSTR_LIST(daytemp, F("daytemp"), F("day temperature"))
|
||||
MAKE_PSTR_LIST(heattemp, F("heattemp"), F("heat temperature"))
|
||||
MAKE_PSTR_LIST(nighttemp, F("nighttemp"), F("night temperature"))
|
||||
|
||||
Reference in New Issue
Block a user