Skip to content

Commit

Permalink
add values/settings for emsesp#878, emsesp#879, emsesp#880
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDvP committed Jan 2, 2023
1 parent 718ede8 commit 49113ed
Show file tree
Hide file tree
Showing 5 changed files with 139 additions and 0 deletions.
72 changes: 72 additions & 0 deletions src/devices/boiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,18 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
FL_(maxHeatHeat),
DeviceValueUOM::NONE,
MAKE_CF_CB(set_maxHeatHeat));
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&manDefrost_,
DeviceValueType::BOOL,
FL_(manDefrost),
DeviceValueUOM::NONE,
MAKE_CF_CB(set_manDefrost));
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&pvCooling_,
DeviceValueType::BOOL,
FL_(pvCooling),
DeviceValueUOM::NONE,
MAKE_CF_CB(set_pvCooling));
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&maxHeatDhw_,
DeviceValueType::ENUM,
Expand Down Expand Up @@ -472,6 +484,22 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
MAKE_CF_CB(set_additionalHeaterDelay),
10,
1000);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&auxMaxTemp_,
DeviceValueType::UINT,
DeviceValueNumOp::DV_NUMOP_MUL10,
FL_(auxMaxTemp),
DeviceValueUOM::DEGREES,
MAKE_CF_CB(set_auxMaxTemp),
0,
10);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&auxHeatMode_,
DeviceValueType::ENUM,
FL_(enum_modetype),
FL_(auxHeatMode),
DeviceValueUOM::NONE,
MAKE_CF_CB(set_auxHeatMode));
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&hpHystHeat_,
DeviceValueType::USHORT,
Expand Down Expand Up @@ -1202,6 +1230,11 @@ void Boiler::process_HpInConfig(std::shared_ptr<const Telegram> telegram) {
has_update(hpInput[3].option, option, 12);
}

// Boiler(0x08) -W-> Me(0x0B), HpHeaterConfig(0x0485)
void Boiler::process_HpCooling(std::shared_ptr<const Telegram> telegram) {
has_update(pvCooling_, 21);
}

