Skip to content

Commit

Permalink
add HIU entities emsesp#1334, fix hp nrgheat/ww offsets emsesp#1349
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDvP committed Oct 29, 2023
1 parent 2bac805 commit ea7e16a
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 24 deletions.
65 changes: 45 additions & 20 deletions src/devices/boiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,26 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
register_telegram_type(0x772, "HIUSettings", false, MAKE_PF_CB(process_HIUSettings));
register_telegram_type(0x779, "HIUMonitor", false, MAKE_PF_CB(process_HIUMonitor));

register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&netFlowTemp_,
DeviceValueType::USHORT,
DeviceValueNumOp::DV_NUMOP_DIV10,
FL_(netFlowTemp),
DeviceValueUOM::DEGREES);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&retTemp_,
DeviceValueType::USHORT,
DeviceValueNumOp::DV_NUMOP_DIV10,
FL_(retTemp),
DeviceValueUOM::DEGREES);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &heatValve_, DeviceValueType::UINT, FL_(heatValve), DeviceValueUOM::PERCENT);
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW, &wwValve_, DeviceValueType::UINT, FL_(wwValve), DeviceValueUOM::PERCENT);
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW,
&wwCurFlow_,
DeviceValueType::UINT,
DeviceValueNumOp::DV_NUMOP_DIV10,
FL_(wwCurFlow),
DeviceValueUOM::LMIN);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&keepWarmTemp_,
DeviceValueType::UINT,
Expand All @@ -104,18 +124,6 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
FL_(setReturnTemp),
DeviceValueUOM::DEGREES,
MAKE_CF_CB(set_returnTemp));
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&cwFlowRate_,
DeviceValueType::USHORT,
DeviceValueNumOp::DV_NUMOP_DIV10,
FL_(cwFlowRate),
DeviceValueUOM::LMIN);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&netFlowTemp_,
DeviceValueType::USHORT,
DeviceValueNumOp::DV_NUMOP_DIV10,
FL_(netFlowTemp),
DeviceValueUOM::DEGREES);
}

