mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
auto formatting
This commit is contained in:
@@ -85,7 +85,8 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
||||
register_telegram_type(0x48F, F("HpOutdoor"), false, MAKE_PF_CB(process_HpOutdoor));
|
||||
}
|
||||
// MQTT commands for boiler topic
|
||||
register_device_value(TAG_BOILER_DATA, &dummybool_, DeviceValueType::BOOL, nullptr, FL_(wwtapactivated), DeviceValueUOM::NONE, MAKE_CF_CB(set_tapwarmwater_activated));
|
||||
register_device_value(
|
||||
TAG_BOILER_DATA, &dummybool_, DeviceValueType::BOOL, nullptr, FL_(wwtapactivated), DeviceValueUOM::NONE, MAKE_CF_CB(set_tapwarmwater_activated));
|
||||
register_device_value(TAG_BOILER_DATA, &dummy8u_, DeviceValueType::ENUM, FL_(enum_reset), FL_(reset), DeviceValueUOM::NONE, MAKE_CF_CB(set_reset));
|
||||
|
||||
// add values
|
||||
@@ -113,7 +114,8 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
||||
register_device_value(TAG_BOILER_DATA, &heatingPump_, DeviceValueType::BOOL, nullptr, FL_(heatingPump), DeviceValueUOM::PUMP);
|
||||
register_device_value(TAG_BOILER_DATA, &fanWork_, DeviceValueType::BOOL, nullptr, FL_(fanWork), DeviceValueUOM::NONE);
|
||||
register_device_value(TAG_BOILER_DATA, &ignWork_, DeviceValueType::BOOL, nullptr, FL_(ignWork), DeviceValueUOM::NONE);
|
||||
register_device_value(TAG_BOILER_DATA, &heatingActivated_, DeviceValueType::BOOL, nullptr, FL_(heatingActivated), DeviceValueUOM::NONE, MAKE_CF_CB(set_heating_activated));
|
||||
register_device_value(
|
||||
TAG_BOILER_DATA, &heatingActivated_, DeviceValueType::BOOL, nullptr, FL_(heatingActivated), DeviceValueUOM::NONE, MAKE_CF_CB(set_heating_activated));
|
||||
register_device_value(TAG_BOILER_DATA, &heatingTemp_, DeviceValueType::UINT, nullptr, FL_(heatingTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_heating_temp));
|
||||
register_device_value(TAG_BOILER_DATA, &pumpModMax_, DeviceValueType::UINT, nullptr, FL_(pumpModMax), DeviceValueUOM::PERCENT, MAKE_CF_CB(set_max_pump));
|
||||
register_device_value(TAG_BOILER_DATA, &pumpModMin_, DeviceValueType::UINT, nullptr, FL_(pumpModMin), DeviceValueUOM::PERCENT, MAKE_CF_CB(set_min_pump));
|
||||
@@ -135,7 +137,13 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
||||
register_device_value(TAG_BOILER_DATA, &serviceCodeNumber_, DeviceValueType::USHORT, nullptr, FL_(serviceCodeNumber), DeviceValueUOM::NONE);
|
||||
register_device_value(TAG_BOILER_DATA, &maintenanceMessage_, DeviceValueType::TEXT, nullptr, FL_(maintenanceMessage), DeviceValueUOM::NONE);
|
||||
register_device_value(TAG_BOILER_DATA, &maintenanceDate_, DeviceValueType::TEXT, nullptr, FL_(maintenanceDate), DeviceValueUOM::NONE);
|
||||
register_device_value(TAG_BOILER_DATA, &maintenanceType_, DeviceValueType::ENUM, FL_(enum_off_time_date), FL_(maintenanceType), DeviceValueUOM::NONE, MAKE_CF_CB(set_maintenance));
|
||||
register_device_value(TAG_BOILER_DATA,
|
||||
&maintenanceType_,
|
||||
DeviceValueType::ENUM,
|
||||
FL_(enum_off_time_date),
|
||||
FL_(maintenanceType),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_maintenance));
|
||||
register_device_value(TAG_BOILER_DATA, &maintenanceTime_, DeviceValueType::USHORT, nullptr, FL_(maintenanceTime), DeviceValueUOM::HOURS);
|
||||
// heatpump info
|
||||
if (model() == EMS_DEVICE_FLAG_HEATPUMP) {
|
||||
@@ -175,20 +183,37 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
||||
register_device_value(TAG_DEVICE_DATA_WW, &wWSelTemp_, DeviceValueType::UINT, nullptr, FL_(wWSelTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(TAG_DEVICE_DATA_WW, &wWSetTemp_, DeviceValueType::UINT, nullptr, FL_(wWSetTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_warmwater_temp));
|
||||
register_device_value(TAG_DEVICE_DATA_WW, &wWType_, DeviceValueType::ENUM, FL_(enum_flow), FL_(wWType), DeviceValueUOM::NONE);
|
||||
register_device_value(TAG_DEVICE_DATA_WW, &wWComfort_, DeviceValueType::ENUM, FL_(enum_comfort), FL_(wWComfort), DeviceValueUOM::NONE, MAKE_CF_CB(set_warmwater_mode));
|
||||
register_device_value(TAG_DEVICE_DATA_WW, &wWFlowTempOffset_, DeviceValueType::UINT, nullptr, FL_(wWFlowTempOffset), DeviceValueUOM::NONE, MAKE_CF_CB(set_wWFlowTempOffset));
|
||||
register_device_value(TAG_DEVICE_DATA_WW, &wWMaxPower_, DeviceValueType::UINT, nullptr, FL_(wWMaxPower), DeviceValueUOM::PERCENT, MAKE_CF_CB(set_warmwater_maxpower));
|
||||
register_device_value(TAG_DEVICE_DATA_WW, &wWCircPump_, DeviceValueType::BOOL, nullptr, FL_(wWCircPump), DeviceValueUOM::NONE, MAKE_CF_CB(set_warmwater_circulation_pump));
|
||||
register_device_value(
|
||||
TAG_DEVICE_DATA_WW, &wWComfort_, DeviceValueType::ENUM, FL_(enum_comfort), FL_(wWComfort), DeviceValueUOM::NONE, MAKE_CF_CB(set_warmwater_mode));
|
||||
register_device_value(
|
||||
TAG_DEVICE_DATA_WW, &wWFlowTempOffset_, DeviceValueType::UINT, nullptr, FL_(wWFlowTempOffset), DeviceValueUOM::NONE, MAKE_CF_CB(set_wWFlowTempOffset));
|
||||
register_device_value(
|
||||
TAG_DEVICE_DATA_WW, &wWMaxPower_, DeviceValueType::UINT, nullptr, FL_(wWMaxPower), DeviceValueUOM::PERCENT, MAKE_CF_CB(set_warmwater_maxpower));
|
||||
register_device_value(
|
||||
TAG_DEVICE_DATA_WW, &wWCircPump_, DeviceValueType::BOOL, nullptr, FL_(wWCircPump), DeviceValueUOM::NONE, MAKE_CF_CB(set_warmwater_circulation_pump));
|
||||
register_device_value(TAG_DEVICE_DATA_WW, &wWChargeType_, DeviceValueType::BOOL, FL_(enum_charge), FL_(wWChargeType), DeviceValueUOM::NONE);
|
||||
register_device_value(TAG_DEVICE_DATA_WW, &wWDisinfectionTemp_, DeviceValueType::UINT, nullptr, FL_(wWDisinfectionTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_disinfect_temp));
|
||||
register_device_value(TAG_DEVICE_DATA_WW, &wWCircMode_, DeviceValueType::ENUM, FL_(enum_freq), FL_(wWCircMode), DeviceValueUOM::NONE, MAKE_CF_CB(set_warmwater_circulation_mode));
|
||||
register_device_value(TAG_DEVICE_DATA_WW,
|
||||
&wWDisinfectionTemp_,
|
||||
DeviceValueType::UINT,
|
||||
nullptr,
|
||||
FL_(wWDisinfectionTemp),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_disinfect_temp));
|
||||
register_device_value(TAG_DEVICE_DATA_WW,
|
||||
&wWCircMode_,
|
||||
DeviceValueType::ENUM,
|
||||
FL_(enum_freq),
|
||||
FL_(wWCircMode),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_warmwater_circulation_mode));
|
||||
register_device_value(TAG_DEVICE_DATA_WW, &wWCirc_, DeviceValueType::BOOL, nullptr, FL_(wWCirc), DeviceValueUOM::NONE, MAKE_CF_CB(set_warmwater_circulation));
|
||||
register_device_value(TAG_DEVICE_DATA_WW, &wWCurTemp_, DeviceValueType::USHORT, FL_(div10), FL_(wWCurTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(TAG_DEVICE_DATA_WW, &wWCurTemp2_, DeviceValueType::USHORT, FL_(div10), FL_(wWCurTemp2), DeviceValueUOM::DEGREES);
|
||||
register_device_value(TAG_DEVICE_DATA_WW, &wWCurFlow_, DeviceValueType::UINT, FL_(div10), FL_(wWCurFlow), DeviceValueUOM::LMIN);
|
||||
register_device_value(TAG_DEVICE_DATA_WW, &wWStorageTemp1_, DeviceValueType::USHORT, FL_(div10), FL_(wWStorageTemp1), DeviceValueUOM::DEGREES);
|
||||
register_device_value(TAG_DEVICE_DATA_WW, &wWStorageTemp2_, DeviceValueType::USHORT, FL_(div10), FL_(wWStorageTemp2), DeviceValueUOM::DEGREES);
|
||||
register_device_value(TAG_DEVICE_DATA_WW, &wWActivated_, DeviceValueType::BOOL, nullptr, FL_(wWActivated), DeviceValueUOM::NONE, MAKE_CF_CB(set_warmwater_activated));
|
||||
register_device_value(
|
||||
TAG_DEVICE_DATA_WW, &wWActivated_, DeviceValueType::BOOL, nullptr, FL_(wWActivated), DeviceValueUOM::NONE, MAKE_CF_CB(set_warmwater_activated));
|
||||
register_device_value(TAG_DEVICE_DATA_WW, &wWOneTime_, DeviceValueType::BOOL, nullptr, FL_(wWOneTime), DeviceValueUOM::NONE, MAKE_CF_CB(set_warmwater_onetime));
|
||||
register_device_value(TAG_DEVICE_DATA_WW, &wWDisinfecting_, DeviceValueType::BOOL, nullptr, FL_(wWDisinfecting), DeviceValueUOM::NONE);
|
||||
register_device_value(TAG_DEVICE_DATA_WW, &wWCharging_, DeviceValueType::BOOL, nullptr, FL_(wWCharging), DeviceValueUOM::NONE);
|
||||
@@ -204,10 +229,14 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
||||
register_device_value(TAG_DEVICE_DATA_WW, &wWWorkM_, DeviceValueType::TIME, nullptr, FL_(wWWorkM), DeviceValueUOM::MINUTES);
|
||||
|
||||
// fetch some initial data
|
||||
EMSESP::send_read_request(0x10, device_id); // read last errorcode on start (only published on errors)
|
||||
EMSESP::send_read_request(0x11, device_id); // read last errorcode on start (only published on errors)
|
||||
EMSESP::send_read_request(0x15, device_id); // read maintenace data on start (only published on change)
|
||||
EMSESP::send_read_request(0x1C, device_id); // read maintenace status on start (only published on change)
|
||||
EMSESP::send_read_request(0x10,
|
||||
device_id); // read last errorcode on start (only published on errors)
|
||||
EMSESP::send_read_request(0x11,
|
||||
device_id); // read last errorcode on start (only published on errors)
|
||||
EMSESP::send_read_request(0x15,
|
||||
device_id); // read maintenace data on start (only published on change)
|
||||
EMSESP::send_read_request(0x1C,
|
||||
device_id); // read maintenace status on start (only published on change)
|
||||
}
|
||||
|
||||
// publish HA config
|
||||
@@ -231,7 +260,8 @@ bool Boiler::publish_ha_config() {
|
||||
|
||||
char topic[Mqtt::MQTT_TOPIC_MAX_SIZE];
|
||||
snprintf_P(topic, sizeof(topic), PSTR("sensor/%s/boiler/config"), Mqtt::base().c_str());
|
||||
Mqtt::publish_ha(topic, doc.as<JsonObject>()); // publish the config payload with retain flag
|
||||
Mqtt::publish_ha(topic,
|
||||
doc.as<JsonObject>()); // publish the config payload with retain flag
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -288,7 +318,8 @@ void Boiler::process_UBAParameterWW(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram->read_value(wWCircPump_, 6)); // 0xFF means on
|
||||
has_update(telegram->read_value(wWCircMode_, 7)); // 1=1x3min 6=6x3min 7=continuous
|
||||
has_update(telegram->read_value(wWDisinfectionTemp_, 8));
|
||||
has_update(telegram->read_value(wWChargeType_, 10)); // 0 = charge pump, 0xff = 3-way valve
|
||||
has_update(telegram->read_value(wWChargeType_,
|
||||
10)); // 0 = charge pump, 0xff = 3-way valve
|
||||
|
||||
telegram->read_value(wWComfort_, 9);
|
||||
if (wWComfort_ == 0x00) {
|
||||
@@ -319,8 +350,9 @@ void Boiler::process_UBAMonitorFast(std::shared_ptr<const Telegram> telegram) {
|
||||
|
||||
// warm water storage sensors (if present)
|
||||
// wWStorageTemp2 is also used by some brands as the boiler temperature - see https://github.com/emsesp/EMS-ESP/issues/206
|
||||
has_update(telegram->read_value(wWStorageTemp1_, 9)); // 0x8300 if not available
|
||||
has_update(telegram->read_value(wWStorageTemp2_, 11)); // 0x8000 if not available - this is boiler temp
|
||||
has_update(telegram->read_value(wWStorageTemp1_, 9)); // 0x8300 if not available
|
||||
has_update(telegram->read_value(wWStorageTemp2_,
|
||||
11)); // 0x8000 if not available - this is boiler temp
|
||||
|
||||
has_update(telegram->read_value(retTemp_, 13));
|
||||
has_update(telegram->read_value(flameCurr_, 15));
|
||||
@@ -456,7 +488,8 @@ void Boiler::process_UBAMonitorSlow(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram->read_value(outdoorTemp_, 0));
|
||||
has_update(telegram->read_value(boilTemp_, 2));
|
||||
has_update(telegram->read_value(exhaustTemp_, 4));
|
||||
has_update(telegram->read_value(switchTemp_, 25)); // only if there is a mixer module present
|
||||
has_update(telegram->read_value(switchTemp_,
|
||||
25)); // only if there is a mixer module present
|
||||
has_update(telegram->read_value(heatingPumpMod_, 9));
|
||||
has_update(telegram->read_value(burnStarts_, 10, 3)); // force to 3 bytes
|
||||
has_update(telegram->read_value(burnWorkMin_, 13, 3)); // force to 3 bytes
|
||||
@@ -515,7 +548,8 @@ void Boiler::process_UBAParametersPlus(std::shared_ptr<const Telegram> telegram)
|
||||
void Boiler::process_UBAParameterWWPlus(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram->read_value(wWActivated_, 5)); // 0x01 means on
|
||||
has_update(telegram->read_value(wWCircPump_, 10)); // 0x01 means yes
|
||||
has_update(telegram->read_value(wWCircMode_, 11)); // 1=1x3min... 6=6x3min, 7=continuous
|
||||
has_update(telegram->read_value(wWCircMode_,
|
||||
11)); // 1=1x3min... 6=6x3min, 7=continuous
|
||||
// has_update(telegram->read_value(wWDisinfectTemp_, 12)); // settings, status in E9
|
||||
// has_update(telegram->read_value(wWSelTemp_, 6)); // settings, status in E9
|
||||
}
|
||||
@@ -588,13 +622,12 @@ void Boiler::process_UBAEnergySupplied(std::shared_ptr<const Telegram> telegram)
|
||||
}
|
||||
|
||||
// Heatpump power - type 0x48D
|
||||
void Boiler::process_HpPower(std::shared_ptr<const Telegram> telegram){
|
||||
void Boiler::process_HpPower(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram->read_value(hpPower_, 11));
|
||||
|
||||
}
|
||||
|
||||
// Heatpump outdoor unit - type 0x48F
|
||||
void Boiler::process_HpOutdoor(std::shared_ptr<const Telegram> telegram){
|
||||
void Boiler::process_HpOutdoor(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram->read_value(hpTc0_, 6));
|
||||
has_update(telegram->read_value(hpTc1_, 4));
|
||||
has_update(telegram->read_value(hpTc3_, 2));
|
||||
@@ -625,7 +658,8 @@ void Boiler::process_UBAOutdoorTemp(std::shared_ptr<const Telegram> telegram) {
|
||||
|
||||
// UBASetPoint 0x1A
|
||||
void Boiler::process_UBASetPoints(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram->read_value(setFlowTemp_, 0)); // boiler set temp from thermostat
|
||||
has_update(telegram->read_value(setFlowTemp_,
|
||||
0)); // boiler set temp from thermostat
|
||||
has_update(telegram->read_value(setBurnPow_, 1)); // max json power in %
|
||||
has_update(telegram->read_value(wWSetPumpPower_, 2)); // ww pump speed/power?
|
||||
}
|
||||
@@ -727,8 +761,9 @@ bool Boiler::set_warmwater_temp(const char * value, const int8_t id) {
|
||||
write_command(EMS_TYPE_UBAParameterWWPlus, 6, v, EMS_TYPE_UBAParameterWWPlus);
|
||||
} else {
|
||||
// some boiler have it in 0x33, some in 0x35
|
||||
write_command(EMS_TYPE_UBAFlags, 3, v, 0x34); // for i9000, see #397
|
||||
write_command(EMS_TYPE_UBAParameterWW, 2, v, EMS_TYPE_UBAParameterWW); // read seltemp back
|
||||
write_command(EMS_TYPE_UBAFlags, 3, v, 0x34); // for i9000, see #397
|
||||
write_command(EMS_TYPE_UBAParameterWW, 2, v,
|
||||
EMS_TYPE_UBAParameterWW); // read seltemp back
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -1074,7 +1109,8 @@ bool Boiler::set_warmwater_onetime(const char * value, const int8_t id) {
|
||||
|
||||
LOG_INFO(F("Setting warm water OneTime loading %s"), v ? "on" : "off");
|
||||
if (get_toggle_fetch(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
write_command(EMS_TYPE_UBAFlags, 0, (v ? 0x22 : 0x02), 0xE9); // not sure if this is in flags
|
||||
write_command(EMS_TYPE_UBAFlags, 0, (v ? 0x22 : 0x02),
|
||||
0xE9); // not sure if this is in flags
|
||||
} else {
|
||||
write_command(EMS_TYPE_UBAFlags, 0, (v ? 0x22 : 0x02), 0x34);
|
||||
}
|
||||
@@ -1093,7 +1129,8 @@ bool Boiler::set_warmwater_circulation(const char * value, const int8_t id) {
|
||||
|
||||
LOG_INFO(F("Setting warm water circulation %s"), v ? "on" : "off");
|
||||
if (get_toggle_fetch(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
write_command(EMS_TYPE_UBAFlags, 1, (v ? 0x22 : 0x02), 0xE9); // not sure if this is in flags
|
||||
write_command(EMS_TYPE_UBAFlags, 1, (v ? 0x22 : 0x02),
|
||||
0xE9); // not sure if this is in flags
|
||||
} else {
|
||||
write_command(EMS_TYPE_UBAFlags, 1, (v ? 0x22 : 0x02), 0x34);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user