From 9ea1e2752d90bb99af6e4e33edf91d5025f0e04b Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Wed, 26 Mar 2025 17:30:33 +0100 Subject: [PATCH 1/3] update pkg, Grid2->Grid --- interface/package.json | 4 ++-- interface/src/app/main/CustomEntitiesDialog.tsx | 2 +- interface/src/app/main/Customizations.tsx | 2 +- interface/src/app/main/CustomizationsDialog.tsx | 2 +- interface/src/app/main/Devices.tsx | 2 +- interface/src/app/main/DevicesDialog.tsx | 2 +- interface/src/app/main/ModulesDialog.tsx | 2 +- interface/src/app/main/SchedulerDialog.tsx | 2 +- interface/src/app/main/SensorsAnalogDialog.tsx | 2 +- interface/src/app/main/SensorsTemperatureDialog.tsx | 2 +- interface/src/app/settings/ApplicationSettings.tsx | 2 +- interface/src/app/settings/DownloadUpload.tsx | 2 +- interface/src/app/settings/MqttSettings.tsx | 2 +- interface/src/app/status/SystemLog.tsx | 2 +- interface/src/app/status/Version.tsx | 2 +- 15 files changed, 16 insertions(+), 16 deletions(-) diff --git a/interface/package.json b/interface/package.json index 8a85c05fa..f50f1f448 100644 --- a/interface/package.json +++ b/interface/package.json @@ -24,8 +24,8 @@ "@alova/adapter-xhr": "2.1.1", "@emotion/react": "^11.14.0", "@emotion/styled": "^11.14.0", - "@mui/icons-material": "^6.4.8", - "@mui/material": "^6.4.8", + "@mui/icons-material": "^7.0.0", + "@mui/material": "^7.0.0", "@table-library/react-table-library": "4.1.12", "alova": "3.2.10", "async-validator": "^4.2.5", diff --git a/interface/src/app/main/CustomEntitiesDialog.tsx b/interface/src/app/main/CustomEntitiesDialog.tsx index 898ecc557..32550cf6c 100644 --- a/interface/src/app/main/CustomEntitiesDialog.tsx +++ b/interface/src/app/main/CustomEntitiesDialog.tsx @@ -12,7 +12,7 @@ import { DialogActions, DialogContent, DialogTitle, - Grid2 as Grid, + Grid, InputAdornment, MenuItem, TextField diff --git a/interface/src/app/main/Customizations.tsx b/interface/src/app/main/Customizations.tsx index da901c14b..06d25b478 100644 --- a/interface/src/app/main/Customizations.tsx +++ b/interface/src/app/main/Customizations.tsx @@ -16,7 +16,7 @@ import { DialogActions, DialogContent, DialogTitle, - Grid2 as Grid, + Grid, InputAdornment, Link, MenuItem, diff --git a/interface/src/app/main/CustomizationsDialog.tsx b/interface/src/app/main/CustomizationsDialog.tsx index 60488cbde..d738594b1 100644 --- a/interface/src/app/main/CustomizationsDialog.tsx +++ b/interface/src/app/main/CustomizationsDialog.tsx @@ -10,7 +10,7 @@ import { DialogActions, DialogContent, DialogTitle, - Grid2 as Grid, + Grid, TextField, Typography } from '@mui/material'; diff --git a/interface/src/app/main/Devices.tsx b/interface/src/app/main/Devices.tsx index 991f3ee3f..5f5de5fb1 100644 --- a/interface/src/app/main/Devices.tsx +++ b/interface/src/app/main/Devices.tsx @@ -31,7 +31,7 @@ import { DialogActions, DialogContent, DialogTitle, - Grid2 as Grid, + Grid, IconButton, InputAdornment, List, diff --git a/interface/src/app/main/DevicesDialog.tsx b/interface/src/app/main/DevicesDialog.tsx index 21789a33d..35054b31e 100644 --- a/interface/src/app/main/DevicesDialog.tsx +++ b/interface/src/app/main/DevicesDialog.tsx @@ -11,7 +11,7 @@ import { DialogContent, DialogTitle, FormHelperText, - Grid2 as Grid, + Grid, InputAdornment, MenuItem, TextField, diff --git a/interface/src/app/main/ModulesDialog.tsx b/interface/src/app/main/ModulesDialog.tsx index 9ba069c89..570c9ab14 100644 --- a/interface/src/app/main/ModulesDialog.tsx +++ b/interface/src/app/main/ModulesDialog.tsx @@ -10,7 +10,7 @@ import { DialogActions, DialogContent, DialogTitle, - Grid2 as Grid, + Grid, TextField } from '@mui/material'; diff --git a/interface/src/app/main/SchedulerDialog.tsx b/interface/src/app/main/SchedulerDialog.tsx index c647ffc6e..89838c246 100644 --- a/interface/src/app/main/SchedulerDialog.tsx +++ b/interface/src/app/main/SchedulerDialog.tsx @@ -13,7 +13,7 @@ import { DialogActions, DialogContent, DialogTitle, - Grid2 as Grid, + Grid, TextField, ToggleButton, ToggleButtonGroup, diff --git a/interface/src/app/main/SensorsAnalogDialog.tsx b/interface/src/app/main/SensorsAnalogDialog.tsx index d82601d5e..6ee9e17e3 100644 --- a/interface/src/app/main/SensorsAnalogDialog.tsx +++ b/interface/src/app/main/SensorsAnalogDialog.tsx @@ -10,7 +10,7 @@ import { DialogActions, DialogContent, DialogTitle, - Grid2 as Grid, + Grid, InputAdornment, MenuItem, TextField, diff --git a/interface/src/app/main/SensorsTemperatureDialog.tsx b/interface/src/app/main/SensorsTemperatureDialog.tsx index 63733113a..c564b7eda 100644 --- a/interface/src/app/main/SensorsTemperatureDialog.tsx +++ b/interface/src/app/main/SensorsTemperatureDialog.tsx @@ -9,7 +9,7 @@ import { DialogActions, DialogContent, DialogTitle, - Grid2 as Grid, + Grid, InputAdornment, TextField, Typography diff --git a/interface/src/app/settings/ApplicationSettings.tsx b/interface/src/app/settings/ApplicationSettings.tsx index 3359ae477..11d02eb37 100644 --- a/interface/src/app/settings/ApplicationSettings.tsx +++ b/interface/src/app/settings/ApplicationSettings.tsx @@ -9,7 +9,7 @@ import { Button, Checkbox, Divider, - Grid2 as Grid, + Grid, InputAdornment, MenuItem, TextField, diff --git a/interface/src/app/settings/DownloadUpload.tsx b/interface/src/app/settings/DownloadUpload.tsx index a4a4daafe..dcbb63e6d 100644 --- a/interface/src/app/settings/DownloadUpload.tsx +++ b/interface/src/app/settings/DownloadUpload.tsx @@ -2,7 +2,7 @@ import { useState } from 'react'; import { toast } from 'react-toastify'; import DownloadIcon from '@mui/icons-material/GetApp'; -import { Box, Button, Grid2 as Grid, Typography } from '@mui/material'; +import { Box, Button, Grid, Typography } from '@mui/material'; import * as SystemApi from 'api/system'; import { API, callAction } from 'api/app'; diff --git a/interface/src/app/settings/MqttSettings.tsx b/interface/src/app/settings/MqttSettings.tsx index a03f139b9..8cbac5d9e 100644 --- a/interface/src/app/settings/MqttSettings.tsx +++ b/interface/src/app/settings/MqttSettings.tsx @@ -5,7 +5,7 @@ import WarningIcon from '@mui/icons-material/Warning'; import { Button, Checkbox, - Grid2 as Grid, + Grid, InputAdornment, MenuItem, TextField, diff --git a/interface/src/app/status/SystemLog.tsx b/interface/src/app/status/SystemLog.tsx index ee0207713..730881ff2 100644 --- a/interface/src/app/status/SystemLog.tsx +++ b/interface/src/app/status/SystemLog.tsx @@ -8,7 +8,7 @@ import { Box, Button, Checkbox, - Grid2 as Grid, + Grid, IconButton, MenuItem, TextField, diff --git a/interface/src/app/status/Version.tsx b/interface/src/app/status/Version.tsx index b8fc7881b..607906365 100644 --- a/interface/src/app/status/Version.tsx +++ b/interface/src/app/status/Version.tsx @@ -15,7 +15,7 @@ import { DialogContent, DialogTitle, FormControlLabel, - Grid2 as Grid, + Grid, Link, Typography } from '@mui/material'; From 3a0b4ea5871d712d6b69f3178f238206a34287c9 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Thu, 27 Mar 2025 13:57:59 +0100 Subject: [PATCH 2/3] fix switch to secure mqtt #2492 --- src/ESP32React/MqttSettingsService.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/ESP32React/MqttSettingsService.cpp b/src/ESP32React/MqttSettingsService.cpp index f2140e071..f6fb78872 100644 --- a/src/ESP32React/MqttSettingsService.cpp +++ b/src/ESP32React/MqttSettingsService.cpp @@ -34,7 +34,7 @@ void MqttSettingsService::startClient() { static bool isSecure = false; if (_mqttClient != nullptr) { // do we need to change the client? - if ((isSecure && _state.enableTLS) || (!isSecure && _state.enableTLS)) { + if ((isSecure && _state.enableTLS) || (!isSecure && !_state.enableTLS)) { return; } delete _mqttClient; @@ -48,11 +48,9 @@ void MqttSettingsService::startClient() { } else { _mqttClient = new espMqttClientSecure(espMqttClientTypes::UseInternalTask::NO); } - if (_state.rootCA == "insecure") { - static_cast(_mqttClient)->setInsecure(); - } else { - String certificate = "-----BEGIN CERTIFICATE-----\n" + _state.rootCA + "\n-----END CERTIFICATE-----\n"; - static_cast(_mqttClient)->setCACert(certificate.c_str()); + if (!_mqttClient) { + emsesp::EMSESP::logger().warning("MQTT Client alloc failed"); + return; } static_cast(_mqttClient)->onConnect([this](bool sessionPresent) { onMqttConnect(sessionPresent); }); static_cast(_mqttClient)->onDisconnect([this](espMqttClientTypes::DisconnectReason reason) { onMqttDisconnect(reason); }); @@ -185,9 +183,14 @@ bool MqttSettingsService::configureMqtt() { _reconfigureMqtt = false; #ifndef TASMOTA_SDK if (_state.enableTLS) { -#if defined(EMSESP_DEBUG) - emsesp::EMSESP::logger().debug("Start secure MQTT with rootCA"); -#endif + if (_state.rootCA == "insecure") { + emsesp::EMSESP::logger().debug("Start insecure MQTT"); + static_cast(_mqttClient)->setInsecure(); + } else { + emsesp::EMSESP::logger().debug("Start secure MQTT with rootCA"); + String certificate = "-----BEGIN CERTIFICATE-----\n" + _state.rootCA + "\n-----END CERTIFICATE-----\n"; + static_cast(_mqttClient)->setCACert(certificate.c_str()); + } static_cast(_mqttClient)->setServer(_state.host.c_str(), _state.port); if (_state.username.length() > 0) { static_cast(_mqttClient) From c5dbd7452ea36c759816bfa7d10f3981adefdc6e Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Thu, 27 Mar 2025 17:23:42 +0100 Subject: [PATCH 3/3] add auxHeaterSource #2489 --- CHANGELOG_LATEST.md | 4 +++- src/core/locale_common.h | 1 + src/core/locale_translations.h | 7 ++++++- src/core/modbus_entity_parameters.hpp | 2 +- src/devices/boiler.cpp | 16 +++++++++++----- src/devices/boiler.h | 4 ++-- src/version.h | 2 +- 7 files changed, 25 insertions(+), 11 deletions(-) diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index fffbdbcf8..183e01c9c 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -7,11 +7,13 @@ For more details go to [docs.emsesp.org](https://docs.emsesp.org/). ## Added - analogsensor types: NTC and RGB-Led -- Flag for HMC310 +- Flag for HMC310 [#2465](https://github.com/emsesp/EMS-ESP32/issues/2465) +- boiler auxheatersource [#2489](https://github.com/emsesp/EMS-ESP32/discussions/2489) ## Fixed - dhw/switchtime [#2490](https://github.com/emsesp/EMS-ESP32/issues/2490) +- switch to secure mqtt [#2492](https://github.com/emsesp/EMS-ESP32/issues/2492) ## Changed diff --git a/src/core/locale_common.h b/src/core/locale_common.h index a3cca81ce..2718db83f 100644 --- a/src/core/locale_common.h +++ b/src/core/locale_common.h @@ -369,6 +369,7 @@ MAKE_ENUM(enum_lowNoiseMode, FL_(off), FL_(reduced_output), FL_(switchoff), FL_( MAKE_ENUM(enum_hpactivity, FL_(off), FL_(heating), FL_(cooling), FL_(hot_water), FL_(pool), FL_(pool_heating), FL_(defrost), FL_(compressor_alarm)) // BV name COMPRESSOR_E21_STATUS MAKE_ENUM(enum_silentMode, FL_(off), FL_(auto), FL_(on)) MAKE_ENUM(enum_4way, FL_(cool_defrost), FL_(heat_ww)) +MAKE_ENUM(enum_auxHeaterSource, FL_(not_installed), FL_(el_heater), FL_(exclusive), FL_(parallel), FL_(hybrid)) // solar MAKE_ENUM(enum_solarmode, FL_(constant), FL_(pwm), FL_(analog)) diff --git a/src/core/locale_translations.h b/src/core/locale_translations.h index 87b45a9ad..0c4d896ea 100644 --- a/src/core/locale_translations.h +++ b/src/core/locale_translations.h @@ -231,6 +231,11 @@ MAKE_WORD_TRANSLATION(perm, "perm. reduced", "perm. reduziert", "permanent gered MAKE_WORD_TRANSLATION(heat_ww, "heating & dhw", "Heizen & Warmwasser", "", "Uppvärmning & Varmvatten", "ogrzewanie i c.w.u.", "", "", "", "", "kúrenie a TÚV", "topení a TUV") MAKE_WORD_TRANSLATION(cool_defrost, "cooling & defrost", "Kühlen & Abtauen", "", "Kyla & Avfrostning", "chłodzenie i odladzanie", "", "", "", "", "chladenie a rozmrazovanie", "chlazení a odmrazování") MAKE_WORD_TRANSLATION(compressor_alarm, "compressor alarm", "Alarm Kompressor", "", "", "", "", "", "", "", "alarm kompresora", "") +MAKE_WORD_TRANSLATION(not_installed, "not installed", "Nicht installiert") // TODO translate +MAKE_WORD_TRANSLATION(el_heater, "electric heater", "Elektroheizer") // TODO translate +MAKE_WORD_TRANSLATION(exclusive, "exclusive", "Exklusiv") // TODO translate +MAKE_WORD_TRANSLATION(parallel, "parallel", "Parallel") // TODO translate +MAKE_WORD_TRANSLATION(hybrid, "hybrid", "Hybrid") // TODO translate // thermostat MAKE_WORD_TRANSLATION(seltemp, "selTemp", "Solltemperatur", "doeltemperatuur", "Börtemperatur", "temperatura zadana", "innstilt temperatur", "consigne température", "ayarlanmış sıcaklık", "temperatura di consegna", "zadaná teplota", "zvolená teplota") @@ -483,7 +488,7 @@ MAKE_TRANSLATION(wwEcoPlusStopTemp, "ecoplusstop", "eco+ stop temp", "ECO+ Stopp MAKE_TRANSLATION(auxHeatMode, "auxheatrmode", "aux heater mode", "Zusatzheizungsmodus", "Modus bijverwarmer", "Eltillskott Läge", "tryb pracy dogrzewacza po blokadzie z Zakładu Energetycznego", "tilleggsvarmer modus", "", "ilave ısıtıcı modu", "modalità riscaldatore addizionale", "režim pomocného ohrievača", "režim pomocného topení") // TODO translate MAKE_TRANSLATION(auxMaxLimit, "auxmaxlimit", "aux heater max limit", "Zusatzheizer max. Grenze", "Bijverwarmer grensinstelling maximaal", "Eltillskott max begränsning", "dogrzewacz, maksymalny limit", "tillegsvarme maksgrense", "ilave ısıtıcı maks limit", "limite massimo riscaldatore addizionale", "maximálny limit pomocného ohrievača", "maximální limit pomocného topení") MAKE_TRANSLATION(auxLimitStart, "auxlimitstart", "aux heater limit start", "Zusatzheizer Grenze Start", "Bijverwarmer grens voor start", "Eltillskott begränsningsstart", "dogrzewacz, początek ograniczenia", "tillegsvarme startgrense", "ilave ısıtıcı limir başlangıcı", "avvio limite massimo riscaldatore addizionale", "spustenie limitu pomocného ohrievača", "startovací limit pomocného topení") -MAKE_TRANSLATION(manDefrost, "mandefrost", "manual defrost", "Manuelle Enteisung", "Handmatige ontdooicyclus", "Manuell avfrostning", "ręczne odladzanie", "manuell avisning", "", "manuel buz çözme", "sbrinamento manuale", "manuálne odmrazovanie", "ruční odmrazování") // TODO translate +MAKE_TRANSLATION(auxHeaterSource, "auxheatersource", "aux heater source", "Quelle Zusatzheizer") // TODO translate MAKE_TRANSLATION(pvCooling, "pvcooling", "cooling only with PV", "Kühlen nur mit PV", "Koelen alleen met solar PV", "Kyla endast med solpanel", "chłodzenie tylko z PV", "kjøling med solpanel", "", "sadece PV ile soğutma", "solo raffrescamento con solare", "Chladenie len s FV", "chlazení pouze s FV") // TODO translate MAKE_TRANSLATION(hpCircPumpWw, "hpcircpump", "circulation pump available during dhw", "Zirkulation möglich bei WW-Bereitung", "Circulatiepomp WP beschikbaar tijdens ww", "Värmebärarpump på vid varmvattenberedning", "pompa cyrkulacji dostępna w trakcie c.w.u.", "sirkulasjonspumpe tilgjengelig under varmtvann", "", "SKS esnasında sirkülasyon pompasu uygun", "pompa di circolazione disponibile durante ACS", "obehové čerpadlo k dispozícii počas TÚV", "oběhové čerpadlo dostupné během TUV") // TODO translate MAKE_TRANSLATION(vp_cooling, "vpcooling", "valve/pump cooling", "Ventil/Pumpe für Kühlen", "Klep koeling", "Ventil/Pump kyla", "zawór/pompa chłodzenia", "varmepumpe kjøling", "", "vana/pompa soğuyor", "valvola/pompa raffrescamento", "chladenie ventilu/čerpadla", "ventil/čerpadlo chlazení") // TODO translate diff --git a/src/core/modbus_entity_parameters.hpp b/src/core/modbus_entity_parameters.hpp index ca33612ac..3b1e5e2d1 100644 --- a/src/core/modbus_entity_parameters.hpp +++ b/src/core/modbus_entity_parameters.hpp @@ -127,7 +127,7 @@ const std::initializer_list Modbus::modbus_register_ma REGISTER_MAPPING(dt::BOILER, TAG_TYPE_DEVICE_DATA, FL_(hpIn4Opt), 198, 8), // hpin4opt REGISTER_MAPPING(dt::BOILER, TAG_TYPE_DEVICE_DATA, FL_(maxHeatComp), 206, 1), // maxheatcomp REGISTER_MAPPING(dt::BOILER, TAG_TYPE_DEVICE_DATA, FL_(maxHeatHeat), 207, 1), // maxheatheat - REGISTER_MAPPING(dt::BOILER, TAG_TYPE_DEVICE_DATA, FL_(manDefrost), 208, 1), // mandefrost + REGISTER_MAPPING(dt::BOILER, TAG_TYPE_DEVICE_DATA, FL_(auxHeaterSource), 208, 1), // auxheatersource REGISTER_MAPPING(dt::BOILER, TAG_TYPE_DEVICE_DATA, FL_(pvCooling), 209, 1), // pvcooling REGISTER_MAPPING(dt::BOILER, TAG_TYPE_DEVICE_DATA, FL_(auxHeaterOnly), 210, 1), // auxheateronly REGISTER_MAPPING(dt::BOILER, TAG_TYPE_DEVICE_DATA, FL_(auxHeaterOff), 211, 1), // auxheateroff diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index 56421036e..956adfc25 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -675,7 +675,13 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const FL_(maxHeatDhw), DeviceValueUOM::NONE, MAKE_CF_CB(set_maxHeatDhw)); - register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &manDefrost_, DeviceValueType::BOOL, FL_(manDefrost), DeviceValueUOM::NONE, MAKE_CF_CB(set_manDefrost)); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, + &auxHeaterSource_, + DeviceValueType::ENUM, + FL_(enum_auxHeaterSource), + FL_(auxHeaterSource), + DeviceValueUOM::NONE, + MAKE_CF_CB(set_auxHeaterSource)); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &pvCooling_, DeviceValueType::BOOL, FL_(pvCooling), DeviceValueUOM::NONE, MAKE_CF_CB(set_pvCooling)); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &auxHeaterOnly_, @@ -2004,7 +2010,7 @@ void Boiler::process_HpPump2(std::shared_ptr telegram) { // Boiler(0x08) -> All(0x00), ?(0x0491), data: 03 01 00 00 00 02 64 00 00 14 01 2C 00 0A 00 1E 00 1E 00 00 1E 0A 1E 05 05 void Boiler::process_HpAdditionalHeater(std::shared_ptr telegram) { - has_update(telegram, manDefrost_, 0); // off/on + has_update(telegram, auxHeaterSource_, 0); // https://github.com/emsesp/EMS-ESP32/discussions/2489 has_update(telegram, auxHeaterOnly_, 1); has_update(telegram, auxHeaterOff_, 2); has_update(telegram, auxHeatMode_, 4); // eco/comfort @@ -3085,9 +3091,9 @@ bool Boiler::set_auxLimit(const char * value, const int8_t id) { return false; } -bool Boiler::set_manDefrost(const char * value, const int8_t id) { - bool v; - if (Helpers::value2bool(value, v)) { +bool Boiler::set_auxHeaterSource(const char * value, const int8_t id) { + uint8_t v; + if (Helpers::value2enum(value, v, FL_(enum_auxHeaterSource))) { write_command(0x491, 0, v ? 1 : 0, 0x491); return true; } diff --git a/src/devices/boiler.h b/src/devices/boiler.h index e8783aa0d..694374e32 100644 --- a/src/devices/boiler.h +++ b/src/devices/boiler.h @@ -259,10 +259,10 @@ class Boiler : public EMSdevice { uint8_t powerReduction_; uint8_t pvCooling_; - uint8_t manDefrost_; uint8_t auxHeatMode_; uint8_t auxMaxLimit_; uint8_t auxLimitStart_; + uint8_t auxHeaterSource_; uint8_t auxHeaterOnly_; uint8_t auxHeaterOff_; uint8_t auxHeaterStatus_; @@ -475,7 +475,7 @@ class Boiler : public EMSdevice { bool set_additionalHeaterDelay(const char * value, const int8_t id); bool set_tempParMode(const char * value, const int8_t id); bool set_auxHeatMode(const char * value, const int8_t id); - bool set_manDefrost(const char * value, const int8_t id); + bool set_auxHeaterSource(const char * value, const int8_t id); bool set_pvCooling(const char * value, const int8_t id); bool set_hpCircPumpWw(const char * value, const int8_t id); bool set_hpPumpMode(const char * value, const int8_t id); diff --git a/src/version.h b/src/version.h index 06be1ce7a..4cedd7c62 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define EMSESP_APP_VERSION "3.7.3-dev.2" +#define EMSESP_APP_VERSION "3.7.3-dev.3"