diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index 055a5a87c..dd4794682 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -18,6 +18,7 @@ For more details go to [docs.emsesp.org](https://docs.emsesp.org/). - update link buttons [#2497](https://github.com/emsesp/EMS-ESP32/issues/2497) - refresh scheduler states [#2502](https://github.com/emsesp/EMS-ESP32/discussions/2502) - also rebuild HA config on mqtt connect for scheduler, custom and shower +- FB100 controls the hc, not the master [#2510](https://github.com/emsesp/EMS-ESP32/issues/2510) ## Changed diff --git a/src/core/emsdevice.cpp b/src/core/emsdevice.cpp index 3deebfd3c..bfd8f6fa9 100644 --- a/src/core/emsdevice.cpp +++ b/src/core/emsdevice.cpp @@ -393,7 +393,7 @@ bool EMSdevice::has_tags(const int8_t tag) const { // check if the device has a command with this tag. bool EMSdevice::has_cmd(const char * cmd, const int8_t id) const { for (const auto & dv : devicevalues_) { - if ((id < 1 || dv.tag == id) && dv.has_cmd && strcmp(dv.short_name, cmd) == 0) { + if ((id < 1 || dv.tag == id) && dv.has_cmd && strcmp(dv.short_name, cmd) == 0 && (dv.hasValue() || dv.type == DeviceValueType::CMD)) { return true; } } @@ -1675,7 +1675,7 @@ void EMSdevice::get_value_json(JsonObject json, DeviceValue & dv) { // add uom, state class and device class Mqtt::add_ha_uom(json, dv.type, dv.uom, dv.short_name, false); // no icon - json["readable"] = !dv.has_state(DeviceValueState::DV_API_MQTT_EXCLUDE); + json["readable"] = dv.type != DeviceValueType::CMD && !dv.has_state(DeviceValueState::DV_API_MQTT_EXCLUDE); json["writeable"] = dv.has_cmd && !dv.has_state(DeviceValueState::DV_READONLY); json["visible"] = !dv.has_state(DeviceValueState::DV_WEB_EXCLUDE); } diff --git a/src/core/shower.cpp b/src/core/shower.cpp index 88226cd79..b92ccd84f 100644 --- a/src/core/shower.cpp +++ b/src/core/shower.cpp @@ -237,6 +237,7 @@ void Shower::set_shower_state(bool state, bool force) { // // shower timestamp // + /* commented out as the publish of timestamp doc.clear(); snprintf(str, sizeof(str), "%s_shower_timestamp", Mqtt::basename().c_str()); @@ -255,6 +256,7 @@ void Shower::set_shower_state(bool state, bool force) { snprintf(topic, sizeof(topic), "sensor/%s/shower_timestamp/config", Mqtt::basename().c_str()); Mqtt::queue_ha(topic, doc.as()); // publish the config payload with retain flag + */ } } diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index 5cc84fde9..478722457 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -201,8 +201,8 @@ Thermostat::Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_i } else if (model == EMSdevice::EMS_DEVICE_FLAG_JUNKERS) { if (device_id >= 0x18 && device_id <= 0x1B) { // remote hc1-hc4 register_telegram_type(0x123, "JunkersRemote", false, MAKE_PF_CB(process_JunkersRemoteMonitor)); - register_device_values(); // register device values for common values (not heating circuit) - return; // no values to add + // register_device_values(); // register device values for common values (not heating circuit) + // return; // no values to add } monitor_typeids = {0x016F, 0x0170, 0x0171, 0x0172}; @@ -272,6 +272,10 @@ std::shared_ptr Thermostat::heating_circuit(const in // returns pointer to the HeatingCircuit or nullptr if it can't be found // if its a new one, the heating circuit object will be created and also the fetch flags set std::shared_ptr Thermostat::heating_circuit(std::shared_ptr telegram) { + // do not create a hc on empty messages + if (telegram->message_length == 0) { + return nullptr; + } // look through the Monitor and Set arrays to see if there is a match uint8_t hc_num = 0; // 0 means we haven't found it yet bool toggle_ = false;