# v4.2 - Multi-Alarm Control, Dual Thermostat Functionality, and More

## Support this project

**As always, we would like to thank everyone who donated to this project and remind you that every donation helps to support this project
So if you haven't made a donation yet, now would be a good time ;)**

[![Paypal](https://user-images.githubusercontent.com/41958506/212499642-b2fd097a-0938-4bfc-b37b-74df64592c58.png)](https://www.paypal.com/donate/?hosted_button_id=S974SWQMB8PB2)

## General

Hello everyone! In our latest update, we've made some great strides to enhance your experience.
We've fine-tuned the TFT upload process, making it smoother and more user-friendly for both newbies and veterans.

Exciting news – we've introduced multiple alarm control panels and added support for dual target temperature thermostats, complete with a handy new add-on.

On top of that, you've got more customization freedom now. Play around with additional custom buttons and icon size settings on your Home and button pages.
Oh, and don't miss the new clock feature on the sleep page – it's a small but nifty addition!

Dive into the details below and see how these improvements can upgrade your day-to-day. Looking forward to your feedback!

### Upcoming Change: Switching to ESP-IDF Framework by March 2024

Exciting news for our community – in just a couple of months, by March 2024, we'll be transitioning to the **ESP-IDF** as our default framework.
This upgrade is designed to significantly increase the available memory on the ESP, making more room for new features and your customizations.

While the change is around the corner, there's no need to rush. You have time to get ready for this transition.
When it's time to switch, you’ll need to flash your device using a serial cable, similar to what you did for your first custom firmware installation.

If you happen to need a serial firmware installation before March, consider giving `esp-idf` a try earlier.
It’s already supported and a good step towards future-proofing your setup.

And if you're not able to make the switch by March or can't flash via serial, don't worry.
You’ll still have the option to use the `arduino` framework and update your device wirelessly (OTA).

For all the details on customizing the framework, our [customization docs](docs/customization.md#framework-esp-idf) are there to help.
We're committed to making this transition as smooth as possible, so reach out if you have any concerns or need assistance.

## Updating

Updates may come with changes on the blueprint inputs and we highly recommend you review your settings and make sure all fields have the correct selection.
We did our best to support your legacy settings and avoid breaking your system, but please double check your settings if you see something not working as expected.

### Files that need to be reloaded

1. nspanel_eu.tft,  nspanel_us.tft or nspanel_us_land.tft - v4.2
2. nspanel_esphome.yaml - v4.2
3. nspanel_blueprint.yaml - v4.2

### Instructions

 *You can find the update procedures following here:*

- [How To - All important thing you should know - Update](docs/howto.md#update-blueprint)

## Breaking changes

1. **The `background` parameter in the `esphome.xxxxx_set_component_color` service is now deprecated.**
2. **On the home and climate pages, the button layout has changed.**

    This adjustment was made to incorporate additional custom buttons on the home page and new target temperature indicators on the climate page.
3. **Wi-Fi power save mode has been reset to `NONE` as the default setting.**

    This was the standard up to v4.0. We switched it in v4.1 to accommodate Bluetooth components.
    However, since this feature isn't widely used, we're reverting to the original setting.
    For Bluetooth usage, you should manually set a different mode, such as `LIGHT`, as shown in the customization example below:

    ```yaml
    ##### My customization - Start #####
    # Enable Bluetooth proxy
    bluetooth_proxy:
    # Set Wi-Fi power save mode to "LIGHT" as required for Bluetooth on ESP32
    wifi:
    power_save_mode: LIGHT
    ##### My customization - End #####
    ```

4. **The default baud rate for advanced mode has been reverted to 115200 bps** to resolve issues that arise when rendering button pages.
5. **ESPHome v2023.12.0 has been established as the minimum required version** to ensure optimal performance and compatibility, particularly with the recent developments in the Nextion component.
6. **The Alarm section in the blueprint settings has been removed.** All configurations previously made in this section have been automatically transferred to custom button 07.
7. **Documentation in German is no longer maintained.** This change allows us to more efficiently update and maintain the remaining documentation.
8. **Reversion to "Toggle" as default action for automation entities on buttons.**

    In this update, we have reverted the default action for button presses on automation. entities back to "Toggle".
    This change reverses the adjustment made in version 4.1, where "Trigger" was set as the default action.

    **Impact:**

    - **Default Behavior:** With this reversion, pressing a button linked to an automation entity will now enable or disable the automation, as it did prior to version 4.1.
    - **Consistency and Familiarity:** This change aims to align with user expectations and maintain consistency in the user experience.
    - **Customization Still Available:** Users still have the option to manually set "Trigger" as the action for their `automation.` entities, as per their preference.

    We understand that changes in default settings can impact your workflows.
    We appreciate your understanding as we strive to balance new features with the familiarity and stability of the user experience.
9. **Advanced mode no longer enforces a specific framework.**

    In the past, the enforcement of framework changes by the advanced mode could inadvertently result in users switching frameworks during OTA updates.
    This practice was not recommended due to the potential for errors.
10. **Alarm page cannot be used as wake-up page.**

    As multiple alarms are supported now, the system don't know which one to show on the wake-up.
11. **Refinement of Icon Presentation**

    In our continuous pursuit to refine the user experience, we've embarked on standardizing the presentation of icons across various pages.
    This initiative may lead to noticeable changes in icon appearance and behavior,
    encompassing aspects like the introduction of new colors for alarms, lights, climate icons,
    and the adoption of fresh icon designs.

    Our aim with these modifications is to establish a default presentation that adheres to a unified standard,
    enhancing both consistency and user experience across the platform.
    While this approach simplifies the overall design,
    it still preserves a degree of customization through blueprint settings.

    The complexity of managing icon colors, especially for items with multi-state attributes like alarm control panels,
    climate controls, and lights with adjustable brightness and color, has prompted us to rethink our approach.
    The current version implements domain-based colors for multi-state items, with specific states for alarms and climate being hard-coded.
    We're exploring ways to offer user-selectable colors for these states in future updates.

    The new color logic is as follows:
    - For the `off` state: Icons will be displayed in **gray**.
    - For states other than `off`:
        - For alarms and climate: Each state will have a specific, hard-coded color for immediate recognition.
        - For lights: If supported, the icon will reflect the light's RGB color, proportionally dimmed to match its brightness.
        - For other domains: Icons will be displayed in **white**.

    This transition towards a more standardized icon presentation is a step forward in enhancing
    the interface's intuitiveness while balancing it with the flexibility of customization.
    We understand this change might be an adjustment from previous versions,
    but our goal is to streamline the experience without compromising the essence of personalization.
12. ***Action required:* Reset your wake-up page selection.**

    We've enhanced the wake-up page functionality for improved consistency after power cycles.
    Previously, the system didn't remember your selection following a power outage.
    With our latest update, this issue has been resolved.
    However, this improvement requires you to reselect your wake-up page one more time.
    Thanks for your cooperation in making these settings more reliable for everyday use.

## Overview of noteworthy changes

1. Standardized entity icons
2. Additional custom buttons on Home page
3. Outdoor temperature selectable font size
4. Select icon size for button's pages
5. Support to CJK languages (experimental)
6. Improved TFT transfer
7. Multiple Alarm Control Panels
8. Support to `remote`
9. Home page chips now supports covers
10. Chips can be inverted
11. Add swipe control to screensaver page
12. Enhanced control for automation entities on buttons
13. Dual thermostat controller support (add-on)
14. Dual thermostat display
15. Enhanced timeout flexibility for Sleep, Page fallback, and Dimming settings
16. Display time on the `screensaver` page

## Details of noteworthy changes

### 1. Standardized entity icons

The engine for defining the icons to be shown and it's color was standardize between all the pages, so now you may see a more consistent User's Interface.
We've upgraded the icon definition engine to standardize the appearance and color of icons across all pages.
This enhancement leads to a more consistent and harmonious user interface.
Expect a unified visual experience that aligns the look and feel of icons throughout the system, contributing to improved navigation and aesthetic appeal.

### 2. Additional custom buttons on Home page

It's that simple, now you have 7 buttons where used to be 3.
Well, where used to be 4, as the space previously used by the Alarm button is now a custom button. 😉

### 3. Outdoor temperature selectable font size

Now you can select the font size of your outdoor temperature display:

![image](https://github.com/Blackymas/NSPanel_HA_Blueprint/assets/94725493/263f14d6-39f7-41d2-ae12-72f403d811fd)

> Important: Long text with bigger fonts may exceed the limit of space reserved for this with incomplete information shown.

### 4. Select icon size for button's pages

You can also select the size of the icons on the buttos pages:

![HA Blueprint - Buttons pages icon's size](docs/pics/ha_blueprint_buttons_pages_icon_size.png)

![EU Buttons pages - Small icons](docs/pics/eu_buttonpages_icon_small.png)

![EU Buttons pages - Large icons](docs/pics/eu_buttonpages_icon_large.png)

### 5. Support to CJK languages (experimental)

You will find 3 new TFT files on the repository for the CJK languages.
These files are considerably bigger, as the fonts requires more memory, but it should work fine in your panel.

**ATTENTION:** This is an experimental feature and may contain bugs or some areas missing translations.
Please report if you find anything.

### 6. Improved TFT transfer

#### TFT file selectors

We still working on the Upload TFT engine to make it easier for new and for experienced users.
Now, together with the **Update TFT Display** button, you will find also **Update TFT Display - Model** and **Update TFT Display - Branch** (disabled by default)
where you can select the different model you are using and the upload URL will be automatically adjusted to donwload the file directly from the repository on GitHub,
making this process much easier and removing the need of flashing your device every time you want to play with another TFT file or install the `nspanel_blank.tft`.

![HA Blueprint - Update TFT controls](docs/pics/ha_blueprint_upload_tft_controls.png)

If you have issues with the remote file and want to transfer it from your local server just as before, simply select **Use nextion_update_url** in **Update TFT Display - Model**.

And you also can use the `esphome.xxxxx_upload_tft_url` service to upload using an alternative URL without the need of flash your panel again.

#### Alternative baud rate for TFT uploads

You can select an alternative baud rate for your TFT uploads.
This allows faster TFT uploads and also supports displays previously set with baud rates not supported by this project (currently 115200 bps and 921600 bps).

In most cases, this would be set for a higher value to enable faster TFT transfer.
The default is 921600 bps, the maximum supported by Nextion displays.

You can also use this if you have issues with TFT transfer and want to try a lower baud rate as in some rare cases Nextion will automatically set itself to 9600 bps.

To enable an alternative upload TFT baud rate, add the desired value in your substitutions like this:

```yaml
  upload_tft_baud_rate: "9600"
```

If an invalid value is entered, 115200 bps will be used.
The default value for this substitution (in case it is not set by users) will be 921600 bps.

During a TFT transfer, the system will always fall back to the standard baud rate (115200 bps) if other tentatives fails.

### 7. Multiple Alarm Control Panels

Now alarm control panel entities can be assigned to chips and custom buttons in the Home page,
but also to hardware buttons, any of the buttons pages or entities pages, similarly to other domains.

### 8. Support to `remote`

Entities from the `remote` domain can now be assigned to buttons (hardware and buttons pages) and custom buttons (home and climate pages).

The service `remote.toggle` will be called when the button is pressed.

### 9. Home page chips now supports covers

That's it!
Chips now include cover visualization, allowing for easy monitoring of covers directly from the Home page.

### 10. Chips can be inverted

Chips now have an 'invert' option on the blueprint settings, providing additional customization flexibility.

### 11. Add swipe control to Screensaver page

You can now navigate to button pages from the screensaver while your panel is in sleep mode.
The swipe controls will function as they do on the Home page.

### 12. Enhanced control for automation entities on buttons

We're pleased to announce a new feature that offers users enhanced control over their smart home setups.
Now, you can globally select between **Toggle** and **Trigger** actions for button presses on automation entities.
This update allows for a more personalized and efficient control experience, tailored to your unique preferences.

#### Key features

- **Toggle:** This action will enable or disable the automation.
It is set as the default option.
- **Trigger:** This action will execute the automation regardless of its current state, providing more flexibility.

#### How to use

1. Access your configuration for automation under **Services** > **Automations & Scenes**.
Select the automation associated with your panel setup.
1. Scroll to the **ADVANCED SETTINGS** section at the end.
1. From the menu, select your desired action - either **Toggle** or **Trigger**.
1. Apply the setting.
This will then be effective across all relevant entities.

This update is specially designed to cater to diverse user needs, ensuring a more intuitive and responsive smart home experience.

### 13. Dual thermostat controller support (add-on)

This new add-on enables the NSPanel to manage both heating and cooling systems simultaneously, utilizing its dual relay functionality.

#### Key Benefits

- **Versatility:** Users can now configure their NSPanel to control both a heater and a cooler, offering increased flexibility in home temperature management.
- **Efficiency:** With the ability to control both heating and cooling systems, the NSPanel can more effectively maintain desired temperatures, potentially leading to energy savings.
- **User Experience:** This update simplifies the user interface by integrating control of both systems into one panel, making it easier to manage home climate.

#### Implementation Details

- The dual thermostat controller functionality allows the NSPanel to utilize both of its relays for separate heating and cooling control.

  Users can configure their heating and cooling settings independently, providing a tailored climate control experience.
- The update is designed to be intuitive and user-friendly, ensuring a seamless transition for existing NSPanel users.
- Additional Documentation: For detailed instructions and configurations, refer to the updated [add-on climate documentation](docs/addon_climate.md).

#### Note to Users

This feature enhances the capabilities of the NSPanel without compromising its existing functionalities.
Users who previously used the NSPanel for single-mode (either heating or cooling) control can
now explore dual-mode options for a more comprehensive climate control solution.

### 14. Enhanced Climate Page for Dual Thermostat Control

Leveraging the capabilities introduced with the Dual Thermostat Controller add-on,
the existing climate page has been upgraded to support systems with dual temperature settings.
This enhancement allows users to effectively manage thermostats that require both heating and cooling target temperatures, directly from the NSPanel's interface.
While originally developed to complement the new add-on,
this refined climate page also seamlessly extends its functionality to existing thermostats with dual set capabilities,
offering a more versatile and comprehensive climate control experience.

### 15. Enhanced timeout flexibility for Sleep, Page fallback, and Dimming settings

We have improved the functionality of our system by enhancing the timeout flexibility for Sleep, Page Fallback, and Dimming settings.
The previous timeout limit of 300 seconds has been significantly expanded, offering users more control and customization options for these specific features.
This enhancement allows for a wider range of use cases, catering to the needs of those who require extended periods for these settings,
while still maintaining the option for shorter durations.

### 16. Display time on the `screensaver` page

In this release, we're excited to introduce a new feature that adds a display time function to the Screensaver page.
With this update, our screensaver not only serves its primary purpose of saving screen energy but also doubles as an informative display,
reflecting our commitment to creating practical, user-friendly solutions.

You can enable this feature on the bueprint settings, at the **CUSTOM CONFIGURATION** section (almost at the end).
You also have to set **Display Brightness Sleep** at the device's page (**Settings** > **Devices & Services** > **ESPHome**).

## What's Next?

Discover what's next and what we are working on right now in our [Milestones](https://github.com/Blackymas/NSPanel_HA_Blueprint/milestones?direction=asc&sort=due_date)

## Special thanks to

- @bluefoxlee - For the CJK fonts and all the support with #1359.
- @Floppe - Fix entity pages labels, #1455
- @tikismoke - Customization guide: Exposing relay fallback switch to Home Assistant, #1537

## Previous releases

- [v4.1.4 - Support to Home Assistant 2023.12.0](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v4.1.4)
- [v4.1.3 - Bug fixes](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v4.1.3)
- [v4.1.2 - Bug fixes and minor enhancements](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v4.1.2)
- [v4.1.1 - UI Enhancements and Reintroduction of `play_rtttl` Service](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v4.1.1)
- [v4.1 - Easier TFT transfer](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v4.1)
- [v4.0.2 - Bug fixes](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v4.0.2)
- [v4.0.1 - Bug fixes](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v4.0.1)
- [v4.0 - Alarm and Media player pages, Climate add-ons and a more robust panel](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v4.0)
- [v3.4.1 - Patch for issues when compiling with ESPHome 2023.7.0](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v3.4.1)
- [v3.4 - New climate page and some bug fixes](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v3.4)
- [v3.3 - New improvements and some issues fixed](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v.3.3)
- [v3.2.2 - fixed some bugs performance improvement](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v3.2.2)
- [v3.2.1 - New features and some fixes](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v3.2.1)
- [v3.2 - New features and custom configurations](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v.3.2)
- [v3.1.0 - New features and US Version](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v.3.1.0)
- [v3.0.0 - major update with many features and improvements](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v.3.0.0)
- [v2.2.0 - 25 new languages added](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v.2.2.0)
- [v2.1.0 - New Domains, Buttons and Button Page Label](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v2.1.0)
- [v2.0.2](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v2.0.2)
- [v2.0.1 - Bug Fixes](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v2.0.1)
- [v2.0.0](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v2.0.0)
- [v1.0.1 Blueprint](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/latest)
