diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index 7ab38df00..a0ec1bd2d 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -399,6 +399,12 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const DeviceValueNumOp::DV_NUMOP_DIV100, FL_(meterEHeat), DeviceValueUOM::KWH); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, + &meterHeat_, + DeviceValueType::ULONG, + DeviceValueNumOp::DV_NUMOP_DIV100, + FL_(meterHeat), + DeviceValueUOM::KWH); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &upTimeTotal_, DeviceValueType::TIME, @@ -720,6 +726,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const DeviceValueUOM::NONE, MAKE_CF_CB(set_elHeatStep3)); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpEA0_, DeviceValueType::BOOL, FL_(hpEA0), DeviceValueUOM::NONE); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpPumpMode_, DeviceValueType::ENUM, FL_(enum_hpPumpMode), FL_(hpPumpMode), DeviceValueUOM::NONE, MAKE_CF_CB(set_hpPumpMode)); // heatpump DHW settings register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW, &wwAlternatingOper_, @@ -1065,7 +1072,7 @@ void Boiler::check_active() { } // calculate energy for boiler 0x08 from stored modulation an time in units of 0.01 Wh - if (model() != EMS_DEVICE_FLAG_HEATPUMP) { + if (model() != EMSdevice::EMS_DEVICE_FLAG_HEATPUMP && model() != EMSdevice::EMS_DEVICE_FLAG_HIU) { // remember values from last call static uint32_t powLastReadTime_ = uuid::get_uptime(); static uint8_t heatBurnPow = 0; @@ -1308,10 +1315,10 @@ void Boiler::process_UBAMonitorFastPlus(std::shared_ptr telegram // at this point do a quick check to see if the hot water or heating is active uint8_t state = EMS_VALUE_UINT_NOTSET; - if (telegram->read_value(state, 11)) { - boilerState_ = state & 0x01 ? 0x08 : 0; - boilerState_ |= state & 0x02 ? 0x01 : 0; - boilerState_ |= state & 0x04 ? 0x02 : 0; + if (telegram->read_value(state, 11) && model() != EMSdevice::EMS_DEVICE_FLAG_HIU) { + boilerState_ = state & 0x01 ? 0x08 : 0; // burnGas + boilerState_ |= state & 0x02 ? 0x01 : 0; // heatingPump + boilerState_ |= state & 0x04 ? 0x02 : 0; // 3-way-valve } if (telegram->offset <= 10 && telegram->offset + telegram->message_length > 11) { @@ -1347,6 +1354,17 @@ void Boiler::process_UBAMonitorSlow(std::shared_ptr telegram) { */ void Boiler::process_UBAMonitorSlowPlus2(std::shared_ptr telegram) { has_update(telegram, absBurnPow_, 13); // current burner absolute power (percent of rating plate power) + if (model() == EMSdevice::EMS_DEVICE_FLAG_HIU) { + uint8_t state = EMS_VALUE_UINT_NOTSET; + boilerState_ = 0; + if (telegram->read_value(state, 2)) { + boilerState_ |= state == 1 ? 0x09 : 0; // heating 0/1 + } + state = EMS_VALUE_UINT_NOTSET; + if (telegram->read_value(state, 5)) { + boilerState_ |= state == 1 ? 0x0A : 0; // dhw 0/1 + } + } } /* @@ -1815,6 +1833,7 @@ void Boiler::process_HpValve(std::shared_ptr telegram) { void Boiler::process_HpPumps(std::shared_ptr telegram) { has_update(telegram, tempDiffHeat_, 4); // is * 10 has_update(telegram, tempDiffCool_, 3); // is * 10 + has_update(telegram, hpPumpMode_, 18); } // 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 @@ -1871,6 +1890,7 @@ void Boiler::process_HpMeters(std::shared_ptr telegram) { has_update(telegram, meterTotal_, 0); has_update(telegram, meterComp_, 4); has_update(telegram, meterEHeat_, 8); + has_update(telegram, meterHeat_, 24); } // HIU unit @@ -2854,6 +2874,15 @@ bool Boiler::set_hpCircPumpWw(const char * value, const int8_t id) { return false; } +bool Boiler::set_hpPumpMode(const char * value, const int8_t id) { + uint8_t v; + if (Helpers::value2enum(value, v, FL_(enum_hpPumpMode))) { + write_command(0x48B, 18, v, 0x48B); + return true; + } + return false; +} + bool Boiler::set_vp_cooling(const char * value, const int8_t id) { bool v; if (Helpers::value2bool(value, v)) { diff --git a/src/devices/boiler.h b/src/devices/boiler.h index c4bca7a04..af870c59b 100644 --- a/src/devices/boiler.h +++ b/src/devices/boiler.h @@ -219,7 +219,9 @@ class Boiler : public EMSdevice { uint32_t meterTotal_; uint32_t meterComp_; uint32_t meterEHeat_; + uint32_t meterHeat_; uint8_t hpEA0_; + uint8_t hpPumpMode_; // Pool unit int8_t poolSetTemp_; @@ -431,6 +433,7 @@ class Boiler : public EMSdevice { bool set_manDefrost(const char * value, const int8_t id); bool set_pvCooling(const char * value, const int8_t id); bool set_hpCircPumpWw(const char * value, const int8_t id); + bool set_hpPumpMode(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) {