// Boiler(0x08) -W-> Me(0x0B), HpHeaterConfig(0x0492), data: 03 00 00 04 00
void Boiler::process_HpHeaterConfig(std::shared_ptr<const Telegram> telegram) {
has_update(maxHeatComp_, 2);
Expand Down Expand Up @@ -1401,9 +1434,12 @@ void Boiler::process_HpPumps(std::shared_ptr<const Telegram> telegram) {

// Boiler(0x08) -> All(0x00), ?(0x0491), data: 03 01 00 00 00 02 64 00 00 14 01 2C 00 0A 00 1E 00 1E 00 00 1E 0A 1E 05 05
void Boiler::process_HpAdditionalHeater(std::shared_ptr<const Telegram> telegram) {
has_update(telegram, manDefrost_, 0); // off/on
has_update(telegram, auxHeaterOnly_, 1);
has_update(telegram, auxHeaterOff_, 2);
has_update(telegram, auxHeatMode_, 4); // eco/comfort
has_update(telegram, tempParMode_, 5);
has_update(telegram, auxMaxTemp_, 14); // is *10
has_update(telegram, auxHeaterDelay_, 16); // is / 10
}

Expand Down Expand Up @@ -2243,6 +2279,42 @@ bool Boiler::set_additionalHeaterDelay(const char * value, const int8_t id) {
return false;
}

bool Boiler::set_auxHeatMode(const char * value, const int8_t id) {
uint8_t v;
if (Helpers::value2enum(value, v, FL_(enum_modetype))) {
write_command(0x491, 4, v, 0x491);
return true;
}
return false;
}

bool Boiler::set_auxMaxTemp(const char * value, const int8_t id) {
float v;
if (Helpers::value2temperature(value, v)) {
write_command(0x491, 14, (uint8_t)(v * 10), 0x491);
return true;
}
return false;
}

bool Boiler::set_manDefrost(const char * value, const int8_t id) {
bool v;
if (Helpers::value2bool(value, v)) {
write_command(0x491, 0, v ? 1 : 0, 0x491);
return true;
}
return false;
}

bool Boiler::set_pvCooling(const char * value, const int8_t id) {
bool v;
if (Helpers::value2bool(value, v)) {
write_command(0x485, 21, v ? 1 : 0, 0x485);
return true;
}
return false;
}

bool Boiler::set_hpHyst(const char * value, const int8_t id) {
int v;
if (Helpers::value2number(value, v)) {
Expand Down
9 changes: 9 additions & 0 deletions src/devices/boiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@ class Boiler : public EMSdevice {
uint8_t maxHeatHeat_;
uint8_t maxHeatDhw_;

uint8_t pvCooling_;
uint8_t manDefrost_;
uint8_t auxHeatMode_;
uint8_t auxMaxTemp_;
uint8_t auxHeaterOnly_;
uint8_t auxHeaterOff_;
uint8_t auxHeaterStatus_;
Expand Down Expand Up @@ -274,6 +278,7 @@ class Boiler : public EMSdevice {
void process_HpPool(std::shared_ptr<const Telegram> telegram);
void process_HpInput(std::shared_ptr<const Telegram> telegram);
void process_HpInConfig(std::shared_ptr<const Telegram> telegram);
void process_HpCooling(std::shared_ptr<const Telegram> telegram);
void process_HpHeaterConfig(std::shared_ptr<const Telegram> telegram);
void process_HybridHp(std::shared_ptr<const Telegram> telegram);
void process_HpSilentMode(std::shared_ptr<const Telegram> telegram);
Expand Down Expand Up @@ -356,6 +361,10 @@ class Boiler : public EMSdevice {
bool set_additionalHeater(const char * value, const int8_t id);
bool set_additionalHeaterDelay(const char * value, const int8_t id);
bool set_tempParMode(const char * value, const int8_t id);
bool set_auxHeatMode(const char * value, const int8_t id);
bool set_auxMaxTemp(const char * value, const int8_t id);
bool set_manDefrost(const char * value, const int8_t id);
bool set_pvCooling(const char * value, const int8_t id);

bool set_hpHyst(const char * value, const int8_t id);
inline bool set_hpHystHeat(const char * value, const int8_t id) {
Expand Down
41 changes: 41 additions & 0 deletions src/devices/thermostat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ Thermostat::Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_i
register_telegram_type(0x267, "RC300Floordry", false, MAKE_PF_CB(process_RC300Floordry));
register_telegram_type(0x240, "RC300Settings", true, MAKE_PF_CB(process_RC300Settings));
register_telegram_type(0xBB, "HybridSettings", true, MAKE_PF_CB(process_HybridSettings));
register_telegram_type(0x23E, "PVSettings", true, MAKE_PF_CB(process_PVSettings));

// JUNKERS/HT3
} else if (model == EMSdevice::EMS_DEVICE_FLAG_JUNKERS) {
Expand Down Expand Up @@ -883,6 +884,12 @@ void Thermostat::process_HybridSettings(std::shared_ptr<const Telegram> telegram
has_update(telegram, tempDiffBoiler_, 19); // relative degrees
}

// 0x23E PV settings
void Thermostat::process_PVSettings(std::shared_ptr<const Telegram> telegram) {
has_update(telegram, pvRaiseHeat_, 0);
has_update(telegram, pvLowerCool_, 5);
}

void Thermostat::process_JunkersSetMixer(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
if (hc == nullptr) {
Expand Down Expand Up @@ -1503,6 +1510,24 @@ bool Thermostat::set_tempDiffBoiler(const char * value, const int8_t id) {
return true;
}

bool Thermostat::set_pvRaiseHeat(const char * value, const int8_t id) {
int v;
if (Helpers::value2temperature(value, v, true)) {
write_command(0x23E, 0, v, 0x23E);
return true;
}
return false;
}

bool Thermostat::set_pvLowerCool(const char * value, const int8_t id) {
int v;
if (Helpers::value2temperature(value, v, true)) {
write_command(0x23E, 5, v, 0x23E);
return true;
}
return false;
}

// 0xA5 - Set minimum external temperature
bool Thermostat::set_minexttemp(const char * value, const int8_t id) {
int mt;
Expand Down Expand Up @@ -3536,6 +3561,22 @@ void Thermostat::register_device_values() {
MAKE_CF_CB(set_tempDiffBoiler),
1,
99);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&pvRaiseHeat_,
DeviceValueType::INT,
FL_(pvRaiseHeat),
DeviceValueUOM::DEGREES_R,
MAKE_CF_CB(set_pvRaiseHeat),
0,
5);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&pvLowerCool_,
DeviceValueType::INT,
FL_(pvLowerCool),
DeviceValueUOM::DEGREES_R,
MAKE_CF_CB(set_pvLowerCool),
-5,
0);
break;
case EMS_DEVICE_FLAG_RC10:
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
Expand Down
9 changes: 9 additions & 0 deletions src/devices/thermostat.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ class Thermostat : public EMSdevice {
uint8_t delayBoiler_; // minutes
uint8_t tempDiffBoiler_; // relative temperature degrees

// PV
uint8_t pvRaiseHeat_;
uint8_t pvLowerCool_;

std::vector<std::shared_ptr<HeatingCircuit>> heating_circuits_; // each thermostat can have multiple heating circuits

// Generic Types
Expand Down Expand Up @@ -379,6 +383,7 @@ class Thermostat : public EMSdevice {
void process_EasyMonitor(std::shared_ptr<const Telegram> telegram);
void process_JunkersRemoteMonitor(std::shared_ptr<const Telegram> telegram);
void process_HybridSettings(std::shared_ptr<const Telegram> telegram);
void process_PVSettings(std::shared_ptr<const Telegram> telegram);
void process_JunkersSetMixer(std::shared_ptr<const Telegram> telegram);
void process_JunkersWW(std::shared_ptr<const Telegram> telegram);
void process_RemoteTemp(std::shared_ptr<const Telegram> telegram);
Expand Down Expand Up @@ -491,6 +496,10 @@ class Thermostat : public EMSdevice {
bool set_delayBoiler(const char * value, const int8_t id);
bool set_tempDiffBoiler(const char * value, const int8_t id);
bool set_roomsensor(const char * value, const int8_t id);

bool set_pvRaiseHeat(const char * value, const int8_t id);
bool set_pvLowerCool(const char * value, const int8_t id);

};

} // namespace emsesp
Expand Down
8 changes: 8 additions & 0 deletions src/locale_translations.h
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,12 @@ MAKE_PSTR_LIST(wwComfOffTemp, "wwcomfoff", "comfort switch off", "Komfort Aussch
MAKE_PSTR_LIST(wwEcoOffTemp, "wwecooff", "eco switch off", "ECO Ausschalttemp", "Eco Uitschakeltemp.", "Ekoläge avstängningstemp.", "temperatura wyłączania w trybie eko", "", "Eco Temp. d'arrêt")
MAKE_PSTR_LIST(wwEcoPlusOffTemp, "wwecoplusoff", "eco+ switch off", "ECO+ Ausschalttemp", "Eco+ Uitschakeltemp.", "Eko+ avstängningstemp.", "temperatura wyłączania w trybie eko+", "", "Eco+ Temp. d'arrêt")

MAKE_PSTR_LIST(auxHeatMode, "auxheatrmode", "aux heater mode", "Modus Zusatzheizer", "", "", "", "", "")
MAKE_PSTR_LIST(auxMaxTemp, "auxmaxtemp", "aux heater max temperature", "Zusatzheizer Maximaltemp.", "", "", "", "", "")
MAKE_PSTR_LIST(manDefrost, "mandefrost", "manual defrost", "Manuelle Enteisung", "", "", "", "", "")
MAKE_PSTR_LIST(pvCooling, "pvcooling", "Cooling only with PV", "Kühlen nur mit PV", "", "", "", "", "")


// hybrid heatpump
MAKE_PSTR_LIST(hybridStrategy, "hybridstrategy", "hybrid control strategy", "Hybrid Strategie", "Hybride strategie", "Hybrid kontrollstrategi", "strategia sterowania hybrydowego", "hybrid kontrollstrategi", "stratégie contrôle hybride")
MAKE_PSTR_LIST(switchOverTemp, "switchovertemp", "outside switchover temperature", "Außentemperatur für Umschaltung", "Schakeltemperatuur buitentemperatuur", "Utomhus Omställningstemperatur", "zewnętrzna temperatura przełączania", "utendørstemp styring", "basculement par température extérieure")
Expand Down Expand Up @@ -509,6 +515,8 @@ MAKE_PSTR_LIST(autodst, "autodst", "automatic change daylight saving time", "aut
MAKE_PSTR_LIST(preheating, "preheating", "preheating in the clock program", "Vorheizen im Zeitprogramm", "Voorverwarming in het klokprogramma", "Förvärmning i tidsprogram", "podgrzewanie w programie czasowym", "forvarming i tidsprogram", "préchauffage dans programme horloge")
MAKE_PSTR_LIST(offtemp, "offtemp", "temperature when mode is off", "Temperatur bei AUS", "Temperatuur bij UIT", "Temperatur Avslagen", "temperatura w trybie \"wył.\"", "temperatur avslått", "température lorsque mode désactivé")
MAKE_PSTR_LIST(mixingvalves, "mixingvalves", "mixing valves", "Mischventile", "Mengkleppen", "Blandningsventiler", "zawory mieszające", "blandeventiler", "vannes mélange")
MAKE_PSTR_LIST(pvRaiseHeat, "pvraiseheat", "raise heating with PV", "Heizanghebung mit PV", "", "", "", "", "")
MAKE_PSTR_LIST(pvLowerCool, "pvlowercool", "lower cooling with PV", "Kühlabsenkung mit PV", "", "", "", "", "")

// thermostat ww
MAKE_PSTR_LIST(wwMode, "wwmode", "mode", "Modus", "Modus", "Läge", "tryb pracy", "modus", "mode")
Expand Down

0 comments on commit 49113ed

Please sign in to comment.