diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index e756d793..e6c323c7 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -123,7 +123,7 @@ jobs: - name: Firmware if: steps.matrix.outputs.cache-hit != 'true' - uses: barndawgie/build-action@v1.9.0 + uses: esphome/build-action@v2.0.0 with: yaml_file: ${{ matrix.yaml_file }} @@ -149,7 +149,7 @@ jobs: uses: actions/checkout@main - name: Build Advanced Firmware - uses: barndawgie/build-action@v1.9.0 + uses: esphome/build-action@v2.0.0 with: yaml_file: ${{ matrix.yaml_file }} @@ -172,7 +172,7 @@ jobs: uses: actions/checkout@main - name: Build BLE Tracker Firmware - uses: barndawgie/build-action@v1.9.0 + uses: esphome/build-action@v2.0.0 with: yaml_file: ${{ matrix.yaml_file }} @@ -195,7 +195,7 @@ jobs: uses: actions/checkout@main - name: Build Bluetooth Proxy Firmware - uses: barndawgie/build-action@v1.9.0 + uses: esphome/build-action@v2.0.0 with: yaml_file: ${{ matrix.yaml_file }} @@ -221,7 +221,7 @@ jobs: uses: actions/checkout@main - name: Build Climate Cool Firmware - uses: barndawgie/build-action@v1.9.0 + uses: esphome/build-action@v2.0.0 with: yaml_file: ${{ matrix.yaml_file }} @@ -247,7 +247,7 @@ jobs: uses: actions/checkout@main - name: Build Climate Heat Firmware - uses: barndawgie/build-action@v1.9.0 + uses: esphome/build-action@v2.0.0 with: yaml_file: ${{ matrix.yaml_file }} @@ -273,7 +273,7 @@ jobs: uses: actions/checkout@main - name: Build Climate Dual Firmware - uses: barndawgie/build-action@v1.9.0 + uses: esphome/build-action@v2.0.0 with: yaml_file: ${{ matrix.yaml_file }} @@ -298,7 +298,7 @@ jobs: uses: actions/checkout@main - name: Build Customizations Firmware - uses: barndawgie/build-action@v1.9.0 + uses: esphome/build-action@v2.0.0 with: yaml_file: ${{ matrix.yaml_file }} @@ -320,7 +320,7 @@ jobs: uses: actions/checkout@main - name: Build Customizations Firmware - uses: barndawgie/build-action@v1.9.0 + uses: esphome/build-action@v2.0.0 with: yaml_file: ${{ matrix.yaml_file }} @@ -347,7 +347,7 @@ jobs: uses: actions/checkout@main - name: Build Cover Firmware - uses: barndawgie/build-action@v1.9.0 + uses: esphome/build-action@v2.0.0 with: yaml_file: ${{ matrix.yaml_file }} @@ -360,7 +360,7 @@ jobs: - uses: actions/checkout@main - name: Build ESPHome Prebuilt Firmware - uses: barndawgie/build-action@v1.9.0 + uses: esphome/build-action@v2.0.0 with: yaml_file: prebuilt/nspanel_esphome_prebuilt.yaml @@ -368,10 +368,10 @@ jobs: run: | mkdir -p prebuilt cp prebuilt/.esphome/build/nspanel/.pioenvs/nspanel/firmware.bin prebuilt/nspanel_esphome_prebuilt.bin || true - cp prebuilt/.esphome/build/nspanel/.pioenvs/nspanel/firmware-factory.bin prebuilt/nspanel_esphome_prebuilt-factory.bin || true + cp prebuilt/.esphome/build/nspanel/.pioenvs/nspanel/firmware.factory.bin prebuilt/nspanel_esphome_prebuilt.factory.bin || true - name: Build ESPHome Prebuilt Wall Display Firmware - uses: barndawgie/build-action@v1.9.0 + uses: esphome/build-action@v2.0.0 with: yaml_file: prebuilt/wall_display.yaml @@ -379,14 +379,14 @@ jobs: run: | mkdir -p prebuilt cp prebuilt/.esphome/build/nspanel/.pioenvs/nspanel/firmware.bin prebuilt/wall_display.bin || true - cp prebuilt/.esphome/build/nspanel/.pioenvs/nspanel/firmware-factory.bin prebuilt/wall_display-factory.bin || true + cp prebuilt/.esphome/build/nspanel/.pioenvs/nspanel/firmware.factory.bin prebuilt/wall_display.factory.bin || true - name: Generate checksum for Firmware Files run: | md5sum prebuilt/nspanel_esphome_prebuilt.bin > prebuilt/nspanel_esphome_prebuilt.bin.md5 - md5sum prebuilt/nspanel_esphome_prebuilt-factory.bin > prebuilt/nspanel_esphome_prebuilt-factory.bin.md5 + md5sum prebuilt/nspanel_esphome_prebuilt.factory.bin > prebuilt/nspanel_esphome_prebuilt.factory.bin.md5 md5sum prebuilt/wall_display.bin > prebuilt/wall_display.bin.md5 - md5sum prebuilt/wall_display-factory.bin > prebuilt/wall_display-factory.bin.md5 + md5sum prebuilt/wall_display.factory.bin > prebuilt/wall_display.factory.bin.md5 - name: Commit and Push Firmware Files run: | diff --git a/.github/workflows/validate_esphome_beta.yml b/.github/workflows/validate_esphome_beta.yml index aa556e5d..169cf724 100644 --- a/.github/workflows/validate_esphome_beta.yml +++ b/.github/workflows/validate_esphome_beta.yml @@ -101,7 +101,7 @@ jobs: - name: Firmware if: steps.matrix.outputs.cache-hit != 'true' - uses: barndawgie/build-action@v1.9.0 + uses: esphome/build-action@v2.0.0 with: yaml_file: ${{ matrix.yaml_file }} version: beta @@ -128,7 +128,7 @@ jobs: uses: actions/checkout@main - name: Build Advanced Firmware - uses: barndawgie/build-action@v1.9.0 + uses: esphome/build-action@v2.0.0 with: yaml_file: ${{ matrix.yaml_file }} version: beta @@ -152,7 +152,7 @@ jobs: uses: actions/checkout@main - name: Build BLE Tracker Firmware - uses: barndawgie/build-action@v1.9.0 + uses: esphome/build-action@v2.0.0 with: yaml_file: ${{ matrix.yaml_file }} version: beta @@ -176,7 +176,7 @@ jobs: uses: actions/checkout@main - name: Build Bluetooth Proxy Firmware - uses: barndawgie/build-action@v1.9.0 + uses: esphome/build-action@v2.0.0 with: yaml_file: ${{ matrix.yaml_file }} version: beta @@ -203,7 +203,7 @@ jobs: uses: actions/checkout@main - name: Build Climate Cool Firmware - uses: barndawgie/build-action@v1.9.0 + uses: esphome/build-action@v2.0.0 with: yaml_file: ${{ matrix.yaml_file }} version: beta @@ -230,7 +230,7 @@ jobs: uses: actions/checkout@main - name: Build Climate Heat Firmware - uses: barndawgie/build-action@v1.9.0 + uses: esphome/build-action@v2.0.0 with: yaml_file: ${{ matrix.yaml_file }} version: beta @@ -257,7 +257,7 @@ jobs: uses: actions/checkout@main - name: Build Climate Dial Firmware - uses: barndawgie/build-action@v1.9.0 + uses: esphome/build-action@v2.0.0 with: yaml_file: ${{ matrix.yaml_file }} version: beta @@ -283,7 +283,7 @@ jobs: uses: actions/checkout@main - name: Build Customizations Firmware - uses: barndawgie/build-action@v1.9.0 + uses: esphome/build-action@v2.0.0 with: yaml_file: ${{ matrix.yaml_file }} version: beta @@ -306,7 +306,7 @@ jobs: uses: actions/checkout@main - name: Build Customizations Firmware - uses: barndawgie/build-action@v1.9.0 + uses: esphome/build-action@v2.0.0 with: yaml_file: ${{ matrix.yaml_file }} version: beta @@ -334,7 +334,7 @@ jobs: uses: actions/checkout@main - name: Build Cover Firmware - uses: barndawgie/build-action@v1.9.0 + uses: esphome/build-action@v2.0.0 with: yaml_file: ${{ matrix.yaml_file }} version: beta @@ -348,13 +348,13 @@ jobs: - uses: actions/checkout@main - name: Build ESPHome Prebuilt Firmware - uses: barndawgie/build-action@v1.9.0 + uses: esphome/build-action@v2.0.0 with: yaml_file: prebuilt/nspanel_esphome_prebuilt.yaml version: beta - name: Build ESPHome Prebuilt Wall Display Firmware - uses: barndawgie/build-action@v1.9.0 + uses: esphome/build-action@v2.0.0 with: yaml_file: prebuilt/wall_display.yaml version: beta diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 89ae12f3..d2486cca 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -881,6 +881,23 @@ ensuring improved performance and user experience. These updates address critical issues and enhance the overall functionality and user experience of the NSPanel. We appreciate the community's feedback and contributions, which help us continually improve this project. +## v4.3.9 - Ensuring Compatibility with ESPHome v2024.6.0 +This patch addresses a critical compatibility issue introduced by the release of ESPHome v2024.6.0. +The OTA format has changed, necessitating updates to ensure seamless firmware updates and system stability for NSPanel users. + +> [!WARNING] +> Home Assistant v2024.6.0 and ESPHome v2024.6.0 are required. +> Please take a look at our [Version compatibility matrix](https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/version_compatibility.md) for a full list. + +### OTA Format Compatibility Update +- **Criticality:** Critical +- **Affected Components:** ESPHome +- **Description:** Updated the NSPanel firmware to be compatible with the new OTA format introduced in ESPHome v2024.6.0. + This change is essential for maintaining the ability to perform over-the-air updates, ensuring continuous system functionality and stability. + +Please ensure you are using Home Assistant v2024.6.0 or later, along with the latest ESPHome version, +to benefit from these updates and maintain optimal performance. + ## Support For support or more information about this update, visit our [GitHub repository](https://github.com/Blackymas/NSPanel_HA_Blueprint) diff --git a/components/nspanel_ha_blueprint/__init__.py b/components/nspanel_ha_blueprint/__init__.py index 1a9c5b04..74d11dbe 100644 --- a/components/nspanel_ha_blueprint/__init__.py +++ b/components/nspanel_ha_blueprint/__init__.py @@ -18,6 +18,8 @@ @coroutine_with_priority(1.0) async def to_code(config): + cg.add_build_flag("-Wno-missing-field-initializers") + if CORE.using_arduino: cg.add_build_flag("-DCONFIG_D0WD_PSRAM_CLK_IO=5") cg.add_build_flag("-DCONFIG_D0WD_PSRAM_CS_IO=18") diff --git a/components/nspanel_ha_blueprint/upload_tft.cpp b/components/nspanel_ha_blueprint/upload_tft.cpp index 7b032bca..a8fdbc7d 100644 --- a/components/nspanel_ha_blueprint/upload_tft.cpp +++ b/components/nspanel_ha_blueprint/upload_tft.cpp @@ -1,6 +1,6 @@ // upload_tft.cpp -#ifdef NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT +// #ifdef NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT #include "upload_tft.h" @@ -29,4 +29,4 @@ namespace nspanel_ha_blueprint { } // namespace nspanel_ha_blueprint -#endif // NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT +// #endif // NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT diff --git a/components/nspanel_ha_blueprint/upload_tft.h b/components/nspanel_ha_blueprint/upload_tft.h index 339453d8..823e32e4 100644 --- a/components/nspanel_ha_blueprint/upload_tft.h +++ b/components/nspanel_ha_blueprint/upload_tft.h @@ -2,7 +2,7 @@ #pragma once -#ifdef NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT +// #ifdef NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT #include @@ -31,4 +31,4 @@ namespace nspanel_ha_blueprint { } // namespace nspanel_ha_blueprint -#endif // NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT +// #endif // NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT diff --git a/docs/addon_bluetooth_proxy.md b/docs/addon_bluetooth_proxy.md index 914f40a5..df9684c3 100644 --- a/docs/addon_bluetooth_proxy.md +++ b/docs/addon_bluetooth_proxy.md @@ -11,8 +11,14 @@ along with the [ESPHome Bluetooth Proxy component](https://esphome.io/components - Ensure the `esp-idf` framework is utilized for the [ESP32 Platform](customization.md#framework-esp-idf) when enabling Bluetooth features. Avoid switching to the `arduino` framework as it significantly increases memory usage, potentially causing installation failures on your panel. + +> [!IMPORTANT] +> This add-on includes the BLE Tracker add-on as well. +> Do not include that package in your configuration (or otherwise include `esp32_ble_tracker` in your configuration) otherwise you may experience build errors. + > [!WARNING] > The `arduino` framework, while compatible, should not be used for Bluetooth-intensive applications on the NSPanel due to its higher memory consumption. + ### Configuration Steps 1. **Edit Your ESPHome YAML File**: Add the Bluetooth Proxy add-on to your configuration by including the `remote_package` entry under the `packages` section as illustrated below: diff --git a/docs/version_compatibility.md b/docs/version_compatibility.md index f706ca9c..27920b72 100644 --- a/docs/version_compatibility.md +++ b/docs/version_compatibility.md @@ -3,6 +3,7 @@ | NSPanel_HA_Blueprint
Version | Home Assistant
Min version | ESPHome
Min version | | :--: | :--: | :--: | +| v4.3.9 | 2024.6.0 | 2024.6.0 | | v4.3.8 | 2024.6.0 | 2024.5.0 | | v4.3.7
v4.3.6
v4.3.5
v4.3.4
v4.3.3 | 2024.3.0 | 2023.12.0 | | v4.3.2
v4.3.1 | 2024.3.0 | 2024.3.0 | diff --git a/esphome/nspanel_esphome_addon_ble_tracker.yaml b/esphome/nspanel_esphome_addon_ble_tracker.yaml index e821c0da..9eeb22ca 100644 --- a/esphome/nspanel_esphome_addon_ble_tracker.yaml +++ b/esphome/nspanel_esphome_addon_ble_tracker.yaml @@ -8,10 +8,10 @@ ##################################################################################################### --- -esphome: - platformio_options: - build_flags: - - -D NSPANEL_HA_BLUEPRINT_ADDON_BLE_TRACKER +substitutions: + ##### DON'T CHANGE THIS ###### + NSPANEL_HA_BLUEPRINT_ADDON_BLE_TRACKER: "true" + ############################## esp32_ble: id: ble_component diff --git a/esphome/nspanel_esphome_addon_bluetooth_proxy.yaml b/esphome/nspanel_esphome_addon_bluetooth_proxy.yaml index d26f7171..4e4b310d 100644 --- a/esphome/nspanel_esphome_addon_bluetooth_proxy.yaml +++ b/esphome/nspanel_esphome_addon_bluetooth_proxy.yaml @@ -8,14 +8,14 @@ ##################################################################################################### --- +substitutions: + ##### DON'T CHANGE THIS ###### + NSPANEL_HA_BLUEPRINT_ADDON_BLUETOOTH_PROXY: "true" + ############################## + bluetooth_proxy: id: ble_proxy -esphome: - platformio_options: - build_flags: - - -D NSPANEL_HA_BLUEPRINT_ADDON_BLUETOOTH_PROXY - packages: climate_base_package: !include nspanel_esphome_addon_ble_tracker.yaml diff --git a/esphome/nspanel_esphome_addon_climate_base.yaml b/esphome/nspanel_esphome_addon_climate_base.yaml index 93c711cb..a3f2cebe 100644 --- a/esphome/nspanel_esphome_addon_climate_base.yaml +++ b/esphome/nspanel_esphome_addon_climate_base.yaml @@ -30,13 +30,9 @@ substitutions: addon_climate_cool: "false" addon_climate_heat: "false" addon_climate_dual: "false" + NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_BASE: "true" ############################## -esphome: - platformio_options: - build_flags: - - -D NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_BASE - climate: - platform: thermostat name: Thermostat @@ -123,41 +119,41 @@ script: #error "Invalid settings for add-on Climate. More than one option selected: Cool + Dual." #elif defined(NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_HEAT) && defined(NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_DUAL) #error "Invalid settings for add-on Climate. More than one option selected: Heat + Dual." - #elif !defined(NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_COOL) && !defined(NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_HEAT) && !defined(NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_DUAL) - #error "Invalid settings for add-on Climate. No option selected between Cool, Heat or Dual." + // #elif !defined(NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_COOL) && !defined(NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_HEAT) && !defined(NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_DUAL) + // #error "Invalid settings for add-on Climate. No option selected between Cool, Heat or Dual." #endif if (!id(is_uploading_tft)) { static const char *const TAG = "nspanel_ha_blueprint"; const uint cooler_relay = ${cooler_relay}; const uint heater_relay = ${heater_relay}; ESP_LOGCONFIG(TAG, "Add-on climate:"); - #ifdef NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_COOL - ESP_LOGCONFIG(TAG, " Cool: Enabled"); - if (cooler_relay == 1 or cooler_relay == 2) - ESP_LOGCONFIG(TAG, " Relay: %u", cooler_relay); - else - ESP_LOGE(TAG, " Relay: %u", cooler_relay); - #endif - #ifdef NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_HEAT - ESP_LOGCONFIG(TAG, " Heat: Enabled"); - if (heater_relay == 1 or heater_relay == 2) - ESP_LOGCONFIG(TAG, " Relay: %u", heater_relay); - else - ESP_LOGE(TAG, " Relay: %u", heater_relay); - #endif - #ifdef NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_DUAL - ESP_LOGCONFIG(TAG, " Dual: Enabled"); - if (cooler_relay == 1 or cooler_relay == 2) - ESP_LOGCONFIG(TAG, " Relay (cooler): %u", cooler_relay); - else - ESP_LOGE(TAG, " Relay (cooler): %u", cooler_relay); - if (heater_relay == 1 or heater_relay == 2) - ESP_LOGCONFIG(TAG, " Relay (heater): %u", heater_relay); - else - ESP_LOGE(TAG, " Relay (heater): %u", heater_relay); - if (cooler_relay == heater_relay) - ESP_LOGE(TAG, " Double relay assignment"); - #endif + if (${NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_COOL}) { + ESP_LOGCONFIG(TAG, " Cool: Enabled"); + if (cooler_relay == 1 or cooler_relay == 2) + ESP_LOGCONFIG(TAG, " Relay: %u", cooler_relay); + else + ESP_LOGE(TAG, " Relay: %u", cooler_relay); + } + if (${NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_HEAT}) { + ESP_LOGCONFIG(TAG, " Heat: Enabled"); + if (heater_relay == 1 or heater_relay == 2) + ESP_LOGCONFIG(TAG, " Relay: %u", heater_relay); + else + ESP_LOGE(TAG, " Relay: %u", heater_relay); + } + if (${NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_DUAL}) { + ESP_LOGCONFIG(TAG, " Dual: Enabled"); + if (cooler_relay == 1 or cooler_relay == 2) + ESP_LOGCONFIG(TAG, " Relay (cooler): %u", cooler_relay); + else + ESP_LOGE(TAG, " Relay (cooler): %u", cooler_relay); + if (heater_relay == 1 or heater_relay == 2) + ESP_LOGCONFIG(TAG, " Relay (heater): %u", heater_relay); + else + ESP_LOGE(TAG, " Relay (heater): %u", heater_relay); + if (cooler_relay == heater_relay) + ESP_LOGE(TAG, " Double relay assignment"); + } } - id: !extend init_hardware_climate diff --git a/esphome/nspanel_esphome_addon_climate_cool.yaml b/esphome/nspanel_esphome_addon_climate_cool.yaml index 20e17e96..e0412cc1 100644 --- a/esphome/nspanel_esphome_addon_climate_cool.yaml +++ b/esphome/nspanel_esphome_addon_climate_cool.yaml @@ -13,13 +13,9 @@ substitutions: ##### DO NOT CHANGE THIS ##### addon_climate_cool: "true" + NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_COOL: "true" ############################## -esphome: - platformio_options: - build_flags: - - -D NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_COOL - climate: - id: !extend thermostat_embedded min_cooling_off_time: ${min_off_time}s diff --git a/esphome/nspanel_esphome_addon_climate_dual.yaml b/esphome/nspanel_esphome_addon_climate_dual.yaml index 2e37eb3e..68b69f3d 100644 --- a/esphome/nspanel_esphome_addon_climate_dual.yaml +++ b/esphome/nspanel_esphome_addon_climate_dual.yaml @@ -10,13 +10,9 @@ substitutions: ##### DO NOT CHANGE THIS ##### addon_climate_dual: "true" + NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_DUAL: "true" ############################## -esphome: - platformio_options: - build_flags: - - -D NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_DUAL - climate: - id: !extend thermostat_embedded min_cooling_off_time: ${min_off_time}s diff --git a/esphome/nspanel_esphome_addon_climate_heat.yaml b/esphome/nspanel_esphome_addon_climate_heat.yaml index 35b98554..e842d9e1 100644 --- a/esphome/nspanel_esphome_addon_climate_heat.yaml +++ b/esphome/nspanel_esphome_addon_climate_heat.yaml @@ -13,13 +13,9 @@ substitutions: ##### DO NOT CHANGE THIS ##### addon_climate_heat: "true" + NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_HEAT: "true" ############################## -esphome: - platformio_options: - build_flags: - - -D NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_HEAT - climate: - id: !extend thermostat_embedded min_heating_off_time: ${min_off_time}s diff --git a/esphome/nspanel_esphome_addon_cover.yaml b/esphome/nspanel_esphome_addon_cover.yaml index f41471a1..aebfd825 100644 --- a/esphome/nspanel_esphome_addon_cover.yaml +++ b/esphome/nspanel_esphome_addon_cover.yaml @@ -11,10 +11,11 @@ substitutions: ### Local cover defaults ### interlock_wait_time: '250' + ##### DON'T CHANGE THIS ###### + NSPANEL_HA_BLUEPRINT_ADDON_COVER: "true" + ############################## + esphome: - platformio_options: - build_flags: - - -D NSPANEL_HA_BLUEPRINT_ADDON_COVER on_boot: - priority: 700.29 then: diff --git a/esphome/nspanel_esphome_addon_upload_tft.yaml b/esphome/nspanel_esphome_addon_upload_tft.yaml index dca5209c..26c62af9 100644 --- a/esphome/nspanel_esphome_addon_upload_tft.yaml +++ b/esphome/nspanel_esphome_addon_upload_tft.yaml @@ -14,10 +14,9 @@ substitutions: nextion_update_url: "${nextion_update_base_url}/main/hmi/nspanel_blank.tft" ############################################## -esphome: - platformio_options: - build_flags: - - -D NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT + ##### DON'T CHANGE THIS ###### + NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT: "true" + ############################## # yamllint disable rule:comments-indentation api: diff --git a/esphome/nspanel_esphome_advanced.yaml b/esphome/nspanel_esphome_advanced.yaml index f44b00c2..1984d3c8 100644 --- a/esphome/nspanel_esphome_advanced.yaml +++ b/esphome/nspanel_esphome_advanced.yaml @@ -15,10 +15,9 @@ substitutions: web_password: ${wifi_password} ############################## -esphome: - platformio_options: - build_flags: - - -D NSPANEL_HA_BLUEPRINT_ADVANCED + ##### DON'T CHANGE THIS ###### + NSPANEL_HA_BLUEPRINT_ADVANCED: "true" + ############################## button: - name: Exit reparse diff --git a/esphome/nspanel_esphome_core.yaml b/esphome/nspanel_esphome_core.yaml index 21a70328..26b38db1 100644 --- a/esphome/nspanel_esphome_core.yaml +++ b/esphome/nspanel_esphome_core.yaml @@ -9,15 +9,28 @@ substitutions: ############################## ## Change only in your ## ## local yaml substitutions ## - device_name: NSPanel + device_name: nspanel name: ${device_name} friendly_name: ${device_name} ota_password: ${wifi_password} temp_units: "°C" invalid_cooldown: "100ms" bytes_per_char: "1" + ############################## + ##### DON'T CHANGE THIS ###### - version: "4.3.8" + version: "4.3.9" + NSPANEL_HA_BLUEPRINT_CORE: "true" + NSPANEL_HA_BLUEPRINT_ADVANCED: "false" + NSPANEL_HA_BLUEPRINT_ADDON_BLE_TRACKER: "false" + NSPANEL_HA_BLUEPRINT_ADDON_BLUETOOTH_PROXY: "false" + NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT: "false" + NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_BASE: "false" + NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_COOL: "false" + NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_DUAL: "false" + NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_HEAT: "false" + NSPANEL_HA_BLUEPRINT_PREBUILT: "false" + NSPANEL_HA_BLUEPRINT_PREBUILT_WALL_DISPLAY: "false" ############################## ##### External components ##### @@ -27,29 +40,23 @@ external_components: # path: packages/Blackymas/components type: git url: https://github.com/Blackymas/NSPanel_HA_Blueprint - ref: v4.3.8 + ref: v4.3.9 components: - nspanel_ha_blueprint refresh: 30s - - source: - type: git - url: https://github.com/edwardtfn/esphome - ref: nextion-40 - components: - - nextion # Change this when that PR#6758 gets released (2024.6?) - - source: github://pr#6330 - components: - - adc # Change this when PR#6330 is merged and released (2024.6) ##### ESPHOME CONFIGURATION ##### esphome: name: ${name} friendly_name: ${friendly_name} - min_version: 2024.5.0 - platformio_options: - build_flags: - - -Wno-missing-field-initializers - - -D NSPANEL_HA_BLUEPRINT_CORE + min_version: 2024.6.0 + project: + name: esphome.NSPanel_HA_Blueprint + version: "${version}" +# platformio_options: +# build_flags: +# - -Wno-missing-field-initializers +# - -D NSPANEL_HA_BLUEPRINT_CORE on_boot: - priority: 600.0 # This is where most sensors are set up. @@ -118,11 +125,12 @@ wifi: ##### OTA PASSWORD ##### ota: - id: ota_std - password: ${ota_password} - safe_mode: true - reboot_timeout: 3min - num_attempts: 3 + - id: ota_std + platform: esphome + password: ${ota_password} + #safe_mode: true + #reboot_timeout: 3min + #num_attempts: 3 ##### Adds custom library for NSPanel HA Blueprint project nspanel_ha_blueprint: @@ -1779,22 +1787,23 @@ text_sensor: return {"${name}"}; filters: - lambda: |- - #ifdef NSPANEL_HA_BLUEPRINT_PREBUILT - std::string suffix = "00ERROR"; // Default suffix in case of an error - uint8_t mac[6] = {0,0,0,0,0,0}; - if (esp_read_mac(mac, ESP_MAC_WIFI_STA) == ESP_OK) { - suffix.clear(); // Clear the default error suffix - for (int i = 3; i < 6; ++i) { // Use last 3 bytes of MAC - char hex[3]; - snprintf(hex, sizeof(hex), "%02X", mac[i]); - suffix += hex; + std::string raw_name; + if (${NSPANEL_HA_BLUEPRINT_PREBUILT}) { + std::string suffix = "00ERROR"; // Default suffix in case of an error + uint8_t mac[6] = {0,0,0,0,0,0}; + if (esp_read_mac(mac, ESP_MAC_WIFI_STA) == ESP_OK) { + suffix.clear(); // Clear the default error suffix + for (int i = 3; i < 6; ++i) { // Use last 3 bytes of MAC + char hex[3]; + snprintf(hex, sizeof(hex), "%02X", mac[i]); + suffix += hex; + } } + // Proceed with suffix (either MAC-based or default error indicator) + raw_name = (x + "-" + suffix); + } else { + raw_name = x; } - // Proceed with suffix (either MAC-based or default error indicator) - const std::string raw_name = (x + "-" + suffix); - #else - const std::string raw_name = x; - #endif std::string result; bool last_was_underscore = false; @@ -2269,36 +2278,16 @@ script: else ESP_LOGCONFIG(TAG, " TFT: %s", version_tft->state.c_str()); ESP_LOGCONFIG(TAG, "Packages:"); - #ifdef NSPANEL_HA_BLUEPRINT_CORE - ESP_LOGCONFIG(TAG, " - Core"); - #endif - #ifdef NSPANEL_HA_BLUEPRINT_ADVANCED - ESP_LOGCONFIG(TAG, " - Advanced"); - #endif - #ifdef NSPANEL_HA_BLUEPRINT_ADDON_BLUETOOTH_PROXY - ESP_LOGCONFIG(TAG, " - Bluetooth Proxy"); - #endif - #ifdef NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT - ESP_LOGCONFIG(TAG, " - Upload TFT"); - #endif - #ifdef NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_BASE - ESP_LOGCONFIG(TAG, " - Climate - Base"); - #endif - #ifdef NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_COOL - ESP_LOGCONFIG(TAG, " - Climate - Cool"); - #endif - #ifdef NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_DUAL - ESP_LOGCONFIG(TAG, " - Climate - Dual"); - #endif - #ifdef NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_HEAT - ESP_LOGCONFIG(TAG, " - Climate - Heat"); - #endif - #ifdef NSPANEL_HA_BLUEPRINT_PREBUILT - ESP_LOGCONFIG(TAG, " - Pre-built"); - #endif - #ifdef NSPANEL_HA_BLUEPRINT_PREBUILT_WALL_DISPLAY - ESP_LOGCONFIG(TAG, " - Pre-built (Wall Display)"); - #endif + if (${NSPANEL_HA_BLUEPRINT_CORE}) ESP_LOGCONFIG(TAG, " - Core"); + if (${NSPANEL_HA_BLUEPRINT_ADVANCED}) ESP_LOGCONFIG(TAG, " - Advanced"); + if (${NSPANEL_HA_BLUEPRINT_ADDON_BLUETOOTH_PROXY}) ESP_LOGCONFIG(TAG, " - Bluetooth Proxy"); + if (${NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT}) ESP_LOGCONFIG(TAG, " - Upload TFT"); + if (${NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_BASE}) ESP_LOGCONFIG(TAG, " - Climate - Base"); + if (${NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_COOL}) ESP_LOGCONFIG(TAG, " - Climate - Cool"); + if (${NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_DUAL}) ESP_LOGCONFIG(TAG, " - Climate - Dual"); + if (${NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_HEAT}) ESP_LOGCONFIG(TAG, " - Climate - Heat"); + if (${NSPANEL_HA_BLUEPRINT_PREBUILT}) ESP_LOGCONFIG(TAG, " - Pre-built"); + if (${NSPANEL_HA_BLUEPRINT_PREBUILT_WALL_DISPLAY}) ESP_LOGCONFIG(TAG, " - Pre-built (Wall Display)"); #if defined(USE_BLUETOOTH_PROXY) || defined(USE_WEBSERVER) || defined(USE_CAPTIVE_PORTAL) ESP_LOGCONFIG(TAG, "Components:"); #ifdef USE_ESP32_BLE_SERVER diff --git a/hmi/dev/nspanel_CJK_eu_code/boot.txt b/hmi/dev/nspanel_CJK_eu_code/boot.txt index 4d144f6b..9e95e71d 100644 --- a/hmi/dev/nspanel_CJK_eu_code/boot.txt +++ b/hmi/dev/nspanel_CJK_eu_code/boot.txt @@ -95,7 +95,7 @@ Text tft_version Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : 4.3.8 + Text : 4.3.9 Max. Text Size : 10 Text esph_version diff --git a/hmi/dev/nspanel_CJK_us_code/boot.txt b/hmi/dev/nspanel_CJK_us_code/boot.txt index 263c469f..e06102b0 100644 --- a/hmi/dev/nspanel_CJK_us_code/boot.txt +++ b/hmi/dev/nspanel_CJK_us_code/boot.txt @@ -95,7 +95,7 @@ Text tft_version Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : 4.3.8 + Text : 4.3.9 Max. Text Size : 10 Events diff --git a/hmi/dev/nspanel_CJK_us_land_code/boot.txt b/hmi/dev/nspanel_CJK_us_land_code/boot.txt index 4d144f6b..9e95e71d 100644 --- a/hmi/dev/nspanel_CJK_us_land_code/boot.txt +++ b/hmi/dev/nspanel_CJK_us_land_code/boot.txt @@ -95,7 +95,7 @@ Text tft_version Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : 4.3.8 + Text : 4.3.9 Max. Text Size : 10 Text esph_version diff --git a/hmi/dev/nspanel_eu_code/boot.txt b/hmi/dev/nspanel_eu_code/boot.txt index 4d144f6b..9e95e71d 100644 --- a/hmi/dev/nspanel_eu_code/boot.txt +++ b/hmi/dev/nspanel_eu_code/boot.txt @@ -95,7 +95,7 @@ Text tft_version Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : 4.3.8 + Text : 4.3.9 Max. Text Size : 10 Text esph_version diff --git a/hmi/dev/nspanel_us_code/boot.txt b/hmi/dev/nspanel_us_code/boot.txt index 263c469f..e06102b0 100644 --- a/hmi/dev/nspanel_us_code/boot.txt +++ b/hmi/dev/nspanel_us_code/boot.txt @@ -95,7 +95,7 @@ Text tft_version Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : 4.3.8 + Text : 4.3.9 Max. Text Size : 10 Events diff --git a/hmi/dev/nspanel_us_land_code/boot.txt b/hmi/dev/nspanel_us_land_code/boot.txt index 4d144f6b..9e95e71d 100644 --- a/hmi/dev/nspanel_us_land_code/boot.txt +++ b/hmi/dev/nspanel_us_land_code/boot.txt @@ -95,7 +95,7 @@ Text tft_version Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : 4.3.8 + Text : 4.3.9 Max. Text Size : 10 Text esph_version diff --git a/hmi/nspanel_CJK_eu.HMI b/hmi/nspanel_CJK_eu.HMI index ae8912e0..98e27dc2 100644 Binary files a/hmi/nspanel_CJK_eu.HMI and b/hmi/nspanel_CJK_eu.HMI differ diff --git a/hmi/nspanel_CJK_eu.tft b/hmi/nspanel_CJK_eu.tft index 17563636..7dd4c9f7 100644 Binary files a/hmi/nspanel_CJK_eu.tft and b/hmi/nspanel_CJK_eu.tft differ diff --git a/hmi/nspanel_CJK_us.HMI b/hmi/nspanel_CJK_us.HMI index 87106d5f..9439355a 100644 Binary files a/hmi/nspanel_CJK_us.HMI and b/hmi/nspanel_CJK_us.HMI differ diff --git a/hmi/nspanel_CJK_us.tft b/hmi/nspanel_CJK_us.tft index 68f96c4d..71eac449 100644 Binary files a/hmi/nspanel_CJK_us.tft and b/hmi/nspanel_CJK_us.tft differ diff --git a/hmi/nspanel_CJK_us_land.HMI b/hmi/nspanel_CJK_us_land.HMI index 9ab45184..24fc5e45 100644 Binary files a/hmi/nspanel_CJK_us_land.HMI and b/hmi/nspanel_CJK_us_land.HMI differ diff --git a/hmi/nspanel_CJK_us_land.tft b/hmi/nspanel_CJK_us_land.tft index 6552c817..ee91a0db 100644 Binary files a/hmi/nspanel_CJK_us_land.tft and b/hmi/nspanel_CJK_us_land.tft differ diff --git a/hmi/nspanel_eu.HMI b/hmi/nspanel_eu.HMI index 92cf3883..5ae24019 100644 Binary files a/hmi/nspanel_eu.HMI and b/hmi/nspanel_eu.HMI differ diff --git a/hmi/nspanel_eu.tft b/hmi/nspanel_eu.tft index e11211fa..82ffab44 100644 Binary files a/hmi/nspanel_eu.tft and b/hmi/nspanel_eu.tft differ diff --git a/hmi/nspanel_us.HMI b/hmi/nspanel_us.HMI index 69e685cf..06506adc 100644 Binary files a/hmi/nspanel_us.HMI and b/hmi/nspanel_us.HMI differ diff --git a/hmi/nspanel_us.tft b/hmi/nspanel_us.tft index a3e55a0d..1c10e0e8 100644 Binary files a/hmi/nspanel_us.tft and b/hmi/nspanel_us.tft differ diff --git a/hmi/nspanel_us_land.HMI b/hmi/nspanel_us_land.HMI index 17d78142..6104bdc5 100644 Binary files a/hmi/nspanel_us_land.HMI and b/hmi/nspanel_us_land.HMI differ diff --git a/hmi/nspanel_us_land.tft b/hmi/nspanel_us_land.tft index 78bfc6d1..2246093f 100644 Binary files a/hmi/nspanel_us_land.tft and b/hmi/nspanel_us_land.tft differ diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index 1653c438..6cd9343d 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -10,7 +10,7 @@ blueprint: description: > # NSPanel Configuration via Blueprint: Complete UI-Based Setup - **Version**: v4.3.8 + **Version**: v4.3.9 This project enables comprehensive configuration of your NSPanel through a Blueprint featuring a user interface. @@ -22,7 +22,7 @@ blueprint: source_url: https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/nspanel_blueprint.yaml domain: automation homeassistant: - min_version: 2024.5.99 + min_version: 2024.6.0 input: nspanel_name: # This key was kept with this name to support inputs from legacy versions where the panel name was used @@ -3764,7 +3764,7 @@ trigger_variables: group06: !input utilities_page01_group06_line_reference variables: - blueprint_version: '4.3.8' + blueprint_version: '4.3.9' pages: current: '{{ states(currentpage) }}' home: "home" @@ -10807,6 +10807,7 @@ action: - Expected version: {{ nspanel_event.esphome if newest[0] == "esphome" else nspanel_event.tft }}, based on the panel **{{ device_attr(nspanel_deviceid, "name") ~ ((" - " ~ nspanel_name) if nspanel_name != device_attr(nspanel_deviceid, "name") else "") }}**. + --- **How to Resolve This Issue** diff --git a/prebuilt/nspanel_esphome_prebuilt.yaml b/prebuilt/nspanel_esphome_prebuilt.yaml index 4a4c76c7..adc1edb3 100644 --- a/prebuilt/nspanel_esphome_prebuilt.yaml +++ b/prebuilt/nspanel_esphome_prebuilt.yaml @@ -14,11 +14,9 @@ substitutions: wifi_ssid: nspanel wifi_password: NSPanel_Blueprint -##### External components ##### -external_components: - - source: github://oarcher/esphome@ota_http_legacy # Remove this and update min ver when PR#5586 is released - components: - - ota_http + ##### DON'T CHANGE THIS ###### + NSPANEL_HA_BLUEPRINT_PREBUILT: "true" + ############################## packages: core_package: !include ../esphome/nspanel_esphome_core.yaml @@ -30,12 +28,10 @@ api: variables: url: string then: - - ota_http.flash: + - ota.http_request.flash: md5_url: !lambda return fw_url->state + ".md5"; url: !lambda return fw_url->state; - - lambda: |- - static const char *const TAG = "prebuilt.button.bt_firmware_update"; - ESP_LOGE(TAG, "Firmware update failed!"); + - lambda: ESP_LOGE("prebuilt.api.service.firmware_update", "Firmware update failed!"); button: - name: Factory reset @@ -48,12 +44,10 @@ button: platform: template on_press: then: - - ota_http.flash: + - ota.http_request.flash: md5_url: !lambda return fw_url->state + ".md5"; url: !lambda return fw_url->state; - - lambda: |- - static const char *const TAG = "prebuilt.button.bt_firmware_update"; - ESP_LOGE(TAG, "Firmware update failed!"); + - lambda: ESP_LOGE("prebuilt.button.bt_firmware_update", "Firmware update failed!"); captive_portal: id: ap_captive_portal @@ -74,12 +68,8 @@ esp32_ble_server: esphome: name_add_mac_suffix: true - project: - name: esphome.NSPanel_HA_Blueprint - version: "${version}" - platformio_options: - build_flags: - - -D NSPANEL_HA_BLUEPRINT_PREBUILT + +http_request: improv_serial: id: serial_improv @@ -88,23 +78,21 @@ logger: baud_rate: 115200 ota: - id: my_ota - password: !remove - -ota_http: - exclude_certificate_bundle: true - -select: - - id: !extend tft_file_model - platform: template - options: - - "NSPanel Blank" - - "NSPanel EU" - - "NSPanel US" - - "NSPanel US Landscape" - - "NSPanel EU (CJK languages)" - - "NSPanel US (CJK languages)" - - "NSPanel US Landscape (CJK languages)" + - id: !extend ota_std + password: !remove + - id: ota_web + platform: http_request + +#select: +# - id: !extend tft_file_model +# options: +# - "NSPanel Blank" +# - "NSPanel EU" +# - "NSPanel US" +# - "NSPanel US Landscape" +# - "NSPanel EU (CJK languages)" +# - "NSPanel US (CJK languages)" +# - "NSPanel US Landscape (CJK languages)" text: - id: fw_url diff --git a/prebuilt/wall_display.yaml b/prebuilt/wall_display.yaml index 4ba0c2b4..280b00dc 100644 --- a/prebuilt/wall_display.yaml +++ b/prebuilt/wall_display.yaml @@ -15,6 +15,10 @@ substitutions: temp_max: "26" # Max supported temperature is 80°F temp_step: "0.5" # Temperature granularity is 1°F + ##### DON'T CHANGE THIS ###### + NSPANEL_HA_BLUEPRINT_PREBUILT_WALL_DISPLAY: "true" + ############################## + packages: prebuilt_package: !include nspanel_esphome_prebuilt.yaml climate_heat: !include ../esphome/nspanel_esphome_addon_climate_heat.yaml @@ -26,9 +30,6 @@ dashboard_import: esphome: project: name: esphome.Wall_Display - platformio_options: - build_flags: - - -D NSPANEL_HA_BLUEPRINT_PREBUILT_WALL_DISPLAY text: - id: !extend fw_url