/*
Expand Down Expand Up @@ -215,7 +223,6 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
MAKE_CF_CB(set_burn_period),
0,
120);

register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&burnMinPower_,
DeviceValueType::UINT,
Expand Down Expand Up @@ -282,10 +289,6 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
MAKE_CF_CB(set_emergency_temp),
15,
70);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &nrgTotal_, DeviceValueType::ULONG, DeviceValueNumOp::DV_NUMOP_DIV100, FL_(nrgTotal), DeviceValueUOM::KWH);
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW, &nrgWw_, DeviceValueType::ULONG, DeviceValueNumOp::DV_NUMOP_DIV100, FL_(nrgWw), DeviceValueUOM::KWH);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &nrgHeat_, DeviceValueType::ULONG, DeviceValueNumOp::DV_NUMOP_DIV100, FL_(nrgHeat), DeviceValueUOM::KWH);

/*
* Hybrid heatpump with telegram 0xBB is readable and writeable in boiler and thermostat
* thermostat always overwrites settings in boiler
Expand Down Expand Up @@ -359,6 +362,19 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const

// heatpump info
if (model() == EMS_DEVICE_FLAG_HEATPUMP) {
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&nrgTotal_,
DeviceValueType::ULONG,
DeviceValueNumOp::DV_NUMOP_DIV100,
FL_(nrgTotal),
DeviceValueUOM::KWH);
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW, &nrgWw_, DeviceValueType::ULONG, DeviceValueNumOp::DV_NUMOP_DIV100, FL_(nrgWw), DeviceValueUOM::KWH);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&nrgHeat_,
DeviceValueType::ULONG,
DeviceValueNumOp::DV_NUMOP_DIV100,
FL_(nrgHeat),
DeviceValueUOM::KWH);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&meterTotal_,
DeviceValueType::ULONG,
Expand Down Expand Up @@ -911,6 +927,12 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
if (model() != EMS_DEVICE_FLAG_HEATPUMP) {
register_telegram_type(0x04, "UBAFactory", true, MAKE_PF_CB(process_UBAFactory));
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &nomPower_, DeviceValueType::UINT, FL_(nomPower), DeviceValueUOM::KW, MAKE_CF_CB(set_nomPower));
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&nrgTotal_,
DeviceValueType::ULONG,
DeviceValueNumOp::DV_NUMOP_DIV100,
FL_(nrgTotal),
DeviceValueUOM::KWH);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&nrgHeat_,
DeviceValueType::ULONG,
Expand Down Expand Up @@ -1808,8 +1830,8 @@ void Boiler::process_HpSettings3(std::shared_ptr<const Telegram> telegram) {
// boiler(0x08) -W-> Me(0x0B), ?(0x04AE), data: 00 00 00 00 00 00 00 00 (offset 24)
void Boiler::process_HpEnergy(std::shared_ptr<const Telegram> telegram) {
has_update(telegram, nrgTotal_, 0);
has_update(telegram, nrgWw_, 4);
has_update(telegram, nrgHeat_, 12);
has_update(telegram, nrgHeat_, 4);
has_update(telegram, nrgWw_, 12);
}

// boiler(0x08) -W-> Me(0x0B), ?(0x04AF), data: 00 00 48 B2 00 00 48 55 00 00 00 5D 00 00 01 78 00 00 00 00 00 00 07 61
Expand All @@ -1825,8 +1847,11 @@ void Boiler::process_HpMeters(std::shared_ptr<const Telegram> telegram) {

// boiler(0x08) -B-> All(0x00), ?(0x0779), data: 06 05 01 01 AD 02 EF FF FF 00 00 7F FF
void Boiler::process_HIUMonitor(std::shared_ptr<const Telegram> telegram) {
has_update(telegram, retTemp_, 3); // is * 10
has_update(telegram, netFlowTemp_, 5); // is * 10
has_update(telegram, cwFlowRate_, 9); // is * 10
has_update(telegram, heatValve_, 7); // is %
has_update(telegram, wwValve_, 8); // is %
has_update(telegram, wwCurFlow_, 10); // is * 10 (for HIU 16 bit at offset 9, use 8 bit for compatibility to other boilers)
}

// Boiler(0x08) -W-> ME(0x0x), ?(0x0772), data: 00 00 00 00 00
Expand Down
6 changes: 4 additions & 2 deletions src/devices/boiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class Boiler : public EMSdevice {
uint8_t wwCirc_; // DHW circulation on/off
uint16_t wwCurTemp_; // DHW current temperature
uint16_t wwCurTemp2_; // DHW current temperature storage
uint8_t wwCurFlow_; // DHW current flow temp in l/min
uint8_t wwCurFlow_; // DHW current flow in l/min
uint16_t wwStorageTemp1_; // DHW storage temp 1
uint16_t wwStorageTemp2_; // DHW storage temp 2
uint8_t wwActivated_; // DHW activated
Expand Down Expand Up @@ -267,10 +267,12 @@ class Boiler : public EMSdevice {
uint8_t elHeatStep3_;

// HIU
uint16_t cwFlowRate_; // cold water flow rate *10
// uint16_t cwFlowRate_; // cold water flow rate *10
uint16_t netFlowTemp_; // heat network flow temperature *10
uint8_t keepWarmTemp_;
uint8_t setReturnTemp_;
uint8_t heatValve_;
uint8_t wwValve_;

// special
double nrgHeatF_; // double calcutate for nrgHeat
Expand Down
2 changes: 1 addition & 1 deletion src/devices/mixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Mixer::Mixer(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
if (flags == EMSdevice::EMS_DEVICE_FLAG_MMPLUS) {
if (device_id >= 0x20 && device_id <= 0x27) {
register_telegram_type(device_id - 0x20 + 0x02D7, "MMPLUSStatusMessage_HC", false, MAKE_PF_CB(process_MMPLUSStatusMessage_HC));
// register_telegram_type(device_id - 0x20 + 0x02E1, "MMPLUSStetMessage_HC", true, MAKE_PF_CB(process_MMPLUSSetMessage_HC));
// register_telegram_type(device_id - 0x20 + 0x02E1, "MMPLUSSetMessage_HC", true, MAKE_PF_CB(process_MMPLUSSetMessage_HC));
type_ = Type::HC;
hc_ = device_id - 0x20 + 1;
uint8_t tag = DeviceValueTAG::TAG_HC1 + hc_ - 1;
Expand Down
4 changes: 3 additions & 1 deletion src/locale_translations.h
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,10 @@ MAKE_TRANSLATION(meterEHeat, "metereheat", "meter e-heater", "Messung E-Heizer",

// HIU
MAKE_TRANSLATION(netFlowTemp, "netflowtemp", "heat network flow temp", "System Vorlauftemperatur", "Netto aanvoertemperatuur", "", "", "", "", "ısıtma şebekesi akış derecesi", "temperatura di mandata della rete di riscaldamento") // TODO translate
MAKE_TRANSLATION(cwFlowRate, "cwflowrate", "cold water flow rate", "Kaltwasser Durchfluss", "Stroomsnelheid koud water ", "", "", "", "", "soğuk su akış hızı", "portata acqua fredda") // TODO translate
// MAKE_TRANSLATION(cwFlowRate, "cwflowrate", "cold water flow rate", "Kaltwasser Durchfluss", "Stroomsnelheid koud water ", "", "", "", "", "soğuk su akış hızı", "portata acqua fredda") // TODO translate
MAKE_TRANSLATION(keepWarmTemp, "keepwarmtemp", "keep warm temperature","Warmhaltetemperatur", "Warmhoudtemperatuur", "", "", "", "", "sıcaklığı koruma derecesi", "mantenere la temperatura calda") // TODO translate
MAKE_TRANSLATION(heatValve, "heatvalve", "heating valve", "Ventil Heizen", "", "", "", "", "", "", "") // TODO translate
MAKE_TRANSLATION(wwValve, "wwvalve", "valve", "Ventil", "", "", "", "", "", "", "") // TODO translate

// the following are dhw for the boiler and automatically tagged with 'dhw'
MAKE_TRANSLATION(wwSelTemp, "wwseltemp", "selected temperature", "gewählte Temperatur", "Geselecteerd temperatuur", "Vald Temperatur", "temperatura wyższa/komfort", "valgt temperatur", "température sélectionnée", "seçili sıcaklık", "temperatura selezionata")
Expand Down

0 comments on commit ea7e16a

Please sign in to comment.