diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index 229cc4451..2d1344466 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -2,6 +2,7 @@ ### Added - function keys in editor: cursor, del, pos1, end. F1=help, F2=show, F10=report +- add sm100 pump working time and energy units ### Fixed - mixer IPM pumpstatus diff --git a/src/devices/solar.cpp b/src/devices/solar.cpp index 0dd816302..132fc4a33 100644 --- a/src/devices/solar.cpp +++ b/src/devices/solar.cpp @@ -45,6 +45,7 @@ Solar::Solar(uint8_t device_type, uint8_t device_id, uint8_t product_id, const s register_telegram_type(0x0364, F("SM100Status"), false, [&](std::shared_ptr t) { process_SM100Status(t); }); register_telegram_type(0x036A, F("SM100Status2"), false, [&](std::shared_ptr t) { process_SM100Status2(t); }); register_telegram_type(0x038E, F("SM100Energy"), true, [&](std::shared_ptr t) { process_SM100Energy(t); }); + register_telegram_type(0x0391, F("SM100Time"), true, [&](std::shared_ptr t) { process_SM100Time(t); }); } } @@ -175,9 +176,9 @@ void Solar::register_mqtt_ha_config(bool force) { Mqtt::register_mqtt_ha_sensor(nullptr, nullptr, F_(solarPumpModulation), this->device_type(), "solarPumpModulation", F_(percent), nullptr); Mqtt::register_mqtt_ha_sensor(nullptr, nullptr, F_(cylinderPumpModulation), this->device_type(), "cylinderPumpModulation", F_(percent), nullptr); Mqtt::register_mqtt_ha_sensor(nullptr, nullptr, F_(pumpWorkMin), this->device_type(), "pumpWorkMin", nullptr, nullptr); - Mqtt::register_mqtt_ha_sensor(nullptr, nullptr, F_(energyLastHour), this->device_type(), "energyLastHour", nullptr, nullptr); - Mqtt::register_mqtt_ha_sensor(nullptr, nullptr, F_(energyToday), this->device_type(), "energyToday", nullptr, nullptr); - Mqtt::register_mqtt_ha_sensor(nullptr, nullptr, F_(energyTotal), this->device_type(), "energyTotal", nullptr, nullptr); + Mqtt::register_mqtt_ha_sensor(nullptr, nullptr, F_(energyLastHour), this->device_type(), "energyLastHour", F_(wh), nullptr); + Mqtt::register_mqtt_ha_sensor(nullptr, nullptr, F_(energyToday), this->device_type(), "energyToday", F_(wh), nullptr); + Mqtt::register_mqtt_ha_sensor(nullptr, nullptr, F_(energyTotal), this->device_type(), "energyTotal", F_(kwh), nullptr); Mqtt::register_mqtt_ha_sensor(nullptr, nullptr, F_(solarPump), this->device_type(), "solarPump", nullptr, nullptr); Mqtt::register_mqtt_ha_sensor(nullptr, nullptr, F_(valveStatus), this->device_type(), "valveStatus", nullptr, nullptr); Mqtt::register_mqtt_ha_sensor(nullptr, nullptr, F_(tankHeated), this->device_type(), "tankHeated", nullptr, nullptr); @@ -370,6 +371,13 @@ void Solar::process_SM100Energy(std::shared_ptr telegram) { changed_ |= telegram->read_value(energyTotal_, 8); // total / 10 in kWh } +/* + * SM100Time - type 0x0391 EMS+ for pump working time + */ +void Solar::process_SM100Time(std::shared_ptr telegram) { + changed_ |= telegram->read_value(pumpWorkMin_, 1, 3); +} + /* * Junkers ISM1 Solar Module - type 0x0103 EMS+ for energy readings * e.g. B0 00 FF 00 00 03 32 00 00 00 00 13 00 D6 00 00 00 FB D0 F0 diff --git a/src/devices/solar.h b/src/devices/solar.h index 526bf885b..dcc649a12 100644 --- a/src/devices/solar.h +++ b/src/devices/solar.h @@ -78,6 +78,7 @@ class Solar : public EMSdevice { void process_SM100Status(std::shared_ptr telegram); void process_SM100Status2(std::shared_ptr telegram); void process_SM100Energy(std::shared_ptr telegram); + void process_SM100Time(std::shared_ptr telegram); void process_SM100wwTemperature(std::shared_ptr telegram); void process_SM100wwStatus(std::shared_ptr telegram);