add boiler telegram 0x26, wwMaxPower

This commit is contained in:
MichaelDvP
2021-03-11 13:40:16 +01:00
parent a5c9849aad
commit 7e41aa1633
3 changed files with 36 additions and 2 deletions

View File

@@ -383,8 +383,14 @@ void DallasSensor::publish_values(const bool force) {
ids.add("ems-esp");
char topic[100];
// use sensor number as HA doesn't like '-' in the topic name
if (dallas_format == Mqtt::Dallas_Format::SENSORID) {
// use '_' as HA doesn't like '-' in the topic name
std::string topicname = sensor.to_string();
std::replace(topicname.begin(), topicname.end(), '-', '_');
snprintf_P(topic, sizeof(topic), PSTR("homeassistant/sensor/%s/dallas_sensor%s/config"), Mqtt::base().c_str(), topicname);
} else {
snprintf_P(topic, sizeof(topic), PSTR("homeassistant/sensor/%s/dallas_sensor%d/config"), Mqtt::base().c_str(), sensor_no);
}
Mqtt::publish_ha(topic, config.as<JsonObject>());
registered_ha_[sensor_no - 1] = true;

View File

@@ -58,6 +58,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
register_telegram_type(0x19, F("UBAMonitorSlow"), true, [&](std::shared_ptr<const Telegram> t) { process_UBAMonitorSlow(t); });
register_telegram_type(0x1A, F("UBASetPoints"), false, [&](std::shared_ptr<const Telegram> t) { process_UBASetPoints(t); });
register_telegram_type(0x1C, F("UBAMaintenanceStatus"), false, [&](std::shared_ptr<const Telegram> t) { process_UBAMaintenanceStatus(t); });
register_telegram_type(0x26, F("UBASettingsWW"), true, [&](std::shared_ptr<const Telegram> t) { process_UBASettingsWW(t); });
register_telegram_type(0x2A, F("MC10Status"), false, [&](std::shared_ptr<const Telegram> t) { process_MC10Status(t); });
register_telegram_type(0x33, F("UBAParameterWW"), true, [&](std::shared_ptr<const Telegram> t) { process_UBAParameterWW(t); });
register_telegram_type(0x34, F("UBAMonitorWW"), false, [&](std::shared_ptr<const Telegram> t) { process_UBAMonitorWW(t); });
@@ -86,6 +87,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
register_mqtt_cmd(F("wwactivated"), [&](const char * value, const int8_t id) { return set_warmwater_activated(value, id); });
register_mqtt_cmd(F("wwtapactivated"), [&](const char * value, const int8_t id) { return set_tapwarmwater_activated(value, id); });
register_mqtt_cmd(F("wwflowtempoffset"), [&](const char * value, const int8_t id) { return set_wWFlowTempOffset(value, id); });
register_mqtt_cmd(F("wwmaxpower"), [&](const char * value, const int8_t id) { return set_warmwater_maxpower(value, id); });
register_mqtt_cmd(F("wwonetime"), [&](const char * value, const int8_t id) { return set_warmwater_onetime(value, id); });
register_mqtt_cmd(F("wwcircpump"), [&](const char * value, const int8_t id) { return set_warmwater_circulation_pump(value, id); });
register_mqtt_cmd(F("wwcirculation"), [&](const char * value, const int8_t id) { return set_warmwater_circulation(value, id); });
@@ -184,6 +186,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
register_device_value(TAG_BOILER_DATA_WW, &wWStarts_, DeviceValueType::ULONG, nullptr, F("wWStarts"), F("# starts"));
register_device_value(TAG_BOILER_DATA_WW, &wWStarts2_, DeviceValueType::ULONG, nullptr, F("wWStarts2"), F("# control starts"));
register_device_value(TAG_BOILER_DATA_WW, &wWWorkM_, DeviceValueType::TIME, nullptr, F("wWWorkM"), F("active time"), DeviceValueUOM::MINUTES);
register_device_value(TAG_BOILER_DATA_WW, &wWMaxPower_, DeviceValueType::UINT, nullptr, F("wWMaxPower"), F("max power"), DeviceValueUOM::PERCENT);
// info - boiler_data_info topic
register_device_value(TAG_BOILER_DATA_INFO, &upTimeControl_, DeviceValueType::TIME, FL_(div60), F("upTimeControl"), F("operating time total heat"), DeviceValueUOM::MINUTES);
@@ -367,6 +370,13 @@ void Boiler::process_UBAParameters(std::shared_ptr<const Telegram> telegram) {
has_update(telegram->read_value(pumpModMin_, 10));
}
/*
* UBASettingsWW - type 0x26 - max power on offset 7
*/
void Boiler::process_UBASettingsWW(std::shared_ptr<const Telegram> telegram) {
has_update(telegram->read_value(wWMaxPower_, 7));
}
/*
* UBAMonitorWW - type 0x34 - warm water monitor. 19 bytes long
* received every 10 seconds
@@ -809,6 +819,20 @@ bool Boiler::set_max_power(const char * value, const int8_t id) {
return true;
}
// set warm water max power
bool Boiler::set_warmwater_maxpower(const char * value, const int8_t id) {
int v = 0;
if (!Helpers::value2number(value, v)) {
LOG_WARNING(F("Set warm water max power: Invalid value"));
return false;
}
LOG_INFO(F("Setting warm water max power to %d %%"), v);
write_command(EMS_TYPE_UBASettingsWW, 7, v, EMS_TYPE_UBASettingsWW);
return true;
}
// set min pump modulation
bool Boiler::set_min_pump(const char * value, const int8_t id) {
int v = 0;

View File

@@ -36,6 +36,7 @@ class Boiler : public EMSdevice {
uint8_t boilerState_ = EMS_VALUE_UINT_NOTSET; // Boiler state flag - FOR INTERNAL USE
static constexpr uint8_t EMS_TYPE_UBASettingsWW = 0x26;
static constexpr uint8_t EMS_TYPE_UBAParameterWW = 0x33;
static constexpr uint8_t EMS_TYPE_UBAFunctionTest = 0x1D;
static constexpr uint8_t EMS_TYPE_UBAFlags = 0x35;
@@ -73,6 +74,7 @@ class Boiler : public EMSdevice {
uint8_t wWHeat_; // 3-way valve on WW
uint8_t wWSetPumpPower_; // ww pump speed/power?
uint8_t wWFlowTempOffset_; // Boiler offset for ww heating
uint8_t wWMaxPower_; // Warm Water maximum power
uint32_t wWStarts_; // Warm Water # starts
uint32_t wWStarts2_; // Warm water starts (control)
uint32_t wWWorkM_; // Warm Water # minutes
@@ -167,6 +169,7 @@ class Boiler : public EMSdevice {
void process_UBAInformation(std::shared_ptr<const Telegram> telegram);
void process_UBAEnergySupplied(std::shared_ptr<const Telegram> telegram);
void process_CascadeMessage(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);
@@ -177,6 +180,7 @@ class Boiler : public EMSdevice {
bool set_warmwater_circulation_pump(const char * value, const int8_t id);
bool set_warmwater_circulation_mode(const char * value, const int8_t id);
bool set_warmwater_temp(const char * value, const int8_t id);
bool set_warmwater_maxpower(const char * value, const int8_t id);
bool set_wWFlowTempOffset(const char * value, const int8_t id);
bool set_flow_temp(const char * value, const int8_t id);
bool set_heating_activated(const char * value, const int8_t id);