Skip to content

Commit

Permalink
add heatpump current power and power limit
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDvP committed Aug 29, 2024
1 parent 6122bc6 commit 28fb6c0
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 3 deletions.
43 changes: 40 additions & 3 deletions src/devices/boiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
register_telegram_type(0x4AF, "HPMeters", true, MAKE_PF_CB(process_HpMeters));
register_telegram_type(0x2CC, "HPPressure", true, MAKE_PF_CB(process_HpPressure));
register_telegram_type(0x4A5, "HPFan", true, MAKE_PF_CB(process_HpFan));
register_telegram_type(0x4AA, "HPPower2", true, MAKE_PF_CB(process_HpPower2));
register_telegram_type(0x4A7, "HPPowerLimit", true, MAKE_PF_CB(process_HpPowerLimit));
}

// some gas boilers, see #1701
Expand Down Expand Up @@ -827,6 +829,14 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
FL_(hpShutdown),
DeviceValueUOM::NONE,
MAKE_CF_CB(set_shutdown));
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpCurrPower_, DeviceValueType::UINT16, FL_(hpCurrPower), DeviceValueUOM::W);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&hpPowerLimit_,
DeviceValueType::UINT16,
FL_(hpPowerLimit),
DeviceValueUOM::W,
MAKE_CF_CB(set_hpPowerLimit));

// heatpump DHW settings
register_device_value(DeviceValueTAG::TAG_DHW1,
&wwAlternatingOper_,
Expand Down Expand Up @@ -2006,6 +2016,16 @@ void Boiler::process_HpFan(std::shared_ptr<const Telegram> telegram) {
has_update(telegram, fan_, 9);
}

// 0x4AA
void Boiler::process_HpPower2(std::shared_ptr<const Telegram> telegram) {
has_update(telegram, hpCurrPower_, 0);
}

// 0x4A7
void Boiler::process_HpPowerLimit(std::shared_ptr<const Telegram> telegram) {
has_update(telegram, hpPowerLimit_, 0);
}

// Boiler(0x08) -B-> All(0x00), ?(0x2E), data: 00 00 1C CE 00 00 05 E8 00 00 00 18 00 00 00 02
void Boiler::process_Meters(std::shared_ptr<const Telegram> telegram) {
has_update(telegram, gasMeterHeat_, 0);
Expand Down Expand Up @@ -2439,9 +2459,16 @@ bool Boiler::set_max_pump(const char * value, const int8_t id) {

bool Boiler::set_pumpMode(const char * value, const int8_t id) {
uint8_t v;
if (Helpers::value2enum(value, v, FL_(enum_pumpMode))) {
write_command(EMS_TYPE_UBAParameters, 11, v, EMS_TYPE_UBAParameters);
return true;
if (is_received(EMS_TYPE_UBAParametersPlus)) {
if (Helpers::value2enum(value, v, FL_(enum_pumpCharacter))) {
write_command(EMS_TYPE_UBAParametersPlus, 15, v, EMS_TYPE_UBAParametersPlus);
return true;
}
} else {
if (Helpers::value2enum(value, v, FL_(enum_pumpMode))) {
write_command(EMS_TYPE_UBAParameters, 11, v, EMS_TYPE_UBAParameters);
return true;
}
}
return false;
}
Expand Down Expand Up @@ -3072,6 +3099,16 @@ bool Boiler::set_hpDiffPress(const char * value, const int8_t id) {
return false;
}

bool Boiler::set_hpPowerLimit(const char * value, const int8_t id) {
int v;
if (Helpers::value2number(value, v)) {
uint8_t data[2] = {v >> 8, v & 0xFF};
write_command(0x4A7, 0, data, 2, 0x4A7);
return true;
}
return false;
}

bool Boiler::set_vp_cooling(const char * value, const int8_t id) {
bool v;
if (Helpers::value2bool(value, v)) {
Expand Down
5 changes: 5 additions & 0 deletions src/devices/boiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ class Boiler : public EMSdevice {
uint8_t elHeatStep1_;
uint8_t elHeatStep2_;
uint8_t elHeatStep3_;
uint16_t hpPowerLimit_;
uint16_t hpCurrPower_;

// HIU
// uint16_t cwFlowRate_; // cold water flow rate *10
Expand Down Expand Up @@ -371,6 +373,8 @@ class Boiler : public EMSdevice {
void process_HpMeters(std::shared_ptr<const Telegram> telegram);
void process_WeatherComp(std::shared_ptr<const Telegram> telegram);
void process_HpFan(std::shared_ptr<const Telegram> telegram);
void process_HpPower2(std::shared_ptr<const Telegram> telegram);
void process_HpPowerLimit(std::shared_ptr<const Telegram> telegram);

void process_Meters(std::shared_ptr<const Telegram> telegram);
void process_Energy(std::shared_ptr<const Telegram> telegram);
Expand Down Expand Up @@ -468,6 +472,7 @@ class Boiler : public EMSdevice {
bool set_hpPumpMode(const char * value, const int8_t id);
bool set_hpMaxPower(const char * value, const int8_t id);
bool set_hpDiffPress(const char * value, const int8_t id);
bool set_hpPowerLimit(const char * value, const int8_t id);

bool set_auxLimit(const char * value, const int8_t id);
inline bool set_auxMaxLimit(const char * value, const int8_t id) {
Expand Down
2 changes: 2 additions & 0 deletions src/locale_translations.h
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,8 @@ MAKE_TRANSLATION(meterCool, "metercool", "meter cooling", "Messung Kühlen", "",
MAKE_TRANSLATION(meterWw, "meter", "meter", "Messung", "", "", "licznik", "", "", "", "", "") // TODO translate
MAKE_TRANSLATION(gasMeterHeat, "gasmeterheat", "gas meter heating", "Gas Messung Heizen", "", "", "licznik gazu na ogrzewanie", "", "", "", "", "") // TODO translate
MAKE_TRANSLATION(gasMeterWw, "gasmeter", "gas meter", "Gas Messung", "", "", "licznik gazu", "", "", "", "", "") // TODO translate
MAKE_TRANSLATION(hpCurrPower, "hpcurrpower", "compressor current power", "akt. Kompressorleistung", "", "", "", "", "", "", "", "") // TODO translate
MAKE_TRANSLATION(hpPowerLimit, "hppowerlimit", "power limit", "Leistungsgrenze", "", "", "", "", "", "", "", "") // TODO translate

// HIU
MAKE_TRANSLATION(netFlowTemp, "netflowtemp", "heat network flow temp", "System Vorlauftemperatur", "Netto aanvoertemperatuur", "", "temp. zasilania sieci cieplnej", "", "", "ısıtma şebekesi akış derecesi", "temperatura di mandata della rete di riscaldamento", "teplota prívodu tepelnej siete") // TODO translate
Expand Down

0 comments on commit 28fb6c0

Please sign in to comment.