Merge pull request #430 from MichaelDvP/dev

Errormessage
This commit is contained in:
Proddy
2022-03-30 17:51:53 +02:00
committed by GitHub
4 changed files with 15 additions and 3 deletions

View File

@@ -48,6 +48,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
// the telegram handlers... // the telegram handlers...
// common for all boilers // common for all boilers
register_telegram_type(0xBF, F("ErrorMessage"), false, MAKE_PF_CB(process_ErrorMessage));
register_telegram_type(0x10, F("UBAErrorMessage1"), false, MAKE_PF_CB(process_UBAErrorMessage)); register_telegram_type(0x10, F("UBAErrorMessage1"), false, MAKE_PF_CB(process_UBAErrorMessage));
register_telegram_type(0x11, F("UBAErrorMessage2"), false, MAKE_PF_CB(process_UBAErrorMessage)); register_telegram_type(0x11, F("UBAErrorMessage2"), false, MAKE_PF_CB(process_UBAErrorMessage));
register_telegram_type(0xC2, F("UBAErrorMessage3"), false, MAKE_PF_CB(process_UBAErrorMessage2)); register_telegram_type(0xC2, F("UBAErrorMessage3"), false, MAKE_PF_CB(process_UBAErrorMessage2));
@@ -872,6 +873,11 @@ void Boiler::process_UBAMaintenanceStatus(std::shared_ptr<const Telegram> telegr
} }
} }
// 0xBF
void Boiler::process_ErrorMessage(std::shared_ptr<const Telegram> telegram) {
EMSESP::send_read_request(0xC2, device_id()); // read last errorcode
}
// 0x10, 0x11 // 0x10, 0x11
void Boiler::process_UBAErrorMessage(std::shared_ptr<const Telegram> telegram) { void Boiler::process_UBAErrorMessage(std::shared_ptr<const Telegram> telegram) {
if (telegram->offset > 0 || telegram->message_length < 11) { if (telegram->offset > 0 || telegram->message_length < 11) {

View File

@@ -210,6 +210,7 @@ class Boiler : public EMSdevice {
void process_MC110Status(std::shared_ptr<const Telegram> telegram); void process_MC110Status(std::shared_ptr<const Telegram> telegram);
void process_UBAMaintenanceStatus(std::shared_ptr<const Telegram> telegram); void process_UBAMaintenanceStatus(std::shared_ptr<const Telegram> telegram);
void process_UBAMaintenanceData(std::shared_ptr<const Telegram> telegram); void process_UBAMaintenanceData(std::shared_ptr<const Telegram> telegram);
void process_ErrorMessage(std::shared_ptr<const Telegram> telegram);
void process_UBAErrorMessage(std::shared_ptr<const Telegram> telegram); void process_UBAErrorMessage(std::shared_ptr<const Telegram> telegram);
void process_UBAErrorMessage2(std::shared_ptr<const Telegram> telegram); void process_UBAErrorMessage2(std::shared_ptr<const Telegram> telegram);
void process_UBAMonitorWWPlus(std::shared_ptr<const Telegram> telegram); void process_UBAMonitorWWPlus(std::shared_ptr<const Telegram> telegram);

View File

@@ -858,11 +858,16 @@ void EMSdevice::reset_entity_masks() {
// disable/exclude/mask_out a device entity based on the id // disable/exclude/mask_out a device entity based on the id
void EMSdevice::mask_entity(const std::string & entity_id) { void EMSdevice::mask_entity(const std::string & entity_id) {
// first character contains mask flags // first character contains mask flags
uint8_t flag = Helpers::hextoint(entity_id.substr(0, 2).c_str()); uint8_t flag = (Helpers::hextoint(entity_id.substr(0, 2).c_str()) << 4);
for (auto & dv : devicevalues_) { for (auto & dv : devicevalues_) {
std::string entity = dv.tag < DeviceValueTAG::TAG_HC1 ? read_flash_string(dv.short_name) : tag_to_string(dv.tag) + "/" + read_flash_string(dv.short_name); std::string entity = dv.tag < DeviceValueTAG::TAG_HC1 ? read_flash_string(dv.short_name) : tag_to_string(dv.tag) + "/" + read_flash_string(dv.short_name);
if (entity == entity_id.substr(2)) { if (entity == entity_id.substr(2)) {
dv.state = (dv.state & 0x0F) | (flag << 4); // set state high bits to flag, turn off active and ha flags // remove ha config on change of dv_readonly flag
if (Mqtt::ha_enabled() && ((dv.state ^ flag) & DeviceValueState::DV_READONLY)) {
dv.remove_state(DeviceValueState::DV_HA_CONFIG_CREATED);
Mqtt::publish_ha_sensor_config(dv, "", "", true); // delete topic (remove = true)
}
dv.state = (dv.state & 0x0F) | flag; // set state high bits to flag
return; return;
} }
} }

View File

@@ -114,7 +114,7 @@ class DeviceValue {
DV_DEFAULT = 0, // 0 - does not yet have a value DV_DEFAULT = 0, // 0 - does not yet have a value
DV_ACTIVE = (1 << 0), // 1 - has a validated real value DV_ACTIVE = (1 << 0), // 1 - has a validated real value
DV_HA_CONFIG_CREATED = (1 << 1), // 2 - set if the HA config topic has been created DV_HA_CONFIG_CREATED = (1 << 1), // 2 - set if the HA config topic has been created
DV_HA_CLIMATE_NO_RT = (1 << 2), // 3 - climate created without roomTemp DV_HA_CLIMATE_NO_RT = (1 << 2), // 4 - climate created without roomTemp
// high nibble as mask for exclusions & special functions // high nibble as mask for exclusions & special functions
DV_WEB_EXCLUDE = (1 << 4), // 16 - not shown on web DV_WEB_EXCLUDE = (1 << 4), // 16 - not shown on web