Skip to content

Commit

Permalink
add start counters emsesp#2220
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDvP committed Nov 19, 2024
1 parent d06ea95 commit e3354b2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/devices/heatpump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Heatpump::Heatpump(uint8_t device_type, uint8_t device_id, uint8_t product_id, c
register_telegram_type(0x99C, "HPComp", false, MAKE_PF_CB(process_HPComp));
register_telegram_type(0x4AE, "HPEnergy", true, MAKE_PF_CB(process_HpEnergy));
register_telegram_type(0x4AF, "HPMeters", true, MAKE_PF_CB(process_HpMeters));
register_telegram_type(0x99A, "HPStarts", false, MAKE_PF_CB(process_HpStarts));

// device values
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &airHumidity_, DeviceValueType::UINT8, FL_(airHumidity), DeviceValueUOM::PERCENT);
Expand Down Expand Up @@ -177,6 +178,8 @@ Heatpump::Heatpump(uint8_t device_type, uint8_t device_id, uint8_t product_id, c
FL_(meterHeat),
DeviceValueUOM::KWH);
register_device_value(DeviceValueTAG::TAG_DHW1, &meterWw_, DeviceValueType::UINT24, DeviceValueNumOp::DV_NUMOP_DIV100, FL_(meterWw), DeviceValueUOM::KWH);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &heatStartsHp_, DeviceValueType::UINT24, FL_(heatingStarts), DeviceValueUOM::NONE);
register_device_value(DeviceValueTAG::TAG_DHW1, &wwStartsHp_, DeviceValueType::UINT24, FL_(wwStartsHp), DeviceValueUOM::NONE);
}

/*
Expand Down Expand Up @@ -271,6 +274,12 @@ void Heatpump::process_HpMeters(std::shared_ptr<const Telegram> telegram) {
has_update(telegram, meterWw_, 32);
}

// Broadcast (0x099A), data: 05 00 00 00 00 00 00 37 00 00 1D 00 00 52 00 00 13 01 00 01 7C
void Heatpump::process_HpStarts(std::shared_ptr<const Telegram> telegram) {
has_update(telegram, heatStartsHp_, 14, 3);
has_update(telegram, wwStartsHp_, 11,3 );
}

/*
* Broadcast (0x099A), data: 05 00 00 00 00 00 00 37 00 00 1D 00 00 52 00 00 13 01 00 01 7C
* Broadcast (0x099B), data: 80 00 80 00 01 3C 01 38 80 00 80 00 80 00 01 37 00 00 00 00 64
Expand Down
3 changes: 3 additions & 0 deletions src/devices/heatpump.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ class Heatpump : public EMSdevice {
uint32_t meterHeat_;
uint32_t meterWw_;

uint32_t heatStartsHp_;
uint32_t wwStartsHp_;

void process_HPMonitor1(std::shared_ptr<const Telegram> telegram);
void process_HPMonitor2(std::shared_ptr<const Telegram> telegram);
Expand All @@ -86,6 +88,7 @@ class Heatpump : public EMSdevice {
void process_HPComp(std::shared_ptr<const Telegram> telegram);
void process_HpEnergy(std::shared_ptr<const Telegram> telegram);
void process_HpMeters(std::shared_ptr<const Telegram> telegram);
void process_HpStarts(std::shared_ptr<const Telegram> telegram);

bool set_controlStrategy(const char * value, const int8_t id);
bool set_lowNoiseMode(const char * value, const int8_t id);
Expand Down

0 comments on commit e3354b2

Please sign in to comment.