diff --git a/src/devices/mixing.cpp b/src/devices/mixing.cpp index 81e3f3d53..9b2a874a6 100644 --- a/src/devices/mixing.cpp +++ b/src/devices/mixing.cpp @@ -67,14 +67,17 @@ void Mixing::device_info(JsonArray & root) { if (type_ == Type::WWC) { render_value_json(root, "", F("Warm Water Circuit"), hc_, nullptr); + render_value_json(root, "", F("Current warm water temperature"), flowTemp_, F_(degrees), 10); + render_value_json(root, "", F("Current pump status"), pumpMod_, nullptr); + render_value_json(root, "", F("Current temperature status"), status_, nullptr); } else { render_value_json(root, "", F("Heating Circuit"), hc_, nullptr); + render_value_json(root, "", F("Current flow temperature"), flowTemp_, F_(degrees), 10); + render_value_json(root, "", F("Setpoint flow temperature"), flowSetTemp_, F_(degrees)); + render_value_json(root, "", F("Current pump modulation"), pumpMod_, F_(percent)); + render_value_json(root, "", F("Current valve status"), status_, nullptr); } - render_value_json(root, "", F("Current flow temperature"), flowTemp_, F_(degrees), 10); - render_value_json(root, "", F("Setpoint flow temperature"), flowSetTemp_, F_(degrees)); - render_value_json(root, "", F("Current pump modulation"), pumpMod_, F_(percent)); - render_value_json(root, "", F("Current valve status"), status_, nullptr); } // check to see if values have been updated @@ -96,14 +99,17 @@ void Mixing::show_values(uuid::console::Shell & shell) { if (type_ == Type::WWC) { print_value(shell, 2, F("Warm Water Circuit"), hc_, nullptr); + print_value(shell, 4, F("Current warm water temperature"), flowTemp_, F_(degrees), 10); + print_value(shell, 4, F("Current pump status"), pumpMod_, nullptr); + print_value(shell, 4, F("Current temperature status"), status_, nullptr); } else { print_value(shell, 2, F("Heating Circuit"), hc_, nullptr); + print_value(shell, 4, F("Current flow temperature"), flowTemp_, F_(degrees), 10); + print_value(shell, 4, F("Setpoint flow temperature"), flowSetTemp_, F_(degrees)); + print_value(shell, 4, F("Current pump modulation"), pumpMod_, F_(percent)); + print_value(shell, 4, F("Current valve status"), status_, nullptr); } - print_value(shell, 4, F("Current flow temperature"), flowTemp_, F_(degrees), 10); - print_value(shell, 4, F("Setpoint flow temperature"), flowSetTemp_, F_(degrees)); - print_value(shell, 4, F("Current pump modulation"), pumpMod_, F_(percent)); - print_value(shell, 4, F("Current valve status"), status_, nullptr); shell.println(); } @@ -116,31 +122,36 @@ void Mixing::publish_values() { switch (type_) { case Type::HC: doc["type"] = "hc"; + if (Helpers::hasValue(flowTemp_)) { + doc["flowTemp"] = (float)flowTemp_ / 10; + } + if (Helpers::hasValue(pumpMod_)) { + doc["pumpMod"] = pumpMod_; + } + if (Helpers::hasValue(status_)) { + doc["status"] = status_; + } + if (Helpers::hasValue(flowSetTemp_)) { + doc["flowSetTemp"] = flowSetTemp_; + } break; case Type::WWC: doc["type"] = "wwc"; + if (Helpers::hasValue(flowTemp_)) { + doc["wwTemp"] = (float)flowTemp_ / 10; + } + if (Helpers::hasValue(pumpMod_)) { + doc["pumpStatus"] = pumpMod_; + } + if (Helpers::hasValue(status_)) { + doc["tempStatus"] = status_; + } break; case Type::NONE: default: return; } - if (Helpers::hasValue(flowTemp_)) { - doc["flowTemp"] = (float)flowTemp_ / 10; - } - - if (Helpers::hasValue(pumpMod_)) { - doc["pumpMod"] = pumpMod_; - } - - if (Helpers::hasValue(status_)) { - doc["status"] = status_; - } - - if (Helpers::hasValue(flowSetTemp_)) { - doc["flowSetTemp"] = flowSetTemp_; - } - char topic[30]; char s[3]; // for formatting strings strlcpy(topic, "mixing_data", 30); diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index 69095ddb6..a570bc42c 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -1629,12 +1629,17 @@ void Thermostat::set_temperature(const float temperature, const uint8_t mode, co } else if ((model == EMS_DEVICE_FLAG_RC300) || (model == EMS_DEVICE_FLAG_RC100)) { validate_typeid = set_typeids[hc->hc_num() - 1]; - if (mode == HeatingCircuit::Mode::AUTO) { - offset = 0x08; // auto offset - } else if (mode == HeatingCircuit::Mode::MANUAL) { + switch (mode) { + case HeatingCircuit::Mode::MANUAL: offset = 0x0A; // manual offset - } else if (mode == HeatingCircuit::Mode::COMFORT) { + break; + case HeatingCircuit::Mode::COMFORT: offset = 0x02; // comfort offset + break; + default: + case HeatingCircuit::Mode::AUTO: + offset = 0x08; // auto offset + break; } } else if (model == EMS_DEVICE_FLAG_RC20_2) { @@ -1645,6 +1650,11 @@ void Thermostat::set_temperature(const float temperature, const uint8_t mode, co case HeatingCircuit::Mode::DAY: // change the day temp offset = EMS_OFFSET_RC20_2_Set_temp_day; break; + default: + case HeatingCircuit::Mode::AUTO: // automatic selection, if no type is defined, we use the standard code + uint8_t mode_type = hc->get_mode_type(this->flags()); + offset = (mode_type == HeatingCircuit::Mode::NIGHT) ? EMS_OFFSET_RC20_2_Set_temp_night : EMS_OFFSET_RC20_2_Set_temp_day; + break; } } else if ((model == EMS_DEVICE_FLAG_RC35) || (model == EMS_DEVICE_FLAG_RC30_1)) { @@ -1712,8 +1722,13 @@ void Thermostat::set_temperature(const float temperature, const uint8_t mode, co default: case HeatingCircuit::Mode::AUTO: // automatic selection, if no type is defined, we use the standard code uint8_t mode_type = hc->get_mode_type(this->flags()); - offset = (mode_type == HeatingCircuit::Mode::NIGHT || mode_type == HeatingCircuit::Mode::ECO) ? EMS_OFFSET_JunkersSetMessage_night_temp - : EMS_OFFSET_JunkersSetMessage_day_temp; + if (mode_type == HeatingCircuit::Mode::NIGHT || mode_type == HeatingCircuit::Mode::ECO) { + offset = EMS_OFFSET_JunkersSetMessage_night_temp; + } else if (mode_type == HeatingCircuit::Mode::DAY || mode_type == HeatingCircuit::Mode::HEAT) { + offset = EMS_OFFSET_JunkersSetMessage_day_temp; + } else { + offset = EMS_OFFSET_JunkersSetMessage_no_frost_temp; + } break; } @@ -1727,10 +1742,20 @@ void Thermostat::set_temperature(const float temperature, const uint8_t mode, co case HeatingCircuit::Mode::NIGHT: offset = EMS_OFFSET_JunkersSetMessage2_eco_temp; break; - default: case HeatingCircuit::Mode::HEAT: case HeatingCircuit::Mode::DAY: - offset = EMS_OFFSET_JunkersSetMessage3_heat; + offset = EMS_OFFSET_JunkersSetMessage2_heat_temp; + break; + default: + case HeatingCircuit::Mode::AUTO: // automatic selection, if no type is defined, we use the standard code + uint8_t mode_type = hc->get_mode_type(this->flags()); + if (mode_type == HeatingCircuit::Mode::NIGHT || mode_type == HeatingCircuit::Mode::ECO) { + offset = EMS_OFFSET_JunkersSetMessage2_eco_temp; + } else if (mode_type == HeatingCircuit::Mode::DAY || mode_type == HeatingCircuit::Mode::HEAT) { + offset = EMS_OFFSET_JunkersSetMessage2_heat_temp; + } else { + offset = EMS_OFFSET_JunkersSetMessage2_no_frost_temp; + } break; } } diff --git a/src/devices/thermostat.h b/src/devices/thermostat.h index 42f62ebf4..78cc80ac0 100644 --- a/src/devices/thermostat.h +++ b/src/devices/thermostat.h @@ -206,7 +206,7 @@ class Thermostat : public EMSdevice { static constexpr uint8_t EMS_OFFSET_JunkersSetMessage2_set_mode = 4; // EMS offset to set mode on thermostat static constexpr uint8_t EMS_OFFSET_JunkersSetMessage2_no_frost_temp = 5; static constexpr uint8_t EMS_OFFSET_JunkersSetMessage2_eco_temp = 6; - static constexpr uint8_t EMS_OFFSET_JunkersSetMessage3_heat = 7; + static constexpr uint8_t EMS_OFFSET_JunkersSetMessage2_heat_temp = 7; #define AUTO_HEATING_CIRCUIT 0 #define DEFAULT_HEATING_CIRCUIT 1