Skip to content
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.

Commit

Permalink
Boiler-flags, HA config delayed only with values
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDvP committed Apr 15, 2021
1 parent fab0e92 commit 6a4ea8f
Show file tree
Hide file tree
Showing 7 changed files with 306 additions and 123 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG_LATEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

### Added

- differ between boiler-types
- publish HA delayed 1 minute, only for topics with values

### Fixed

### Changed
Expand Down
6 changes: 3 additions & 3 deletions src/device_library.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@

// Boilers - 0x08
{ 64, DeviceType::BOILER, F("BK13/BK15/Smartline/GB1x2"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
{ 72, DeviceType::BOILER, F("GB125/MC10"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
{ 72, DeviceType::BOILER, F("GB125/MC10"), DeviceFlags::EMS_DEVICE_FLAG_EMS},
{ 84, DeviceType::BOILER, F("Logamax Plus GB022"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
{ 95, DeviceType::BOILER, F("Condens 2500/Logamax/Logomatic/Cerapur Top/Greenstar/Generic HT3"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
{ 95, DeviceType::BOILER, F("Condens 2500/Logamax/Logomatic/Cerapur Top/Greenstar/Generic HT3"), DeviceFlags::EMS_DEVICE_FLAG_HT3},
{115, DeviceType::BOILER, F("Topline/GB162"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
{122, DeviceType::BOILER, F("Proline"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
{123, DeviceType::BOILER, F("GBx72/Trendline/Cerapur/Greenstar Si/27i"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
{131, DeviceType::BOILER, F("GB212"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
{133, DeviceType::BOILER, F("GB125/Logamatic MC110"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
{167, DeviceType::BOILER, F("Cerapur Aero"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
{170, DeviceType::BOILER, F("Logano GB212"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
{172, DeviceType::BOILER, F("Enviline/Compress 6000AW/Hybrid 7000iAW"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
{172, DeviceType::BOILER, F("Enviline/Compress 6000AW/Hybrid 7000iAW"), DeviceFlags::EMS_DEVICE_FLAG_HEATPUMP},
{195, DeviceType::BOILER, F("Condens 5000i/Greenstar 8000"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
{203, DeviceType::BOILER, F("Logamax U122/Cerapur"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
{208, DeviceType::BOILER, F("Logamax Plus/GB192/Condens GC9000"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
Expand Down
394 changes: 278 additions & 116 deletions src/devices/boiler.cpp

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion src/devices/boiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ class Boiler : public EMSdevice {
private:
static uuid::log::Logger logger_;

// specific boiler characteristics, stripping the top 4 bits
inline uint8_t model() const {
return (flags() & 0x0F);
}

void register_mqtt_ha_config();
void register_mqtt_ha_config_ww();
void check_active(const bool force = false);
Expand Down Expand Up @@ -128,6 +133,7 @@ class Boiler : public EMSdevice {
uint8_t wWCurFlow_ = EMS_VALUE_UINT_NOTSET; // Warm Water current flow temp in l/min
uint8_t wWType_ = EMS_VALUE_UINT_NOTSET; // 0-off, 1-flow, 2-flowbuffer, 3-buffer, 4-layered buffer
uint8_t wWActive_ = EMS_VALUE_BOOL_NOTSET;
uint8_t wWMaxPower_ = EMS_VALUE_UINT_NOTSET; // Warm Water maximum power

// UBATotalUptime
uint32_t UBAuptime_ = EMS_VALUE_ULONG_NOTSET; // Total UBA working hours
Expand Down Expand Up @@ -201,9 +207,10 @@ class Boiler : public EMSdevice {
void process_UBAMaintenanceStatus(std::shared_ptr<const Telegram> telegram);
void process_UBAMaintenanceData(std::shared_ptr<const Telegram> telegram);
void process_UBAErrorMessage(std::shared_ptr<const Telegram> telegram);
void process_UBADHWStatus(std::shared_ptr<const Telegram> telegram);
void process_UBAMonitorWWPlus(std::shared_ptr<const Telegram> telegram);
void process_UBAInformation(std::shared_ptr<const Telegram> telegram);
void process_UBAEnergySupplied(std::shared_ptr<const Telegram> telegram);
void process_UBASettingsWW(std::shared_ptr<const Telegram> telegram);

// commands - none of these use the additional id parameter
bool set_warmwater_mode(const char * value, const int8_t id);
Expand Down
10 changes: 7 additions & 3 deletions src/devices/thermostat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ bool Thermostat::ha_config(bool force) {
}

// set up the main controller
if (!ha_registered()) {
if (!ha_registered() && uuid::get_uptime_sec() > 60) {
register_mqtt_ha_config();
ha_registered(true);
// return false; // heating circuits in next cycle
Expand Down Expand Up @@ -837,7 +837,9 @@ void Thermostat::register_mqtt_ha_config() {
}

if (model == EMS_DEVICE_FLAG_RC300 || model == EMS_DEVICE_FLAG_RC100) {
Mqtt::register_mqtt_ha_sensor(nullptr, nullptr, F_(dampedoutdoortemp), device_type(), "dampedoutdoortemp", F_(degrees), nullptr);
if (Helpers::hasValue(dampedoutdoortemp2_)) {
Mqtt::register_mqtt_ha_sensor(nullptr, nullptr, F_(dampedoutdoortemp), device_type(), "dampedoutdoortemp", F_(degrees), nullptr);
}
Mqtt::register_mqtt_ha_sensor(nullptr, nullptr, F_(building), device_type(), "building", nullptr, nullptr);
Mqtt::register_mqtt_ha_sensor(nullptr, nullptr, F_(minexttemp), device_type(), "minexttemp", F_(degrees), F_(iconwatertemp));
Mqtt::register_mqtt_ha_sensor(nullptr, nullptr, F_(floordry), device_type(), "floordry", nullptr, nullptr);
Expand All @@ -849,7 +851,9 @@ void Thermostat::register_mqtt_ha_config() {

if (model == EMS_DEVICE_FLAG_RC35 || model == EMS_DEVICE_FLAG_RC30_1) {
// excluding inttemp1, inttemp2, intoffset, minexttemp
Mqtt::register_mqtt_ha_sensor(nullptr, nullptr, F_(dampedoutdoortemp), device_type(), "dampedoutdoortemp", F_(degrees), nullptr);
if (Helpers::hasValue(dampedoutdoortemp_)) {
Mqtt::register_mqtt_ha_sensor(nullptr, nullptr, F_(dampedoutdoortemp), device_type(), "dampedoutdoortemp", F_(degrees), nullptr);
}
Mqtt::register_mqtt_ha_sensor(nullptr, nullptr, F_(building), device_type(), "building", nullptr, nullptr);
Mqtt::register_mqtt_ha_sensor(nullptr, nullptr, F_(minexttemp), device_type(), "minexttemp", F_(degrees), F_(iconwatertemp));
Mqtt::register_mqtt_ha_sensor(nullptr, nullptr, F_(wwmode), device_type(), "wwmode", nullptr, nullptr);
Expand Down
6 changes: 6 additions & 0 deletions src/emsdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ class EMSdevice {
// device flags: The lower 4 bits hold the unique identifier, the upper 4 bits are used for specific flags
static constexpr uint8_t EMS_DEVICE_FLAG_NONE = 0;

// Boiler
static constexpr uint8_t EMS_DEVICE_FLAG_EMS = 1;
static constexpr uint8_t EMS_DEVICE_FLAG_EMSPLUS = 2;
static constexpr uint8_t EMS_DEVICE_FLAG_HT3 = 3;
static constexpr uint8_t EMS_DEVICE_FLAG_HEATPUMP = 4;

// Solar Module
static constexpr uint8_t EMS_DEVICE_FLAG_SM10 = 1;
static constexpr uint8_t EMS_DEVICE_FLAG_SM100 = 2;
Expand Down
1 change: 1 addition & 0 deletions src/locale_EN.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ MAKE_PSTR(burnStarts, "Burner starts")
MAKE_PSTR(burnWorkMin, "Burner active time")
MAKE_PSTR(heatWorkMin, "Heating active time")
MAKE_PSTR(UBAuptime, "Boiler total uptime")
MAKE_PSTR(wWMaxPower, "Warm water max power")

MAKE_PSTR(upTimeControl, "Operating time control")
MAKE_PSTR(upTimeCompHeating, "Operating time compressor heating")
Expand Down

0 comments on commit 6a4ea8f

Please sign in to comment.