From 5e07e9a11be26a49738bf220226d1c4c8aafce0a Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Thu, 8 Jan 2026 12:06:48 +0100 Subject: [PATCH 1/8] add ha number mode selection #2900 --- interface/src/app/settings/MqttSettings.tsx | 14 ++++++++++++++ interface/src/i18n/cz/index.ts | 1 + interface/src/i18n/de/index.ts | 1 + interface/src/i18n/en/index.ts | 1 + interface/src/i18n/fr/index.ts | 1 + interface/src/i18n/it/index.ts | 1 + interface/src/i18n/nl/index.ts | 1 + interface/src/i18n/no/index.ts | 1 + interface/src/i18n/pl/index.ts | 1 + interface/src/i18n/sk/index.ts | 1 + interface/src/i18n/sv/index.ts | 1 + interface/src/i18n/tr/index.ts | 1 + interface/src/types/mqtt.ts | 1 + src/ESP32React/MqttSettingsService.cpp | 2 ++ src/ESP32React/MqttSettingsService.h | 1 + src/core/default_settings.h | 4 ++++ src/core/mqtt.cpp | 10 ++++++++-- src/core/mqtt.h | 1 + 18 files changed, 42 insertions(+), 2 deletions(-) diff --git a/interface/src/app/settings/MqttSettings.tsx b/interface/src/app/settings/MqttSettings.tsx index 2d02f94b3..662f9a620 100644 --- a/interface/src/app/settings/MqttSettings.tsx +++ b/interface/src/app/settings/MqttSettings.tsx @@ -411,6 +411,20 @@ const MqttSettings = () => { + + + Box + Slider + + )} diff --git a/interface/src/i18n/cz/index.ts b/interface/src/i18n/cz/index.ts index efc1c6887..cc8173df0 100644 --- a/interface/src/i18n/cz/index.ts +++ b/interface/src/i18n/cz/index.ts @@ -219,6 +219,7 @@ const cz: Translation = { MQTT_PUBLISH_TEXT_3: 'Povolit MQTT Discovery', MQTT_PUBLISH_TEXT_4: 'Prefix pro Discovery témata', MQTT_PUBLISH_TEXT_5: 'Typ Discovery', + MQTT_PUBLISH_TEXT_6: 'Number mode', MQTT_PUBLISH_INTERVALS: 'Intervaly publikování', MQTT_INT_BOILER: 'Kotle a tepelná čerpadla', MQTT_INT_THERMOSTATS: 'Termostaty', diff --git a/interface/src/i18n/de/index.ts b/interface/src/i18n/de/index.ts index 8aa4e1dc8..969708d2d 100644 --- a/interface/src/i18n/de/index.ts +++ b/interface/src/i18n/de/index.ts @@ -219,6 +219,7 @@ const de: Translation = { MQTT_PUBLISH_TEXT_3: 'Aktiviere `MQTT Discovery`', MQTT_PUBLISH_TEXT_4: 'Prefix für die `Discovery`-Topics', MQTT_PUBLISH_TEXT_5: 'Discovery Typ', + MQTT_PUBLISH_TEXT_6: 'Number mode', MQTT_PUBLISH_INTERVALS: 'Veröffentlichungs-Intervalle', MQTT_INT_BOILER: 'Boiler und Wärmepumpen', MQTT_INT_THERMOSTATS: 'Thermostate', diff --git a/interface/src/i18n/en/index.ts b/interface/src/i18n/en/index.ts index bdb05a480..c561cd0ba 100644 --- a/interface/src/i18n/en/index.ts +++ b/interface/src/i18n/en/index.ts @@ -219,6 +219,7 @@ const en: Translation = { MQTT_PUBLISH_TEXT_3: 'Enable MQTT Discovery', MQTT_PUBLISH_TEXT_4: 'Prefix for the Discovery topics', MQTT_PUBLISH_TEXT_5: 'Discovery type', + MQTT_PUBLISH_TEXT_6: 'Number mode', MQTT_PUBLISH_INTERVALS: 'Publish Intervals', MQTT_INT_BOILER: 'Boilers and Heat Pumps', MQTT_INT_THERMOSTATS: 'Thermostats', diff --git a/interface/src/i18n/fr/index.ts b/interface/src/i18n/fr/index.ts index 008df1fcd..80499a5df 100644 --- a/interface/src/i18n/fr/index.ts +++ b/interface/src/i18n/fr/index.ts @@ -219,6 +219,7 @@ const fr: Translation = { MQTT_PUBLISH_TEXT_3: 'Activer la découverte MQTT', MQTT_PUBLISH_TEXT_4: 'Préfixe pour les topics découverte', MQTT_PUBLISH_TEXT_5: 'Type de découverte', + MQTT_PUBLISH_TEXT_6: 'Number mode', MQTT_PUBLISH_INTERVALS: 'Intervalles de publication', MQTT_INT_BOILER: 'Chaudières et pompes à chaleur', MQTT_INT_THERMOSTATS: 'Thermostats', diff --git a/interface/src/i18n/it/index.ts b/interface/src/i18n/it/index.ts index cd38ed18a..f8d557d94 100644 --- a/interface/src/i18n/it/index.ts +++ b/interface/src/i18n/it/index.ts @@ -219,6 +219,7 @@ const it: Translation = { MQTT_PUBLISH_TEXT_3: 'Abilita rilevamento MQTT (Home Assistant, Domoticz)', MQTT_PUBLISH_TEXT_4: 'Prefisso per gli argomenti di scoperta', MQTT_PUBLISH_TEXT_5: 'Discovery type', + MQTT_PUBLISH_TEXT_6: 'Number mode', MQTT_PUBLISH_INTERVALS: 'Pubblica intervalli', MQTT_INT_BOILER: 'Caldaie e Pompe di Calore', MQTT_INT_THERMOSTATS: 'Termostati', diff --git a/interface/src/i18n/nl/index.ts b/interface/src/i18n/nl/index.ts index 3f23c42db..57d026140 100644 --- a/interface/src/i18n/nl/index.ts +++ b/interface/src/i18n/nl/index.ts @@ -219,6 +219,7 @@ const nl: Translation = { MQTT_PUBLISH_TEXT_3: 'Activeer MQTT Discovery', MQTT_PUBLISH_TEXT_4: 'Prefix voor de Discovery topics', MQTT_PUBLISH_TEXT_5: 'Discovery type', + MQTT_PUBLISH_TEXT_6: 'Number mode', MQTT_PUBLISH_INTERVALS: 'Publicatie intervallen', MQTT_INT_BOILER: 'CV ketels en warmtepompen', MQTT_INT_THERMOSTATS: 'Thermostaten', diff --git a/interface/src/i18n/no/index.ts b/interface/src/i18n/no/index.ts index 88af2bc43..60d0a485d 100644 --- a/interface/src/i18n/no/index.ts +++ b/interface/src/i18n/no/index.ts @@ -219,6 +219,7 @@ const no: Translation = { MQTT_PUBLISH_TEXT_3: 'Aktiver MQTT Discovery', MQTT_PUBLISH_TEXT_4: 'Prefiks for Discovery topics', MQTT_PUBLISH_TEXT_5: 'Discovery type', + MQTT_PUBLISH_TEXT_6: 'Number mode', MQTT_PUBLISH_INTERVALS: 'Publiseringsintervall', MQTT_INT_BOILER: 'Fyr/Varmepumpe', MQTT_INT_THERMOSTATS: 'Termostat', diff --git a/interface/src/i18n/pl/index.ts b/interface/src/i18n/pl/index.ts index 07b003447..2135d8e97 100644 --- a/interface/src/i18n/pl/index.ts +++ b/interface/src/i18n/pl/index.ts @@ -219,6 +219,7 @@ const pl: BaseTranslation = { MQTT_PUBLISH_TEXT_3: 'Włącz opcję "MQTT discovery"', MQTT_PUBLISH_TEXT_4: 'Prefiks dla "MQTT discovery"', MQTT_PUBLISH_TEXT_5: 'Typ "MQTT discovery"', + MQTT_PUBLISH_TEXT_6: 'Number mode', MQTT_PUBLISH_INTERVALS: 'Interwały publikowania', MQTT_INT_BOILER: 'Kotły i pompy ciepła', MQTT_INT_THERMOSTATS: 'Termostaty', diff --git a/interface/src/i18n/sk/index.ts b/interface/src/i18n/sk/index.ts index 7950f2e05..635d1eb4c 100644 --- a/interface/src/i18n/sk/index.ts +++ b/interface/src/i18n/sk/index.ts @@ -219,6 +219,7 @@ const sk: Translation = { MQTT_PUBLISH_TEXT_3: 'Povolenie zisťovania MQTT', MQTT_PUBLISH_TEXT_4: 'Predpona tém Discovery', MQTT_PUBLISH_TEXT_5: 'Typ zistenia', + MQTT_PUBLISH_TEXT_6: 'Number mode', MQTT_PUBLISH_INTERVALS: 'Intervaly zverejňovania', MQTT_INT_BOILER: 'Kotly a tepelné čerpadlá', MQTT_INT_THERMOSTATS: 'Termostaty', diff --git a/interface/src/i18n/sv/index.ts b/interface/src/i18n/sv/index.ts index a8fd58d23..79bee288f 100644 --- a/interface/src/i18n/sv/index.ts +++ b/interface/src/i18n/sv/index.ts @@ -219,6 +219,7 @@ const sv: Translation = { MQTT_PUBLISH_TEXT_3: 'Aktivera MQTT Discovery', MQTT_PUBLISH_TEXT_4: 'Prefix för Discovery topics', MQTT_PUBLISH_TEXT_5: 'Discoverytyp', + MQTT_PUBLISH_TEXT_6: 'Number mode', MQTT_PUBLISH_INTERVALS: 'Publiceringsintervall', MQTT_INT_BOILER: 'Värmepump/panna', MQTT_INT_THERMOSTATS: 'Termostater', diff --git a/interface/src/i18n/tr/index.ts b/interface/src/i18n/tr/index.ts index d931077f1..f27982ca8 100644 --- a/interface/src/i18n/tr/index.ts +++ b/interface/src/i18n/tr/index.ts @@ -219,6 +219,7 @@ const tr: Translation = { MQTT_PUBLISH_TEXT_3: 'MQTT keşfi etkinleştir (Home Assistant, Domoticz)', MQTT_PUBLISH_TEXT_4: 'Keşif konuları için ön ek', MQTT_PUBLISH_TEXT_5: 'Domoticz Format', + MQTT_PUBLISH_TEXT_6: 'Number mode', MQTT_PUBLISH_INTERVALS: 'Yayınlama aralıkları', MQTT_INT_BOILER: 'Kazanlar ve Isı Pompaları', MQTT_INT_THERMOSTATS: 'Termostatlar', diff --git a/interface/src/types/mqtt.ts b/interface/src/types/mqtt.ts index 738dafa75..346df7fe6 100644 --- a/interface/src/types/mqtt.ts +++ b/interface/src/types/mqtt.ts @@ -49,4 +49,5 @@ export interface MqttSettingsType { publish_single2cmd: boolean; discovery_prefix: string; discovery_type: number; + ha_number_mode: number; } diff --git a/src/ESP32React/MqttSettingsService.cpp b/src/ESP32React/MqttSettingsService.cpp index d616f3491..11c84462e 100644 --- a/src/ESP32React/MqttSettingsService.cpp +++ b/src/ESP32React/MqttSettingsService.cpp @@ -248,6 +248,7 @@ void MqttSettings::read(MqttSettings & settings, JsonObject root) { root["nested_format"] = settings.nested_format; root["discovery_prefix"] = settings.discovery_prefix; root["discovery_type"] = settings.discovery_type; + root["ha_number_mode"] = settings.ha_number_mode; root["publish_single"] = settings.publish_single; root["publish_single2cmd"] = settings.publish_single2cmd; root["send_response"] = settings.send_response; @@ -288,6 +289,7 @@ StateUpdateResult MqttSettings::update(JsonObject root, MqttSettings & settings) newSettings.nested_format = static_cast(root["nested_format"] | EMSESP_DEFAULT_NESTED_FORMAT); newSettings.discovery_prefix = root["discovery_prefix"] | EMSESP_DEFAULT_DISCOVERY_PREFIX; newSettings.discovery_type = static_cast(root["discovery_type"] | EMSESP_DEFAULT_DISCOVERY_TYPE); + newSettings.ha_number_mode = static_cast(root["ha_number_mode"] | EMSESP_DEFAULT_HA_NUMBER_MODE); newSettings.publish_single = root["publish_single"] | EMSESP_DEFAULT_PUBLISH_SINGLE; newSettings.publish_single2cmd = root["publish_single2cmd"] | EMSESP_DEFAULT_PUBLISH_SINGLE2CMD; newSettings.send_response = root["send_response"] | EMSESP_DEFAULT_SEND_RESPONSE; diff --git a/src/ESP32React/MqttSettingsService.h b/src/ESP32React/MqttSettingsService.h index b31859201..83cf751dd 100644 --- a/src/ESP32React/MqttSettingsService.h +++ b/src/ESP32React/MqttSettingsService.h @@ -93,6 +93,7 @@ class MqttSettings { uint8_t nested_format = EMSESP_DEFAULT_NESTED_FORMAT; String discovery_prefix = EMSESP_DEFAULT_DISCOVERY_PREFIX; uint8_t discovery_type = EMSESP_DEFAULT_DISCOVERY_TYPE; + uint8_t ha_number_mode = EMSESP_DEFAULT_HA_NUMBER_MODE; bool publish_single = EMSESP_DEFAULT_PUBLISH_SINGLE; bool publish_single2cmd = EMSESP_DEFAULT_PUBLISH_SINGLE2CMD; bool send_response = EMSESP_DEFAULT_SEND_RESPONSE; diff --git a/src/core/default_settings.h b/src/core/default_settings.h index 6ef742329..86a2683b1 100644 --- a/src/core/default_settings.h +++ b/src/core/default_settings.h @@ -210,6 +210,10 @@ #define EMSESP_DEFAULT_DISCOVERY_TYPE 0 // HA #endif +#ifndef EMSESP_DEFAULT_HA_NUMBER_MODE +#define EMSESP_DEFAULT_HA_NUMBER_MODE 0 // BOX +#endif + #ifndef EMSESP_DEFAULT_PUBLISH_SINGLE #define EMSESP_DEFAULT_PUBLISH_SINGLE false #endif diff --git a/src/core/mqtt.cpp b/src/core/mqtt.cpp index e1e664d71..03d9b2eb5 100644 --- a/src/core/mqtt.cpp +++ b/src/core/mqtt.cpp @@ -43,6 +43,7 @@ bool Mqtt::ha_enabled_; uint8_t Mqtt::nested_format_; std::string Mqtt::discovery_prefix_; uint8_t Mqtt::discovery_type_; +uint8_t Mqtt::ha_number_mode_; bool Mqtt::send_response_; bool Mqtt::publish_single_; bool Mqtt::publish_single2cmd_; @@ -343,6 +344,7 @@ void Mqtt::load_settings() { discovery_prefix_ = mqttSettings.discovery_prefix.c_str(); entity_format_ = mqttSettings.entity_format; discovery_type_ = mqttSettings.discovery_type; + ha_number_mode_ = mqttSettings.ha_number_mode; // convert to milliseconds publish_time_boiler_ = mqttSettings.publish_time_boiler * 1000; @@ -1024,8 +1026,12 @@ bool Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev snprintf(sample_val, sizeof(sample_val), "'%s'", Helpers::translated_word(options[0])); } } else if (type != DeviceValueType::STRING && type != DeviceValueType::BOOL) { - // For numeric's add the range - doc["mode"] = "box"; // auto, slider or box + // For numeric's add the range and mode + if (ha_number_mode_ == 1 && (dv_set_max - dv_set_min) <= 100) { + doc["mode"] = "slider"; + } else { + doc["mode"] = "box"; // auto, slider or box + } if (num_op > 0) { doc["step"] = 1.0 / num_op; } else if (num_op < 0) { diff --git a/src/core/mqtt.h b/src/core/mqtt.h index 8a2f82137..c6e754fb4 100644 --- a/src/core/mqtt.h +++ b/src/core/mqtt.h @@ -341,6 +341,7 @@ class Mqtt { static uint8_t entity_format_; static std::string discovery_prefix_; static uint8_t discovery_type_; + static uint8_t ha_number_mode_; static bool publish_single_; static bool publish_single2cmd_; static bool send_response_; From f6d1c87eaf3b8f795d38efbd3e4c3e5ae5ea054c Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Thu, 8 Jan 2026 12:07:00 +0100 Subject: [PATCH 2/8] skip trailing zeros --- src/core/helpers.cpp | 23 ++++++++++++++++------- src/core/helpers.h | 2 ++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/core/helpers.cpp b/src/core/helpers.cpp index 9bd6d3d27..824097f44 100644 --- a/src/core/helpers.cpp +++ b/src/core/helpers.cpp @@ -207,6 +207,18 @@ char * Helpers::render_boolean(char * result, const bool value, const bool dashb return result; } +char * Helpers::remove_trailing_zero(char * result) { + if (strchr(result, '.')) { + while (result[strlen(result) - 1] == '0') { + result[strlen(result) - 1] = '\0'; + } + if (result[strlen(result) - 1] == '.') { + result[strlen(result) - 1] = '\0'; + } + } + return result; +} + // convert unsigned int (single byte) to text value and returns it // format: 255(0xFF)=boolean, 0=no formatting, otherwise divide by format char * Helpers::render_value(char * result, uint8_t value, int8_t format, const uint8_t fahrenheit) { @@ -240,14 +252,11 @@ char * Helpers::render_value(char * result, uint8_t value, int8_t format, const strlcpy(result, itoa(new_value >> 1, s2, 10), 5); strlcat(result, ".", 5); strlcat(result, ((new_value & 0x01) ? "5" : "0"), 7); - return result; } else if (format == 4) { strlcpy(result, itoa(new_value >> 2, s2, 10), 5); strlcat(result, ".", 5); new_value = (new_value & 0x03) * 25; strlcat(result, itoa(new_value, s2, 10), 7); - return result; - } else if (format > 0) { strlcpy(result, itoa(new_value / format, s2, 10), 5); strlcat(result, ".", 5); @@ -256,7 +265,7 @@ char * Helpers::render_value(char * result, uint8_t value, int8_t format, const strlcpy(result, itoa(new_value * format * -1, s2, 10), 5); } - return result; + return remove_trailing_zero(result); } // float: convert float to char @@ -297,7 +306,7 @@ char * Helpers::render_value(char * result, const double value, const int8_t for } itoa(decimal, result, 10); - return ret; + return remove_trailing_zero(ret); } // int32: convert signed 32bit to text string and returns string @@ -335,7 +344,7 @@ char * Helpers::render_value(char * result, const int32_t value, const int8_t fo strlcat(result, itoa(new_value * format * -1, s, 10), sizeof(s)); } - return result; + return remove_trailing_zero(result); } // int16: convert short (two bytes) to text string and prints it @@ -397,7 +406,7 @@ char * Helpers::render_value(char * result, const uint32_t value, const int8_t f } #endif - return result; + return remove_trailing_zero(result); } // convert special Latin1 characters to UTF8 diff --git a/src/core/helpers.h b/src/core/helpers.h index 999f4bc40..a388f6dc0 100644 --- a/src/core/helpers.h +++ b/src/core/helpers.h @@ -88,6 +88,8 @@ class Helpers { #ifdef EMSESP_STANDALONE static char * ultostr(char * ptr, uint32_t value, const uint8_t base); #endif + private: + static char * remove_trailing_zero(char * result); }; } // namespace emsesp From 335b1274cfa1549b9c09e5b11c863f5b690befc8 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Thu, 8 Jan 2026 12:08:14 +0100 Subject: [PATCH 3/8] test version --- src/emsesp_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/emsesp_version.h b/src/emsesp_version.h index 31504019a..54fc96ac1 100644 --- a/src/emsesp_version.h +++ b/src/emsesp_version.h @@ -1 +1 @@ -#define EMSESP_APP_VERSION "3.8.1-dev.5" +#define EMSESP_APP_VERSION "3.8.1-test.5" From fb57537e882e01cb7755a05cb44d78df239261fd Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Thu, 8 Jan 2026 12:19:18 +0100 Subject: [PATCH 4/8] fix standalone --- lib_standalone/ESP32React.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib_standalone/ESP32React.h b/lib_standalone/ESP32React.h index 23e3a5736..67558df0d 100644 --- a/lib_standalone/ESP32React.h +++ b/lib_standalone/ESP32React.h @@ -36,6 +36,8 @@ class DummySettings { uint8_t nested_format = 1; // 1=nested 2=single String discovery_prefix = "homeassistant"; uint8_t discovery_type = 0; // HA + uint8_t ha_number_mode = 0; // box + bool ha_enabled = true; String base = "ems-esp"; bool publish_single = false; From b66b49e81233599112fbb434446c42fc7ed35a91 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Thu, 8 Jan 2026 12:25:23 +0100 Subject: [PATCH 5/8] remove blank line --- lib_standalone/ESP32React.h | 1 - 1 file changed, 1 deletion(-) diff --git a/lib_standalone/ESP32React.h b/lib_standalone/ESP32React.h index 67558df0d..cb5644db6 100644 --- a/lib_standalone/ESP32React.h +++ b/lib_standalone/ESP32React.h @@ -37,7 +37,6 @@ class DummySettings { String discovery_prefix = "homeassistant"; uint8_t discovery_type = 0; // HA uint8_t ha_number_mode = 0; // box - bool ha_enabled = true; String base = "ems-esp"; bool publish_single = false; From 739f32f0459e9398fb51031257a7ab6b0d22e1c6 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Thu, 8 Jan 2026 13:10:56 +0100 Subject: [PATCH 6/8] update pkg --- interface/package.json | 4 +- interface/pnpm-lock.yaml | 90 ++++++++++++++++++++-------------------- 2 files changed, 47 insertions(+), 47 deletions(-) diff --git a/interface/package.json b/interface/package.json index f1227b8b7..9849e10ab 100644 --- a/interface/package.json +++ b/interface/package.json @@ -26,8 +26,8 @@ "@alova/adapter-xhr": "2.3.1", "@emotion/react": "^11.14.0", "@emotion/styled": "^11.14.1", - "@mui/icons-material": "^7.3.6", - "@mui/material": "^7.3.6", + "@mui/icons-material": "^7.3.7", + "@mui/material": "^7.3.7", "@preact/compat": "^18.3.1", "@table-library/react-table-library": "4.1.15", "alova": "3.4.1", diff --git a/interface/pnpm-lock.yaml b/interface/pnpm-lock.yaml index aefe975b8..8cf9c497f 100644 --- a/interface/pnpm-lock.yaml +++ b/interface/pnpm-lock.yaml @@ -18,11 +18,11 @@ importers: specifier: ^11.14.1 version: 11.14.1(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3) '@mui/icons-material': - specifier: ^7.3.6 - version: 7.3.6(@mui/material@7.3.6(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(@types/react@19.2.7)(react@19.2.3) + specifier: ^7.3.7 + version: 7.3.7(@mui/material@7.3.7(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(@types/react@19.2.7)(react@19.2.3) '@mui/material': - specifier: ^7.3.6 - version: 7.3.6(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + specifier: ^7.3.7 + version: 7.3.7(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) '@preact/compat': specifier: ^18.3.1 version: 18.3.1(preact@10.28.2) @@ -534,27 +534,27 @@ packages: '@jridgewell/trace-mapping@0.3.31': resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} - '@mui/core-downloads-tracker@7.3.6': - resolution: {integrity: sha512-QaYtTHlr8kDFN5mE1wbvVARRKH7Fdw1ZuOjBJcFdVpfNfRYKF3QLT4rt+WaB6CKJvpqxRsmEo0kpYinhH5GeHg==} + '@mui/core-downloads-tracker@7.3.7': + resolution: {integrity: sha512-8jWwS6FweMkpyRkrJooamUGe1CQfO1yJ+lM43IyUJbrhHW/ObES+6ry4vfGi8EKaldHL3t3BG1bcLcERuJPcjg==} - '@mui/icons-material@7.3.6': - resolution: {integrity: sha512-0FfkXEj22ysIq5pa41A2NbcAhJSvmcZQ/vcTIbjDsd6hlslG82k5BEBqqS0ZJprxwIL3B45qpJ+bPHwJPlF7uQ==} + '@mui/icons-material@7.3.7': + resolution: {integrity: sha512-3Q+ulAqG+A1+R4ebgoIs7AccaJhIGy+Xi/9OnvX376jQ6wcy+rz4geDGrxQxCGzdjOQr4Z3NgyFSZCz4T999lA==} engines: {node: '>=14.0.0'} peerDependencies: - '@mui/material': ^7.3.6 + '@mui/material': ^7.3.7 '@types/react': ^17.0.0 || ^18.0.0 || ^19.0.0 react: ^17.0.0 || ^18.0.0 || ^19.0.0 peerDependenciesMeta: '@types/react': optional: true - '@mui/material@7.3.6': - resolution: {integrity: sha512-R4DaYF3dgCQCUAkr4wW1w26GHXcf5rCmBRHVBuuvJvaGLmZdD8EjatP80Nz5JCw0KxORAzwftnHzXVnjR8HnFw==} + '@mui/material@7.3.7': + resolution: {integrity: sha512-6bdIxqzeOtBAj2wAsfhWCYyMKPLkRO9u/2o5yexcL0C3APqyy91iGSWgT3H7hg+zR2XgE61+WAu12wXPON8b6A==} engines: {node: '>=14.0.0'} peerDependencies: '@emotion/react': ^11.5.0 '@emotion/styled': ^11.3.0 - '@mui/material-pigment-css': ^7.3.6 + '@mui/material-pigment-css': ^7.3.7 '@types/react': ^17.0.0 || ^18.0.0 || ^19.0.0 react: ^17.0.0 || ^18.0.0 || ^19.0.0 react-dom: ^17.0.0 || ^18.0.0 || ^19.0.0 @@ -568,8 +568,8 @@ packages: '@types/react': optional: true - '@mui/private-theming@7.3.6': - resolution: {integrity: sha512-Ws9wZpqM+FlnbZXaY/7yvyvWQo1+02Tbx50mVdNmzWEi51C51y56KAbaDCYyulOOBL6BJxuaqG8rNNuj7ivVyw==} + '@mui/private-theming@7.3.7': + resolution: {integrity: sha512-w7r1+CYhG0syCAQUWAuV5zSaU2/67WA9JXUderdb7DzCIJdp/5RmJv6L85wRjgKCMsxFF0Kfn0kPgPbPgw/jdw==} engines: {node: '>=14.0.0'} peerDependencies: '@types/react': ^17.0.0 || ^18.0.0 || ^19.0.0 @@ -578,8 +578,8 @@ packages: '@types/react': optional: true - '@mui/styled-engine@7.3.6': - resolution: {integrity: sha512-+wiYbtvj+zyUkmDB+ysH6zRjuQIJ+CM56w0fEXV+VDNdvOuSywG+/8kpjddvvlfMLsaWdQe5oTuYGBcodmqGzQ==} + '@mui/styled-engine@7.3.7': + resolution: {integrity: sha512-y/QkNXv6cF6dZ5APztd/dFWfQ6LHKPx3skyYO38YhQD4+Cxd6sFAL3Z38WMSSC8LQz145Mpp3CcLrSCLKPwYAg==} engines: {node: '>=14.0.0'} peerDependencies: '@emotion/react': ^11.4.1 @@ -591,8 +591,8 @@ packages: '@emotion/styled': optional: true - '@mui/system@7.3.6': - resolution: {integrity: sha512-8fehAazkHNP1imMrdD2m2hbA9sl7Ur6jfuNweh5o4l9YPty4iaZzRXqYvBCWQNwFaSHmMEj2KPbyXGp7Bt73Rg==} + '@mui/system@7.3.7': + resolution: {integrity: sha512-DovL3k+FBRKnhmatzUMyO5bKkhMLlQ9L7Qw5qHrre3m8zCZmE+31NDVBFfqrbrA7sq681qaEIHdkWD5nmiAjyQ==} engines: {node: '>=14.0.0'} peerDependencies: '@emotion/react': ^11.5.0 @@ -607,16 +607,16 @@ packages: '@types/react': optional: true - '@mui/types@7.4.9': - resolution: {integrity: sha512-dNO8Z9T2cujkSIaCnWwprfeKmTWh97cnjkgmpFJ2sbfXLx8SMZijCYHOtP/y5nnUb/Rm2omxbDMmtUoSaUtKaw==} + '@mui/types@7.4.10': + resolution: {integrity: sha512-0+4mSjknSu218GW3isRqoxKRTOrTLd/vHi/7UC4+wZcUrOAqD9kRk7UQRL1mcrzqRoe7s3UT6rsRpbLkW5mHpQ==} peerDependencies: '@types/react': ^17.0.0 || ^18.0.0 || ^19.0.0 peerDependenciesMeta: '@types/react': optional: true - '@mui/utils@7.3.6': - resolution: {integrity: sha512-jn+Ba02O6PiFs7nKva8R2aJJ9kJC+3kQ2R0BbKNY3KQQ36Qng98GnPRFTlbwYTdMD6hLEBKaMLUktyg/rTfd2w==} + '@mui/utils@7.3.7': + resolution: {integrity: sha512-+YjnjMRnyeTkWnspzoxRdiSOgkrcpTikhNPoxOZW0APXx+urHtUoXJ9lbtCZRCA5a4dg5gSbd19alL1DvRs5fg==} engines: {node: '>=14.0.0'} peerDependencies: '@types/react': ^17.0.0 || ^18.0.0 || ^19.0.0 @@ -1132,8 +1132,8 @@ packages: resolution: {integrity: sha512-DLIsRzJVBQu72meAKPkWQOLcujdXT32hwdfnkI1frSiSRMK1MofjKHf+MEx0SB6fjEFXL8fBDv1dKymBlOp4Qw==} engines: {node: '>=0.10.0'} - caniuse-lite@1.0.30001762: - resolution: {integrity: sha512-PxZwGNvH7Ak8WX5iXzoK1KPZttBXNPuaOvI2ZYU7NrlM+d9Ov+TUvlLOBNGzVXAntMSMMlJPd+jY6ovrVjSmUw==} + caniuse-lite@1.0.30001763: + resolution: {integrity: sha512-mh/dGtq56uN98LlNX9qdbKnzINhX0QzhiWBFEkFfsFO4QyCvL8YegrJAazCwXIeqkIob8BlZPGM3xdnY+sgmvQ==} caw@2.0.1: resolution: {integrity: sha512-Cg8/ZSBEa8ZVY9HspcGUYaK63d/bN7rqS3CYCzEGUxuYv6UlmcjzDUz2fCFFHyTvUW5Pk0I+3hkA3iXlIj6guA==} @@ -3499,23 +3499,23 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.5 - '@mui/core-downloads-tracker@7.3.6': {} + '@mui/core-downloads-tracker@7.3.7': {} - '@mui/icons-material@7.3.6(@mui/material@7.3.6(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(@types/react@19.2.7)(react@19.2.3)': + '@mui/icons-material@7.3.7(@mui/material@7.3.7(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(@types/react@19.2.7)(react@19.2.3)': dependencies: '@babel/runtime': 7.28.4 - '@mui/material': 7.3.6(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + '@mui/material': 7.3.7(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) react: 19.2.3 optionalDependencies: '@types/react': 19.2.7 - '@mui/material@7.3.6(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@mui/material@7.3.7(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': dependencies: '@babel/runtime': 7.28.4 - '@mui/core-downloads-tracker': 7.3.6 - '@mui/system': 7.3.6(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3) - '@mui/types': 7.4.9(@types/react@19.2.7) - '@mui/utils': 7.3.6(@types/react@19.2.7)(react@19.2.3) + '@mui/core-downloads-tracker': 7.3.7 + '@mui/system': 7.3.7(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3) + '@mui/types': 7.4.10(@types/react@19.2.7) + '@mui/utils': 7.3.7(@types/react@19.2.7)(react@19.2.3) '@popperjs/core': 2.11.8 '@types/react-transition-group': 4.4.12(@types/react@19.2.7) clsx: 2.1.1 @@ -3530,16 +3530,16 @@ snapshots: '@emotion/styled': 11.14.1(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3) '@types/react': 19.2.7 - '@mui/private-theming@7.3.6(@types/react@19.2.7)(react@19.2.3)': + '@mui/private-theming@7.3.7(@types/react@19.2.7)(react@19.2.3)': dependencies: '@babel/runtime': 7.28.4 - '@mui/utils': 7.3.6(@types/react@19.2.7)(react@19.2.3) + '@mui/utils': 7.3.7(@types/react@19.2.7)(react@19.2.3) prop-types: 15.8.1 react: 19.2.3 optionalDependencies: '@types/react': 19.2.7 - '@mui/styled-engine@7.3.6(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3))(react@19.2.3)': + '@mui/styled-engine@7.3.7(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3))(react@19.2.3)': dependencies: '@babel/runtime': 7.28.4 '@emotion/cache': 11.14.0 @@ -3552,13 +3552,13 @@ snapshots: '@emotion/react': 11.14.0(@types/react@19.2.7)(react@19.2.3) '@emotion/styled': 11.14.1(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3) - '@mui/system@7.3.6(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3)': + '@mui/system@7.3.7(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3)': dependencies: '@babel/runtime': 7.28.4 - '@mui/private-theming': 7.3.6(@types/react@19.2.7)(react@19.2.3) - '@mui/styled-engine': 7.3.6(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3))(react@19.2.3) - '@mui/types': 7.4.9(@types/react@19.2.7) - '@mui/utils': 7.3.6(@types/react@19.2.7)(react@19.2.3) + '@mui/private-theming': 7.3.7(@types/react@19.2.7)(react@19.2.3) + '@mui/styled-engine': 7.3.7(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3))(react@19.2.3) + '@mui/types': 7.4.10(@types/react@19.2.7) + '@mui/utils': 7.3.7(@types/react@19.2.7)(react@19.2.3) clsx: 2.1.1 csstype: 3.2.3 prop-types: 15.8.1 @@ -3568,16 +3568,16 @@ snapshots: '@emotion/styled': 11.14.1(@emotion/react@11.14.0(@types/react@19.2.7)(react@19.2.3))(@types/react@19.2.7)(react@19.2.3) '@types/react': 19.2.7 - '@mui/types@7.4.9(@types/react@19.2.7)': + '@mui/types@7.4.10(@types/react@19.2.7)': dependencies: '@babel/runtime': 7.28.4 optionalDependencies: '@types/react': 19.2.7 - '@mui/utils@7.3.6(@types/react@19.2.7)(react@19.2.3)': + '@mui/utils@7.3.7(@types/react@19.2.7)(react@19.2.3)': dependencies: '@babel/runtime': 7.28.4 - '@mui/types': 7.4.9(@types/react@19.2.7) + '@mui/types': 7.4.10(@types/react@19.2.7) '@types/prop-types': 15.7.15 clsx: 2.1.1 prop-types: 15.8.1 @@ -4040,7 +4040,7 @@ snapshots: browserslist@4.28.1: dependencies: baseline-browser-mapping: 2.9.12 - caniuse-lite: 1.0.30001762 + caniuse-lite: 1.0.30001763 electron-to-chromium: 1.5.267 node-releases: 2.0.27 update-browserslist-db: 1.2.3(browserslist@4.28.1) @@ -4099,7 +4099,7 @@ snapshots: camelcase@2.1.1: {} - caniuse-lite@1.0.30001762: {} + caniuse-lite@1.0.30001763: {} caw@2.0.1: dependencies: From 34ff5f12ea920b0598af02aad62aad791f61751a Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Thu, 8 Jan 2026 21:18:16 +0100 Subject: [PATCH 7/8] mqtt decimals: remove trailing zeros --- src/core/helpers.cpp | 23 ++++++++++++++++------- src/core/helpers.h | 2 ++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/core/helpers.cpp b/src/core/helpers.cpp index 9bd6d3d27..824097f44 100644 --- a/src/core/helpers.cpp +++ b/src/core/helpers.cpp @@ -207,6 +207,18 @@ char * Helpers::render_boolean(char * result, const bool value, const bool dashb return result; } +char * Helpers::remove_trailing_zero(char * result) { + if (strchr(result, '.')) { + while (result[strlen(result) - 1] == '0') { + result[strlen(result) - 1] = '\0'; + } + if (result[strlen(result) - 1] == '.') { + result[strlen(result) - 1] = '\0'; + } + } + return result; +} + // convert unsigned int (single byte) to text value and returns it // format: 255(0xFF)=boolean, 0=no formatting, otherwise divide by format char * Helpers::render_value(char * result, uint8_t value, int8_t format, const uint8_t fahrenheit) { @@ -240,14 +252,11 @@ char * Helpers::render_value(char * result, uint8_t value, int8_t format, const strlcpy(result, itoa(new_value >> 1, s2, 10), 5); strlcat(result, ".", 5); strlcat(result, ((new_value & 0x01) ? "5" : "0"), 7); - return result; } else if (format == 4) { strlcpy(result, itoa(new_value >> 2, s2, 10), 5); strlcat(result, ".", 5); new_value = (new_value & 0x03) * 25; strlcat(result, itoa(new_value, s2, 10), 7); - return result; - } else if (format > 0) { strlcpy(result, itoa(new_value / format, s2, 10), 5); strlcat(result, ".", 5); @@ -256,7 +265,7 @@ char * Helpers::render_value(char * result, uint8_t value, int8_t format, const strlcpy(result, itoa(new_value * format * -1, s2, 10), 5); } - return result; + return remove_trailing_zero(result); } // float: convert float to char @@ -297,7 +306,7 @@ char * Helpers::render_value(char * result, const double value, const int8_t for } itoa(decimal, result, 10); - return ret; + return remove_trailing_zero(ret); } // int32: convert signed 32bit to text string and returns string @@ -335,7 +344,7 @@ char * Helpers::render_value(char * result, const int32_t value, const int8_t fo strlcat(result, itoa(new_value * format * -1, s, 10), sizeof(s)); } - return result; + return remove_trailing_zero(result); } // int16: convert short (two bytes) to text string and prints it @@ -397,7 +406,7 @@ char * Helpers::render_value(char * result, const uint32_t value, const int8_t f } #endif - return result; + return remove_trailing_zero(result); } // convert special Latin1 characters to UTF8 diff --git a/src/core/helpers.h b/src/core/helpers.h index 999f4bc40..a388f6dc0 100644 --- a/src/core/helpers.h +++ b/src/core/helpers.h @@ -88,6 +88,8 @@ class Helpers { #ifdef EMSESP_STANDALONE static char * ultostr(char * ptr, uint32_t value, const uint8_t base); #endif + private: + static char * remove_trailing_zero(char * result); }; } // namespace emsesp From 4a6a662aa09ef73be2266763a2f06245756cabef Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Fri, 9 Jan 2026 11:52:18 +0100 Subject: [PATCH 8/8] known board gpio settings, custom with less restriction --- src/core/system.cpp | 49 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/src/core/system.cpp b/src/core/system.cpp index ccb3d8960..62972bc55 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -2412,14 +2412,30 @@ bool System::load_board_profile(std::vector & data, const std::string & valid_system_gpios_ = {0, 2, 4, 5, 14, 15, 32, 34, 36, 39}; // system analogs 36, 39, led 2 } else if (board_profile == "MH-ET") { data = {2, 18, 23, 5, 0, PHY_type::PHY_TYPE_NONE, 0, 0, 0, 0}; // MH-ET Live D1 Mini + // allow only pins that are marked as `can always be used` + valid_system_gpios_ = {0, 2, 5, 18, 23, 12 ,13, 14, 15, 16, 17, 26, 27, 33}; + // can always be used: 12, 13 ,14, 15, 16, 17, 26, 27, 33 + // can be used if no other function 2, 4, 5, 9, 10, 18, 19, 21, 22, 23, 25, 34, 35, 36, 39 } else if (board_profile == "NODEMCU") { data = {2, 18, 23, 5, 0, PHY_type::PHY_TYPE_NONE, 0, 0, 0, 0}; // NodeMCU 32S + // https://blog.berrybase.de/esp32-node-mcu-module-anfaenger-guide/ + // all available pins, exclude uart0 + valid_system_gpios_ = {0, 2, 5, 18, 23, 4, 12, 13, 14, 15, 16, 17, 21, 22, 25, 26, 27, 32, 33, 34, 35, 36, 39}; } else if (board_profile == "LOLIN") { data = {2, 18, 17, 16, 0, PHY_type::PHY_TYPE_NONE, 0, 0, 0, 0}; // Lolin D32 + // https://www.wemos.cc/en/latest/d32/d32.html + valid_system_gpios_ = {2, 18, 17, 16, 0, 4, 5, 12, 13, 14, 15, 21, 22, 25, 26, 27, 32, 33, 34, 35, 36, 39}; } else if (board_profile == "OLIMEX") { data = {0, 0, 36, 4, 34, PHY_type::PHY_TYPE_LAN8720, -1, 0, 0, 0}; // Olimex ESP32-EVB (uses U1TXD/U1RXD/BUTTON, no LED or Temperature sensor) + // https://github.com/OLIMEX/ESP32-EVB/blob/master/HARDWARE/REV-K1/ESP32-EVB_Rev_K1.pdf + // uart0 = 1, 3; CAN = 5, 35; relais = 32, 33; ir = 12(tx), 39(rx); SD-card = 2, 14, 15, button = 34 + // relais and ir can be configured as analog sensor + valid_system_gpios_ = {4, 34, 36, 12, 13, 21, 22, 25, 26, 27, 32, 33, 39}; } else if (board_profile == "OLIMEXPOE") { data = {0, 0, 36, 4, 34, PHY_type::PHY_TYPE_LAN8720, 12, 0, 3, 0}; // Olimex ESP32-POE + // https://github.com/OLIMEX/ESP32-POE/blob/master/HARDWARE/ESP32-PoE-hardware-revision-L1/ESP32-PoE_Rev_L1.pdf + // uart0 = 1, 3; SD-card = 2, 14, 15; button = 34; + valid_system_gpios_ = {4, 34, 36, 12, 13, 21, 22, 25, 26, 27, 32, 33, 39}; } else if (board_profile == "C3MINI") { #if defined(BOARD_C3_MINI_V1) data = {7, 1, 4, 5, 9, PHY_type::PHY_TYPE_NONE, 0, 0, 0, 0}; // Lolin C3 Mini V1 @@ -2940,23 +2956,34 @@ void System::set_valid_system_gpios() { #elif CONFIG_IDF_TARGET_ESP32 // https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/peripherals/gpio.html // excluded: - // GPIO6 - GPIO11, GPIO16 - GPIO17 = used for SPI flash and PSRAM - // GPIO12 - GPIO15 = USB-JTAG (but we allow GPIO14 for BBQKees) and GPIO12 & GPIO13 also reserved for BBQKees E32V2.2 + // GPIO6 - GPIO11, GPIO16 - GPIO17 = used for SPI flash and PSRAM (dio mode only GPIO06-GPIO08, GPIO11) // GPIO20, GPIO24, GPIO28 - GPIO31 = don't exist + // GPIO01, GPIO03 = UART0, normal connected to UART/USB chip // - // notes on what is allowed: - // GPIO34, GPIO35, GPIO37 = input only + // notes on known boards: + // boards have valid gpios depending on pinout and internal used gpios, see: `load_board_profile()` + // + // notes on BBQKees boards: + // *** We block all free GPIOS in load_board_profile() *** // GPIO2, GPIO4, GPIO5, GPIO14 = used on BBQKees boards for either LED, Dallas or Rx - // GPIO23 and GPIO18 are used by Ethernet - // GPIO25 - GPIO37 = ADC2 - // GPIO32 - GPIO39 = ADC1 - // GPIO36 = used on BBQKees boards for supply_voltage (E32V2.2) (note may conflict with WiFI on other boards) - // GPIO39 = used on BBQKees boards for core_voltage (E32V2.2) (note may conflict with WiFI on other boards) + // GPIO12, GPIO13, GPIO35 = BBQKees E32V2_2 internal system pins + // GPIO33 = BBQKees E32V_2 unused internal NTC system sensor + // GPIO36 = used on BBQKees boards for supply_voltage (E32V2.2) + // GPIO39 = used on BBQKees boards for core_voltage (E32V2.2) + // + // notes on what is allowed with special functions: + // GPIO01, GPIO03 = UART0, not always connected to uart/usb chip + // GPIO12 - GPIO15 = JTAG, normally not used + // GPIO00, GPIO05, GPIO12, GPIO15 = strapping pins, can be used with care + // GPIO34, GPIO35, GPIO37 = input only + // GPIO23 and GPIO18 are used by Ethernet, excuded later by eth config + // GPIO00, GPIO02, GPIO04, GPIO12 - GPIO15, GPIO25 - GPIO27 = ADC2 (10 ch), used by WiFI-driver + // GPIO32 - GPIO39 = ADC1 (8 ch), can always be used if (ESP.getPsramSize() > 0) { // remove SPI0/1 PSRAM pins GPIO16 (CS) and GPIO17 (CLK) from the list - valid_system_gpios_ = string_range_to_vector("0-39", "6-11, 12, 13, 15, 16, 17, 20, 24, 28-31"); + valid_system_gpios_ = string_range_to_vector("0-39", "6-11, 16, 17, 20, 24, 28-31"); } else { - valid_system_gpios_ = string_range_to_vector("0-39", "6-11, 12, 13, 15, 20, 24, 28-31"); + valid_system_gpios_ = string_range_to_vector("0-39", "6-11, 20, 24, 28-31"); } #elif defined(EMSESP_STANDALONE) valid_system_gpios_ = string_range_to_vector("0-39");