diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index efc1f5b2..2bd74e81 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -399,7 +399,7 @@ jobs: - name: Update manifest.json - name uses: jossef/action-set-json-field@v2.2 - if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev' + if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request' with: file: ${{ steps.build_nspanel_fw.outputs.name }}/manifest.json field: name @@ -407,7 +407,7 @@ jobs: - name: Update manifest.json - version uses: jossef/action-set-json-field@v2.2 - if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev' + if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request' with: file: ${{ steps.build_nspanel_fw.outputs.name }}/manifest.json field: version @@ -415,7 +415,7 @@ jobs: - name: Update manifest.json - builds.chipFamily uses: jossef/action-set-json-field@v2.2 - if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev' + if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request' with: file: ${{ steps.build_nspanel_fw.outputs.name }}/manifest.json field: builds.chipFamily @@ -423,7 +423,7 @@ jobs: - name: Update manifest.json - builds.ota.path uses: jossef/action-set-json-field@v2.2 - if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev' + if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request' with: file: ${{ steps.build_nspanel_fw.outputs.name }}/manifest.json field: builds.ota.path @@ -431,14 +431,14 @@ jobs: - name: Update manifest.json - builds.ota.release_url uses: jossef/action-set-json-field@v2.2 - if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev' + if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request' with: file: ${{ steps.build_nspanel_fw.outputs.name }}/manifest.json field: builds.ota.release_url value: "https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v${{ steps.extract_version.outputs.version }}" - name: Move and Rename Firmware File - nspanel_esphome_prebuilt - if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev' + if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request' run: | mkdir -p prebuilt cp -R ${{ steps.build_nspanel_fw.outputs.name }}/. prebuilt/${{ steps.build_nspanel_fw.outputs.name }}/ @@ -455,7 +455,7 @@ jobs: - name: Update manifest.json - name uses: jossef/action-set-json-field@v2.2 - if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev' + if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request' with: file: ${{ steps.build_wall_display_fw.outputs.name }}/manifest.json field: name @@ -463,7 +463,7 @@ jobs: - name: Update manifest.json - version uses: jossef/action-set-json-field@v2.2 - if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev' + if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request' with: file: ${{ steps.build_wall_display_fw.outputs.name }}/manifest.json field: version @@ -471,7 +471,7 @@ jobs: - name: Update manifest.json - builds.chipFamily uses: jossef/action-set-json-field@v2.2 - if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev' + if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request' with: file: ${{ steps.build_wall_display_fw.outputs.name }}/manifest.json field: builds.chipFamily @@ -479,7 +479,7 @@ jobs: - name: Update manifest.json - builds.ota.path uses: jossef/action-set-json-field@v2.2 - if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev' + if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request' with: file: ${{ steps.build_wall_display_fw.outputs.name }}/manifest.json field: builds.ota.path @@ -487,14 +487,14 @@ jobs: - name: Update manifest.json - builds.ota.release_url uses: jossef/action-set-json-field@v2.2 - if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev' + if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request' with: file: ${{ steps.build_wall_display_fw.outputs.name }}/manifest.json field: builds.ota.release_url value: "https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v${{ steps.extract_version.outputs.version }}" - name: Move and Rename Firmware File - wall_display - if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev' + if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request' run: | mkdir -p prebuilt cp -R ${{ steps.build_wall_display_fw.outputs.name }}/. prebuilt/${{ steps.build_wall_display_fw.outputs.name }}/ @@ -503,7 +503,7 @@ jobs: cp ${{ steps.build_wall_display_fw.outputs.name }}/manifest.json prebuilt/wall_display.manifest.json || true - name: Generate checksum for Firmware Files - if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev' + if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request' 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 @@ -511,7 +511,7 @@ jobs: md5sum prebuilt/wall_display.factory.bin > prebuilt/wall_display.factory.bin.md5 - name: Commit and Push Firmware Files - if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev' + if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request' run: | git config --global user.name 'GitHub Actions' git config --global user.email 'actions@github.com' diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 73aac791..0825f491 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,127 +1,125 @@ -# v4.4 - Automatic TFT Update +# v4.4 - Dynamic QR Codes, Improved Usability, and More ## General -This release introduces the option to automatically update the TFT when an older version is detected, -simplifying the update process and ensuring your panel always runs the latest display firmware. +Version 4.4 focuses on enhancing the usability and functionality of your NSPanel. The device page has been +refined for a cleaner, more user-friendly experience, now allowing you to control the panel as a light. + +In addition to improved performance, this release introduces dynamic QR codes, automatic TFT updates, and +new features like buzzer volume control and configurable wake-up settings, making your panel more versatile. ## Breaking Changes and Guidance ### Home Assistant v2024.11.0 and ESPHome v2024.11.0 are required -Please refer to our [Version Compatibility Matrix](https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/version_compatibility.md) for a full list. - -### Changes on the versioning requires updating all the three components -Moving forward, update all three components (Blueprint, ESPHome, and TFT) together to ensure consistency. - -### Many diagnostic sensors disappeared -I know some of you love some of those, but we had to compromise something to free-up a bit of memory for the new things. -The values are now shown in the logs and if you need as a sensor please report as an issue and we can support with customizations. +Refer to our +[Version Compatibility Matrix](https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/version_compatibility.md). -### Users using the "Display as a light" customization must remove it -This is now part of the core system. +### Versioning changes require updating all three components +Update all components (Blueprint, ESPHome, and TFT) together for compatibility and consistency. -### Several changes in the API -Now all actions will use a common way of transferring information to ESPHome, with the main goal to make it easier to use, -but also trying to reduce the communication between ESPHome and Nextion, preventing buffer overflows and slowness on the interface. -We highly recommend visiting our [API documentation](docs/api.md) for the latest syntax for the different actions. +### Diagnostic sensors removed +Some diagnostic sensors were removed to free memory for new features. Their values are logged; request custom +sensor support via an issue if required. -In addition to this standardization, there are some noteworth changes to the API: -1. Deprecated actions: +### "Display as a light" customization removed +This feature is now part of the core system. Remove the related YAML customization from your configuration. - - | Deprecated action | Replacement | Previous use | - | :--: | :--: | :-- | - | `init_global`
`init_hardware`
`hw_button_state` | `set_number`
`set_string` | Used to send settings at boot | - | `init_page_home` | [`component`](docs/api.md#component-action-component) | Used to send global values to page Home | - | `set_timezone` | `set_string` | Used to send time zone settings at boot | - | `component_text`
`component_color`
`component_visibility`
`icon`| [`component`](docs/api.md#component-action-component) | Used to set a component on the display | - +### API changes and standardization +All actions now use a unified method to transfer information, reducing overhead and improving responsiveness +between ESPHome and Nextion. Visit the updated [API documentation](docs/api.md) for details. -1. Sensor `blueprint_status` was removed +#### Key API Changes: +1. **Deprecated actions** + + | Deprecated action | Replacement | Previous use | + | :--------------------------------- | :----------------------- | :----------------------------- | + | `init_global`, `init_hardware` | `set_number`, `set_string` | Sent settings at boot | + | `init_page_home` | [`component`](docs/api.md#component-action-component) | Sent values to page Home | + | `set_timezone` | `set_string` | Sent timezone settings | + | `component_text`, `icon`, etc. | [`component`](docs/api.md#component-action-component) | Set display components | + - The boot process was totally rebuilt and this info is now transferred via events. +2. **Sensor `blueprint_status` removed** + Boot info is now transferred via events. -1. Notification unread sensor - - The former "**Notification unread**" switch is now a binary sensor. +3. **Notification unread switch replaced** + The "**Notification unread**" switch is now a binary sensor. ### Customizations -We made improvements in some scripts, so the customizations using those scripts must be updated: -- [Sleep & Wake-up buttons](docs/customization.md#sleep--wake-up-buttons) +Updated scripts require adjustments to these customizations: +- [Sleep & Wake-up buttons](docs/customization.md#sleep--wake-up-buttons) - [Set display as a light (deprecated)](docs/customization.md#set-display-as-a-light) ## Noteworthy Changes ### Dynamic QR Code -- **Description:** - Introduces the ability to assign an entity (supports input text or sensors) to a QR code. - The QR code will automatically update on the panel when the entity's value changes. - - In addition, the limit for a QRcode was extended to 96 chars (or bytes), giving more room for complex codes. - - This feature is useful in cases where you have dynamic content, such as a Wi-Fi password, and - want the panel to display the updated value in real-time. - - Your current selection for QRcode still working, as it will be used as a fallback value when an entity is not used or is used, but it is unavailable. -- **Related Issue Numbers:** - - #452 - - #2282 - - #2283 - -### Full support to 921600bps -- **Description:** - The default baud rate for the communication between ESP32 (ESPHome) and the Nextion Display was changed from 115200bps to 921600bps, multiplying by 8 the transfer rate. - This may increase the responsiveness and user experience, and will allow for future development of features which requires more of this communication. -- **Related Issue Numbers:** - - #2230 -- **Issues and discussions that could benefit from this in the future:** - - #1270 - - #2328 - - #2357 +Assign an entity (input text or sensor) to a QR code. The QR code updates dynamically with entity value changes. +QR code length limit extended to 96 chars for more complex codes. + +If no entity is set or is unavailable, the fallback QR code is used. + +**Related Issues:** +- #452 +- #2282 +- #2283 + +### Full support for 921600bps +Communication baud rate between ESP32 and Nextion increased from 115200bps to 921600bps, enhancing transfer speed. +This supports better user experience and future feature development. + +**Related Issues:** +- #2230 +- #1270 +- #2328 +- #2357 ### Buzzer volume control -- **Description:** - Now you can set the volume level of your panel's buzzer, allowing to better experience when using your panel for sounds. - -> [!NOTE] -> You can disable the sound on changing volume by adding the following to your panel's substitutions: -> ```yaml -> substitutions: -> tone_volume_change: "none" # Or choose your own RTTTL tone - -### Screen Wake-Up on Hardware Button Press Configurable -- **Description:** Added a new switch to configure whether the panel should wake up when a hardware button is pressed. - This switch is available under **Settings** > **Devices & services** > **ESPHome** in Home Assistant. - It provides users with flexibility to control display wake-up behavior via hardware buttons. -- **Issue Number:** #2194 - -### TFT Update Automatically -- **Description:** Introduced an automatic TFT update mechanism that triggers whenever the system detects an outdated TFT version. - This enhancement streamlines the process of keeping your NSPanel display firmware up to date, minimizing manual intervention. -- **Issue Number:** #2227 - -### Versioning Engine Updated to Enforce Patch-Level Consistency -- **Description:** Updated the versioning engine to require all components (Blueprint, ESPHome, and TFT) to match at the patch level, - enhancing reliability by ensuring all parts are fully synchronized. This supports the new automatic TFT update feature. - -### Panel Display Control via Light Entity -- **Description:** Introduced a light entity to represent the NSPanel's display, allowing users to control the panel’s brightness, wake it up, - or put it to sleep through third-party automations designed for lights. - Users with existing customizations should remove them from their YAML configuration. -- **Issue Number:** #2091 - -### Updated CLIMATE_MODE_AUTO Icon on Climate Page -- **Description:** Updated the CLIMATE_MODE_AUTO icon on the Climate page from “mdi:calendar-sync” to “mdi:refresh-auto.” - This change provides a clearer representation of the automatic mode. -- **Issue Number:** #2243 - -### Updated References from `service` to `action` for Compatibility with New Standards -- **Description:** Updated all references from `service` to `action` to comply with Home Assistant v2024.8.0 and ESPHome v2024.8.0 standards, - ensuring full compatibility with the latest versions. - -### Reduced Logging to Enhance Focus on Critical Information -- **Description:** Logging has been streamlined to focus on the most critical information, reducing noise and improving the clarity of logs. - While this change enhances readability and allows users to quickly identify important messages, - it may alter the behavior of existing troubleshooting processes that relied on more verbose logs. - -> [!WARNING] -> Users who depend on detailed logs for debugging may need to adjust their troubleshooting strategies or temporarily adjust log levels as needed. +Set the panel buzzer volume for a tailored sound experience. + +> [!NOTE] +> Disable sound during volume change by adding the following to substitutions: +> ```yaml +> substitutions: +> tone_volume_change: "none" # Or set a custom RTTTL tone +> ``` + +### Configurable hardware button wake-up +A new switch configures whether hardware button presses wake the panel. +Access this option via **Settings** > **Devices & services** > **ESPHome** in Home Assistant. + +**Related Issues:** +- #2194 + +### Automatic TFT updates +Automatic TFT updates now trigger when an outdated version is detected, minimizing manual intervention. + +**Related Issues:** +- #2227 + +### Versioning engine updated +All components (Blueprint, ESPHome, and TFT) now enforce patch-level version consistency, ensuring reliability. + +### Panel display control via light entity +Added a light entity for controlling the display’s brightness, waking it up, or putting it to sleep. +Remove any existing custom YAML configuration for display control. + +**Related Issues:** +- #2091 + +### Updated CLIMATE_MODE_AUTO icon +The Climate page's CLIMATE_MODE_AUTO icon changed from `mdi:calendar-sync` to `mdi:refresh-auto` for clarity. + +**Related Issues:** +- #2243 + +### References updated from `service` to `action` +Revised API to replace `service` with `action`, ensuring compatibility with Home Assistant and ESPHome standards. + +### Streamlined logging +Logging reduced to critical info, improving readability. This change may impact troubleshooting processes. + +> [!WARNING] +> Adjust log levels if more detailed information is needed for debugging. + +### Device page clean-up +The device page was refined for better usability and clarity. The panel now integrates more seamlessly +into automation workflows. diff --git a/esphome/nspanel_esphome_addon_upload_tft.yaml b/esphome/nspanel_esphome_addon_upload_tft.yaml index 52843891..cbafb6a3 100644 --- a/esphome/nspanel_esphome_addon_upload_tft.yaml +++ b/esphome/nspanel_esphome_addon_upload_tft.yaml @@ -14,11 +14,6 @@ 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 - # yamllint disable rule:comments-indentation api: actions: @@ -80,6 +75,11 @@ display: tft_url: ${nextion_update_url} exit_reparse_on_start: true +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT + globals: - id: tft_upload_attempt type: uint8_t diff --git a/esphome/nspanel_esphome_core.yaml b/esphome/nspanel_esphome_core.yaml index 8bcc0c88..30454ac4 100644 --- a/esphome/nspanel_esphome_core.yaml +++ b/esphome/nspanel_esphome_core.yaml @@ -9,6 +9,11 @@ api: id: api_server reboot_timeout: 60min +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE + packages: # yamllint disable rule:colons base: !include nspanel_esphome_core_base.yaml diff --git a/esphome/nspanel_esphome_core_base.yaml b/esphome/nspanel_esphome_core_base.yaml index 81ba8d0b..0a5a078b 100644 --- a/esphome/nspanel_esphome_core_base.yaml +++ b/esphome/nspanel_esphome_core_base.yaml @@ -89,7 +89,7 @@ esphome: platformio_options: build_flags: - -Wno-missing-field-initializers - - -D NSPANEL_HA_BLUEPRINT_CORE + - -D NSPANEL_HA_BLUEPRINT_CORE_BASE external_components: - source: diff --git a/esphome/nspanel_esphome_core_boot.yaml b/esphome/nspanel_esphome_core_boot.yaml index dcfd5a50..1932e065 100644 --- a/esphome/nspanel_esphome_core_boot.yaml +++ b/esphome/nspanel_esphome_core_boot.yaml @@ -41,6 +41,9 @@ display: } esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_BOOT on_boot: - priority: 600.0 then: diff --git a/esphome/nspanel_esphome_core_datetime.yaml b/esphome/nspanel_esphome_core_datetime.yaml index 997a8907..d0e9c4eb 100644 --- a/esphome/nspanel_esphome_core_datetime.yaml +++ b/esphome/nspanel_esphome_core_datetime.yaml @@ -10,6 +10,9 @@ substitutions: BOOT_STEP_DATETIME: '1UL << 2' esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_DATETIME on_boot: - priority: 600.2 then: diff --git a/esphome/nspanel_esphome_core_hw_buttons.yaml b/esphome/nspanel_esphome_core_hw_buttons.yaml index 62d8f82a..d9d449d8 100644 --- a/esphome/nspanel_esphome_core_hw_buttons.yaml +++ b/esphome/nspanel_esphome_core_hw_buttons.yaml @@ -19,6 +19,8 @@ substitutions: binary_sensor: - id: left_button # LEFT BUTTON BELOW DISPLAY TO TOGGLE RELAY name: Left Button + internal: false + icon: mdi:gesture-tap-button platform: gpio pin: number: 14 @@ -52,6 +54,8 @@ binary_sensor: - id: right_button # RIGHT BUTTON BELOW DISPLAY TO TOGGLE RELAY name: Right Button + internal: false + icon: mdi:gesture-tap-button platform: gpio pin: number: 27 @@ -81,6 +85,11 @@ binary_sensor: relay_2->toggle(); ha_button->execute(page_names[current_page_id], "hw_bt_right", "short_click"); +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_HW_BUTTONS + globals: - id: button_left_enabled type: bool @@ -229,6 +238,17 @@ script: hw_buttons_bars_refresh->stop(); hw_buttons_boot_progress->stop(); +switch: + - id: hw_button_wakeup + name: Wake-up with hardware buttons + platform: template + entity_category: config + optimistic: true + restore_mode: RESTORE_DEFAULT_OFF + internal: false + disabled_by_default: true + icon: mdi:power-sleep + time: - id: !extend time_provider on_time: diff --git a/esphome/nspanel_esphome_core_hw_buzzer.yaml b/esphome/nspanel_esphome_core_hw_buzzer.yaml index aafbe6b3..17996c09 100644 --- a/esphome/nspanel_esphome_core_hw_buzzer.yaml +++ b/esphome/nspanel_esphome_core_hw_buzzer.yaml @@ -39,6 +39,9 @@ display: buzzer->play(touch_event ? "${tone_touch_press}" : "${tone_touch_release}"); esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_HW_BUZZER on_boot: - priority: -100.44 then: @@ -59,6 +62,8 @@ number: step: 1 initial_value: 100 unit_of_measurement: "%" + internal: false + disabled_by_default: true entity_category: config device_class: sound_pressure restore_value: true @@ -103,12 +108,6 @@ script: buzzer->play("${tone_boot}"); } - - id: !extend notification_show_action # Defined by nspanel_esphome_core_page_notification.yaml - then: - - lambda: |- - if (notification_sound->state and buzzer_gain->state > 0) - buzzer->play("${tone_notification}"); - switch: - id: buzzer_touch_feedback name: Sound - Touch screen feedback @@ -128,4 +127,5 @@ switch: restore_mode: RESTORE_DEFAULT_OFF internal: false icon: mdi:volume-high + disabled_by_default: true ... diff --git a/esphome/nspanel_esphome_core_hw_display.yaml b/esphome/nspanel_esphome_core_hw_display.yaml index 4c4857e9..c7df32ee 100644 --- a/esphome/nspanel_esphome_core_hw_display.yaml +++ b/esphome/nspanel_esphome_core_hw_display.yaml @@ -132,6 +132,9 @@ display: # - nspanel_esphome_core_version.yaml esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_HW_DISPLAY on_boot: - priority: 1000.5 then: @@ -229,6 +232,9 @@ number: step: 1 restore_value: true optimistic: true + internal: false + device_class: illuminance + icon: mdi:brightness-6 on_value: then: - lambda: |- @@ -247,6 +253,9 @@ number: step: 1 restore_value: true optimistic: true + internal: false + device_class: illuminance + icon: mdi:brightness-3 on_value: then: - lambda: |- @@ -265,6 +274,9 @@ number: step: 1 restore_value: true optimistic: true + internal: false + device_class: illuminance + icon: mdi:weather-night on_value: then: - script.execute: @@ -284,6 +296,7 @@ number: restore_value: true optimistic: true internal: false + icon: mdi:gauge-empty disabled_by_default: true script: @@ -1012,7 +1025,7 @@ sensor: unit_of_measurement: "%" icon: mdi:brightness-percent internal: false - disabled_by_default: false + disabled_by_default: true update_interval: 60s switch: diff --git a/esphome/nspanel_esphome_core_hw_display_light.yaml b/esphome/nspanel_esphome_core_hw_display_light.yaml index 91021817..d958380c 100644 --- a/esphome/nspanel_esphome_core_hw_display_light.yaml +++ b/esphome/nspanel_esphome_core_hw_display_light.yaml @@ -6,6 +6,11 @@ ##################################################################################################### --- +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_HW_DISPLAY_LIGHT + light: # Add the display as a light in Home Assistant - name: Display diff --git a/esphome/nspanel_esphome_core_hw_display_timers.yaml b/esphome/nspanel_esphome_core_hw_display_timers.yaml index 81c6a830..b9ef5af0 100644 --- a/esphome/nspanel_esphome_core_hw_display_timers.yaml +++ b/esphome/nspanel_esphome_core_hw_display_timers.yaml @@ -44,6 +44,11 @@ display: then: - script.execute: timer_reset_all +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_HW_DISPLAY_TIMERS + number: - id: !extend display_brightness # Defined by nspanel_esphome_core_display.yaml on_value: @@ -239,6 +244,7 @@ select: internal: false entity_category: config icon: mdi:page-next-outline + disabled_by_default: true on_value: then: - script.execute: page_screensaver @@ -259,13 +265,4 @@ sensor: - number.set: id: display_dim_brightness value: !lambda return int(x); - -switch: - - id: hw_button_wakeup - name: Wake-up with hardware buttons - platform: template - entity_category: config - optimistic: true - restore_mode: RESTORE_DEFAULT_OFF - disabled_by_default: false ... diff --git a/esphome/nspanel_esphome_core_hw_memory.yaml b/esphome/nspanel_esphome_core_hw_memory.yaml index 2e62050a..b4c11201 100644 --- a/esphome/nspanel_esphome_core_hw_memory.yaml +++ b/esphome/nspanel_esphome_core_hw_memory.yaml @@ -12,6 +12,11 @@ substitutions: BOOT_STEP_HW_MEMORY: '1UL << 6' +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_HW_MEMORY + psram: id: ext_ram diff --git a/esphome/nspanel_esphome_core_hw_relays.yaml b/esphome/nspanel_esphome_core_hw_relays.yaml index c3fd0c54..c25048ed 100644 --- a/esphome/nspanel_esphome_core_hw_relays.yaml +++ b/esphome/nspanel_esphome_core_hw_relays.yaml @@ -9,6 +9,11 @@ substitutions: BOOT_STEP_HW_RELAYS: '1UL << 7' +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_HW_RELAYS + globals: - id: relay1_local type: bool diff --git a/esphome/nspanel_esphome_core_hw_temperature.yaml b/esphome/nspanel_esphome_core_hw_temperature.yaml index 55b4f1a2..03e4b48b 100644 --- a/esphome/nspanel_esphome_core_hw_temperature.yaml +++ b/esphome/nspanel_esphome_core_hw_temperature.yaml @@ -18,6 +18,9 @@ substitutions: BOOT_STEP_HW_TEMPERATURE: '1UL << 8' esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_HW_TEMPERATURE on_boot: - priority: 900.1 then: @@ -45,9 +48,8 @@ logger: resistance: INFO number: - ##### Temperature Correction ##### - - id: temperature_correction - name: Temperature Correction + - id: temperature_adjustment + name: Temperature Adjustment platform: template entity_category: config unit_of_measurement: °C @@ -58,6 +60,8 @@ number: mode: box restore_value: true internal: false + icon: mdi:thermometer-minus + device_class: temperature optimistic: true on_value: then: @@ -139,7 +143,7 @@ sensor: reference_resistance: 10kOhm filters: - lambda: |- - return x + temperature_correction->state; + return x + temperature_adjustment->state; on_value: then: - script.execute: display_embedded_temp # Show panel's temperature if API or Wi-Fi are out diff --git a/esphome/nspanel_esphome_core_hw_wifi.yaml b/esphome/nspanel_esphome_core_hw_wifi.yaml index 4076f9f2..7c422f31 100644 --- a/esphome/nspanel_esphome_core_hw_wifi.yaml +++ b/esphome/nspanel_esphome_core_hw_wifi.yaml @@ -29,6 +29,9 @@ api: - script.execute: refresh_wifi_icon esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_HW_WIFI on_boot: - priority: 600.4 # This is where most sensors are set up. then: diff --git a/esphome/nspanel_esphome_core_page_alarm.yaml b/esphome/nspanel_esphome_core_page_alarm.yaml index 7af04823..d39b1c45 100644 --- a/esphome/nspanel_esphome_core_page_alarm.yaml +++ b/esphome/nspanel_esphome_core_page_alarm.yaml @@ -47,6 +47,11 @@ api: supported_features & 16, state == "armed_bypass"); } +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_PAGE_ALARM + script: - id: alarm_button_renderer mode: restart diff --git a/esphome/nspanel_esphome_core_page_blank.yaml b/esphome/nspanel_esphome_core_page_blank.yaml index 08f40ce6..48279445 100644 --- a/esphome/nspanel_esphome_core_page_blank.yaml +++ b/esphome/nspanel_esphome_core_page_blank.yaml @@ -10,6 +10,11 @@ substitutions: BOOT_STEP_PAGE_BLANK: '1UL << 27' PAGE_ID_BLANK: '0' +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_PAGE_BLANK + script: - id: !extend boot_progress_dump then: diff --git a/esphome/nspanel_esphome_core_page_boot.yaml b/esphome/nspanel_esphome_core_page_boot.yaml index 9232cada..40e28e03 100644 --- a/esphome/nspanel_esphome_core_page_boot.yaml +++ b/esphome/nspanel_esphome_core_page_boot.yaml @@ -11,6 +11,9 @@ substitutions: PAGE_ID_BOOT: '0' esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_PAGE_BOOT on_boot: - priority: 601.0 then: diff --git a/esphome/nspanel_esphome_core_page_buttons.yaml b/esphome/nspanel_esphome_core_page_buttons.yaml index 9ef30b9f..41b4f505 100644 --- a/esphome/nspanel_esphome_core_page_buttons.yaml +++ b/esphome/nspanel_esphome_core_page_buttons.yaml @@ -96,6 +96,9 @@ api: } esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_PAGE_BUTTONS on_boot: - priority: 1000.11 then: diff --git a/esphome/nspanel_esphome_core_page_climate.yaml b/esphome/nspanel_esphome_core_page_climate.yaml index f450cdc3..f4269c71 100644 --- a/esphome/nspanel_esphome_core_page_climate.yaml +++ b/esphome/nspanel_esphome_core_page_climate.yaml @@ -70,6 +70,11 @@ display: goto_page_id->execute(${PAGE_ID_CLIMATE}, false); } +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_PAGE_CLIMATE + globals: - id: is_climate type: bool diff --git a/esphome/nspanel_esphome_core_page_confirm.yaml b/esphome/nspanel_esphome_core_page_confirm.yaml index 152798da..d320ee21 100644 --- a/esphome/nspanel_esphome_core_page_confirm.yaml +++ b/esphome/nspanel_esphome_core_page_confirm.yaml @@ -11,6 +11,11 @@ substitutions: BOOT_STEP_PAGE_CONFIRM: '1UL << 13' PAGE_ID_CONFIRM: '26' +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_PAGE_CONFIRM + globals: #### Localization (MUI) #### - id: mui_please_confirm diff --git a/esphome/nspanel_esphome_core_page_cover.yaml b/esphome/nspanel_esphome_core_page_cover.yaml index 02d737f7..d1d3e227 100644 --- a/esphome/nspanel_esphome_core_page_cover.yaml +++ b/esphome/nspanel_esphome_core_page_cover.yaml @@ -10,6 +10,11 @@ substitutions: BOOT_STEP_PAGE_COVER: '1UL << 14' PAGE_ID_COVER: '11' +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_PAGE_COVER + script: - id: !extend boot_progress_dump then: diff --git a/esphome/nspanel_esphome_core_page_entities.yaml b/esphome/nspanel_esphome_core_page_entities.yaml index 58499bd5..7fd83b6c 100644 --- a/esphome/nspanel_esphome_core_page_entities.yaml +++ b/esphome/nspanel_esphome_core_page_entities.yaml @@ -14,6 +14,11 @@ substitutions: PAGE_ID_ENTITYPAGE04: '21' half_width_chars: "iljtIf '-,;:!.\\\"|()[]{}*^~\\\\/_" +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_PAGE_ENTITIES + globals: - id: page_entity_value_horizontal_alignment type: uint8_t diff --git a/esphome/nspanel_esphome_core_page_fan.yaml b/esphome/nspanel_esphome_core_page_fan.yaml index 46d09cd4..9e9aff57 100644 --- a/esphome/nspanel_esphome_core_page_fan.yaml +++ b/esphome/nspanel_esphome_core_page_fan.yaml @@ -30,6 +30,11 @@ display: } } +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_PAGE_FAN + script: - id: !extend boot_progress_dump then: diff --git a/esphome/nspanel_esphome_core_page_home.yaml b/esphome/nspanel_esphome_core_page_home.yaml index c74c03d6..f34590a8 100644 --- a/esphome/nspanel_esphome_core_page_home.yaml +++ b/esphome/nspanel_esphome_core_page_home.yaml @@ -10,6 +10,11 @@ substitutions: BOOT_STEP_PAGE_HOME: '1UL << 17' PAGE_ID_HOME: '1' +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_PAGE_HOME + globals: ##### Date/time formats ##### - id: home_date_color diff --git a/esphome/nspanel_esphome_core_page_keyb_num.yaml b/esphome/nspanel_esphome_core_page_keyb_num.yaml index 6a63d761..fd25351d 100644 --- a/esphome/nspanel_esphome_core_page_keyb_num.yaml +++ b/esphome/nspanel_esphome_core_page_keyb_num.yaml @@ -10,6 +10,11 @@ substitutions: BOOT_STEP_PAGE_KEYBOARD_NUM: '1UL << 18' PAGE_ID_KEYB_NUM: '24' +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_PAGE_KEYB_NUM + script: - id: !extend boot_progress_dump then: diff --git a/esphome/nspanel_esphome_core_page_light.yaml b/esphome/nspanel_esphome_core_page_light.yaml index 1d9c205a..e1a19fc0 100644 --- a/esphome/nspanel_esphome_core_page_light.yaml +++ b/esphome/nspanel_esphome_core_page_light.yaml @@ -24,6 +24,11 @@ display: } } +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_PAGE_LIGHT + script: - id: !extend boot_progress_dump then: diff --git a/esphome/nspanel_esphome_core_page_media_player.yaml b/esphome/nspanel_esphome_core_page_media_player.yaml index 13b1359b..bcad0b59 100644 --- a/esphome/nspanel_esphome_core_page_media_player.yaml +++ b/esphome/nspanel_esphome_core_page_media_player.yaml @@ -161,6 +161,11 @@ display: } } +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_PAGE_MEDIA_PLAYER + globals: - id: media_player_last_volume_level # Last volume level from Home Assistant type: uint8_t diff --git a/esphome/nspanel_esphome_core_page_notification.yaml b/esphome/nspanel_esphome_core_page_notification.yaml index d5eec94f..89eaf4fa 100644 --- a/esphome/nspanel_esphome_core_page_notification.yaml +++ b/esphome/nspanel_esphome_core_page_notification.yaml @@ -42,8 +42,11 @@ api: binary_sensor: - id: notification_unread - name: Notification unread + name: Notification Unread platform: template + internal: false + icon: mdi:bell-alert-outline + disabled_by_default: true display: - id: !extend disp1 @@ -73,8 +76,11 @@ display: } esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_PAGE_NOTIFICATION on_boot: - - priority: 600.3 + - priority: 600.21 then: - lambda: |- notification_label->publish_state(""); @@ -111,8 +117,6 @@ script: label: string message: string then: - # Extended by: - # nspanel_esphome_core_hw_buzzer.yaml - lambda: |- set_component_visibility->execute(${PAGE_ID_HOME}, "bt_notific", true); goto_page_id->execute(${PAGE_ID_NOTIFICATION}, true); @@ -122,10 +126,25 @@ script: notification_label->publish_state(label.c_str()); notification_text->publish_state(message.c_str()); notification_unread->publish_state(true); + // Only when buzzer is available + #ifdef NSPANEL_HA_BLUEPRINT_CORE_HW_BUZZER + notification_play_sound->execute(); + #endif + + - id: notification_play_sound + mode: single + then: + - lambda: |- + // Only when buzzer is available + #ifdef NSPANEL_HA_BLUEPRINT_CORE_HW_BUZZER + if (notification_sound->state and buzzer_gain->state > 0) + buzzer->play("${tone_notification}"); + #endif - id: !extend stop_all then: - lambda: |- + notification_play_sound->stop(); page_notification->stop(); switch: @@ -135,11 +154,31 @@ switch: entity_category: config optimistic: true restore_mode: RESTORE_DEFAULT_OFF + on_turn_on: + then: + - lambda: |- + // Only when buzzer is available + #ifdef NSPANEL_HA_BLUEPRINT_CORE_HW_BUZZER + if (notification_unread->state) + notification_play_sound->execute(); + #endif + on_turn_off: + then: + - lambda: |- + notification_play_sound->stop(); + // Only when buzzer is available + #ifdef NSPANEL_HA_BLUEPRINT_CORE_HW_BUZZER + if (buzzer->is_playing()) + buzzer->stop(); + #endif text_sensor: - id: notification_label name: Notification Label platform: template + internal: false + icon: mdi:bell-outline + disabled_by_default: true on_value: then: - homeassistant.event: @@ -154,6 +193,9 @@ text_sensor: - id: notification_text name: Notification Text platform: template + internal: false + icon: mdi:message-text-outline + disabled_by_default: true on_value: then: - homeassistant.event: diff --git a/esphome/nspanel_esphome_core_page_qrcode.yaml b/esphome/nspanel_esphome_core_page_qrcode.yaml index 4a49ea51..1b23f9a8 100644 --- a/esphome/nspanel_esphome_core_page_qrcode.yaml +++ b/esphome/nspanel_esphome_core_page_qrcode.yaml @@ -33,6 +33,11 @@ api: if (!complete_boot_step(${BOOT_STEP_PAGE_QRCODE})) boot_progress->execute(${BOOT_STEP_PAGE_QRCODE}, "Page QRcode"); +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_PAGE_QRCODE + globals: - id: qrcode_string type: std::string diff --git a/esphome/nspanel_esphome_core_page_screensaver.yaml b/esphome/nspanel_esphome_core_page_screensaver.yaml index 81fc1029..f085f43d 100644 --- a/esphome/nspanel_esphome_core_page_screensaver.yaml +++ b/esphome/nspanel_esphome_core_page_screensaver.yaml @@ -10,6 +10,11 @@ substitutions: BOOT_STEP_PAGE_SCREENSAVER: '1UL << 23' PAGE_ID_SCREENSAVER: '9' +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_PAGE_SCREENSAVER + globals: ##### Screensaver ##### - id: screensaver_display_time diff --git a/esphome/nspanel_esphome_core_page_settings.yaml b/esphome/nspanel_esphome_core_page_settings.yaml index b8fa7277..6fec56ca 100644 --- a/esphome/nspanel_esphome_core_page_settings.yaml +++ b/esphome/nspanel_esphome_core_page_settings.yaml @@ -26,6 +26,11 @@ display: } } +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_PAGE_SETTINGS + number: - id: !extend display_brightness on_value: diff --git a/esphome/nspanel_esphome_core_page_utilities.yaml b/esphome/nspanel_esphome_core_page_utilities.yaml index 60e87557..e8dccd76 100644 --- a/esphome/nspanel_esphome_core_page_utilities.yaml +++ b/esphome/nspanel_esphome_core_page_utilities.yaml @@ -52,6 +52,11 @@ api: } } +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_PAGE_UTILITIES + script: - id: !extend boot_progress_dump then: diff --git a/esphome/nspanel_esphome_core_page_weather.yaml b/esphome/nspanel_esphome_core_page_weather.yaml index 66921c37..b3c1b7b1 100644 --- a/esphome/nspanel_esphome_core_page_weather.yaml +++ b/esphome/nspanel_esphome_core_page_weather.yaml @@ -32,6 +32,11 @@ display: goto_page_id->execute(${PAGE_ID_WEATHER01}, false); } +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_PAGE_WEATHER + globals: - id: weather_pic type: uint8_t diff --git a/esphome/nspanel_esphome_core_versioning.yaml b/esphome/nspanel_esphome_core_versioning.yaml index 6d8cc18d..9e3c659a 100644 --- a/esphome/nspanel_esphome_core_versioning.yaml +++ b/esphome/nspanel_esphome_core_versioning.yaml @@ -12,6 +12,9 @@ substitutions: BOOT_STEP_VERSIONING: '1UL << 26' esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_CORE_VERSIONING project: version: "${version}"