Direct TFT Transfer from GitHub for Arduino Users

This commit is contained in:
Edward Firmo
2024-02-07 23:57:55 +01:00
parent b02be58888
commit 0b8ac56521
6 changed files with 22 additions and 109 deletions

View File

@@ -428,10 +428,12 @@ For support, feedback, or detailed information about this update,
visit our [GitHub repository](https://github.com/Blackymas/NSPanel_HA_Blueprint)
or our [online documentation](https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/README.md).
## Patch v4.2.5: Interface Refinements and Essential Documentation Updates
In this release, we've focused on enhancing the user interface and providing crucial information for a better user experience.
Key updates include refined control mechanisms for climate and cover entities, improved functionality for hardware buttons,
and the introduction of support for ESPHome's `friendly_name`.
## Patch v4.2.5: Celebrating 1000 Stars with Minor Bug Fixes and UI Enhancements
To celebrate crossing the 1000-star milestone on our GitHub repository, we're thrilled to bring you Patch v4.2.5.
This update focuses on improving user interactions and system stability, featuring refined controls for climate and cover entities,
enhanced hardware button functionality, and the introduction of ESPHome's `friendly_name` support for improved device identification.
Additionally, we've simplified the TFT transfer process for Arduino users, now allowing direct downloads from GitHub, a convenience previously exclusive to ESP-IDF users.
This milestone reflects our community's support and enthusiasm, inspiring us to continue delivering quality improvements.
**Breaking Changes:**
1. **Custom entities naming changed**.
@@ -456,6 +458,7 @@ ensuring users are well-informed for successful system setup and operation.
| Motion Sensor for Display Wake-Up (#1687) | Enhancement | `Blueprint` |
| Expanded Visualization on Chips | Enhancement | `Blueprint` |
| Clean-up Blueprint Inputs (#1722) | Enhancement | `Blueprint` |
| Direct TFT Transfer from GitHub for Arduino Users | Enhancement | `ESPHome` |
| Update docs (install.md) with memory requirements (#1720) | Documentation | `Documentation` |
<!-- markdownlint-enable MD013 MD033 -->
@@ -497,6 +500,9 @@ Labels such as *"Button14"* have been updated to more descriptive formats like *
This update addresses frequent user-reported compilation errors in ESPHome, attributed to insufficient memory on compiler servers.
The updated section outlines recommended memory configurations for different installation scenarios, ensuring smoother compilation processes.
A special acknowledgement to @andythomas for his valuable contributions to this update.
- **Direct TFT Transfer from GitHub for Arduino Users**: Enhanced the TFT update process for Arduino users by enabling direct transfer of TFT files from GitHub to Nextion displays,
mirroring the functionality previously available to ESP-IDF users.
This streamlines the update workflow, removing the need for intermediate steps like using a local HTTP server, and making it easier to keep Nextion displays up-to-date.
For support, feedback, or detailed information about this update,
visit our [GitHub repository](https://github.com/Blackymas/NSPanel_HA_Blueprint)

View File

@@ -23,7 +23,7 @@ external_components:
- source:
type: git
url: https://github.com/edwardtfn/esphome
ref: nextion-21
ref: nextion-23
components:
- nextion
refresh: 300s
@@ -74,18 +74,6 @@ display:
tft_url: ${nextion_update_url}
exit_reparse_on_start: true
esphome:
on_boot:
- priority: 601.0
then:
- lambda: |-
// Hide TFT file selectors when using arduino
#ifdef ARDUINO
tft_file_model->set_internal(true);
#elif defined(ESP_PLATFORM)
tft_file_model->set_internal(false);
#endif
globals:
- id: baud_rate_original
type: uint
@@ -286,27 +274,6 @@ script:
// Upload URL
ESP_LOGD(TAG, " Upload URL: %s", url.c_str());
#ifdef ARDUINO
auto startsWith = [](const std::string& str, const std::string& prefix) -> bool {
if (str.length() < prefix.length()) return false;
std::string lowerStr = str.substr(0, prefix.length());
std::transform(lowerStr.begin(), lowerStr.end(), lowerStr.begin(),
[](unsigned char c){ return std::tolower(c); });
std::string lowerPrefix = prefix;
std::transform(lowerPrefix.begin(), lowerPrefix.end(), lowerPrefix.begin(),
[](unsigned char c){ return std::tolower(c); });
return lowerStr == lowerPrefix;
};
if (startsWith(url, "https")) {
ESP_LOGE(TAG, "HTTPS is not supported by Arduino framework.");
ESP_LOGE(TAG, "This transfer will most likely fail.");
ESP_LOGE(TAG, "Please use HTTP instead.");
}
#endif
disp1->set_tft_url(url.c_str());
- lambda: if (id(tft_is_valid)) disp1->goto_page("home");
@@ -499,7 +466,7 @@ select:
initial_option: "Use nextion_update_url"
optimistic: true
restore_value: true
internal: true
internal: false
entity_category: config
disabled_by_default: false
icon: mdi:file-sync

View File

@@ -63,9 +63,9 @@ They're created for each new release, allowing easy access to different project
<!-- markdownlint-enable MD028 -->
### For Nextion TFT Component
The instructions to upload TFT will vary depending on the branch or version you are installing and the framework you are using.
The instructions to upload TFT will vary depending on the version you are installing and the framework you are using.
#### v4.2 or later, with ESP-IDF framework
#### v4.2 or later (ESP-IDF) or v4.2.5 or later (Arduino)
1. Go to your device's page under **Settings** > **Devices & Services** > **ESPHome**.
2. On the **Configuration** group, select your option for **Update TFT display - Branch** (either the version you want or `dev`/`beta`).
If that option is not visible, please expand the **+n entities not shown** and enable it.
@@ -73,7 +73,7 @@ If that option is not visible, please expand the **+n entities not shown** and e
![Image](pics/ha_device_configuration_tft_update_branch_selector.png)
3. Press **Update TFT display** and wait for the upload to complete.
#### v4.1 or earlier, or Arduino framework
#### v4.1 or earlier, or v4.2.4 or earlier for Arduino framework
1. On the GitHub repository, click on your chosen version name on the [NSPanel_HA_Blueprint Tags](https://github.com/Blackymas/NSPanel_HA_Blueprint/tags) list, then select the tab **Code**.
2. Double-check that the correct version is shown below the repository name:

View File

@@ -132,11 +132,10 @@ The new firmware will be built and then flashed to your panel, which will restar
> [!IMPORTANT]
> These instructions are for updating a panel where an older version of these files are already installed.
1. (**Arduino only**) Download from our [GitHub repository](https://github.com/Blackymas/NSPanel_HA_Blueprint/) the latest version of the TFT file relative to your panel's model.
2. (**Arduino only**) Upload this file to your local www (http) server. Please use the same URL as indicated by the substitution `nextion_update_url` in your device's YAML.
3. Go to ***Settings --> Devices & Services --> Integrations***, select the display under the ESPHome integration.
4. Press the switch "**Update TFT Display**" under **Configuration**.
5. The display starts the update process and then restarts.
1. Go to ***Settings --> Devices & Services --> Integrations***, select the display under the ESPHome integration.
2. Select the "**Update TFT Display - Model**" accordingly, under **Configuration**.
3. Press the button "**Update TFT Display**".
4. The display starts the update process and then restarts.
## Notification via HA
To show a notification on the NSPAnel, the following service call can be used:

View File

@@ -100,7 +100,7 @@ Follow these steps to add a new device in the ESPHome Dashboard:
friendly_name: "Your panel's friendly name"
wifi_ssid: !secret wifi_ssid
wifi_password: !secret wifi_password
nextion_update_url: "http://homeassistant.local:8123/local/nspanel_eu.tft" # Optional for `esp-idf` framework
nextion_update_url: "http://homeassistant.local:8123/local/nspanel_eu.tft" # Optional
# Add-on configuration (if needed)
# heater_relay: "1" # Possible values: "1" or "2"
@@ -132,7 +132,7 @@ Follow these steps to add a new device in the ESPHome Dashboard:
![Edit Settings](pics/ha_esphome_dashboard_new_device_06b.png)
10. For Wi-Fi credentials, use `!secret` for added security or input them directly.
Learn about secrets in ESPHome: [Home Assistant Secrets in ESPHome](https://www.youtube.com/watch?v=eW4vKDeHh7Y).
11. (Optionally when using `esp-idf`) Adjust `nextion_update_url` to the URL of a TFT file hosted on an HTTP or HTTPS server,
11. (Optional) Adjust `nextion_update_url` to the URL of a TFT file hosted on an HTTP or HTTPS server,
ensuring that the file is accessible to the NSPanel.
This URL will be used by ESPHome to download the TFT file to your panel.
For more information on hosting the TFT file and setting up the URL, see the [Upload TFT](#upload-tft) section.
@@ -448,7 +448,7 @@ substitutions:
friendly_name: "Your panel's friendly name"
wifi_ssid: !secret wifi_ssid
wifi_password: !secret wifi_password
nextion_update_url: "http://homeassistant.local:8123/local/nspanel_eu.tft"
nextion_update_url: "http://homeassistant.local:8123/local/nspanel_eu.tft" # Optional
# Add-on configuration
# heater_relay: "1" - possible values: 1/2

View File

@@ -18,56 +18,9 @@ please refeer to the [Troubleshooting TFT transfer](tft_upload.md) guide.
## How to install a different `tft` file?
**v4.2 or later and `esp-idf` framework:**
Just go to your devices's page (under **Settings** > **Devices and Services** > **ESPHome**),
select your **Upload TFT display - Model** and then press **Upload TFT display**.
**Older versions or `arduino` framework:**
On your ESPHome settings, you have entered a url for `nextion_update_url`, in the substitutions, like this:
```yaml
substitutions:
###### CHANGE ME START ######
device_name: "YOUR_NSPANEL_NAME"
friendly_name: "Your panel's friendly name"
wifi_ssid: !secret wifi_ssid
wifi_password: !secret wifi_password
nextion_update_url: "http://homeassistant.local:8123/local/nspanel_eu.tft"
nextion_blank_url: "http://homeassistant.local:8123/local/nspanel_blank.tft"
##### addon-configuration #####
## addon_climate ##
# addon_climate_heater_relay: "1" # possible values: 1/2
##### CHANGE ME END #####
packages:
remote_package:
url: https://github.com/Blackymas/NSPanel_HA_Blueprint
ref: main
files:
- nspanel_esphome.yaml # Core package
# - nspanel_esphome_addon_climate_cool.yaml # activate for local climate (cooling) control
# - nspanel_esphome_addon_climate_heat.yaml # activate for local climate (heater) control
# - nspanel_esphome_addon_climate_dual.yaml # activate for local climate (dual) control
refresh: 300s
esp32:
framework:
type: esp-idf
```
This url will indicate where your panel will look for the `tft` file when you click the "Upload TFT" button (under device's page)
or call the service `esphome.xxxxx_upload_tft`.
The most popular way to switch between the `nspanel_blank.tft` and `nspanel_xx.tft` is replacing the URL on the ESPHome settings
and flashing the device again, however, you can also do this calling the service `esphome.xxxxx_upload_tft_url`
adding the URL of the alternative file as a parameter.
It's up to you, as both ways will give the same result.
## What to do after installing `nspanel_blank.tft`?
![image](https://github.com/Blackymas/NSPanel_HA_Blueprint/assets/94725493/3b0bb950-4857-4c22-a53a-062d09f315dc)
@@ -75,21 +28,9 @@ It's up to you, as both ways will give the same result.
Once you have sucessfully installed any of the `tft` files from this project,
the `nspanel_blank.tft` file shouldn't be necessary anymore and you should be able to always install the final `tft` file.
**v4.2 or later and `esp-idf` framework:**
Just go to your devices's page (under **Settings** > **Devices and Services** > **ESPHome**),
select your **Upload TFT display - Model** and then press **Upload TFT display**.
**Older versions or `arduino` framework:**
Make sure you have one of the following final TFT files in your local http server (typically Home Assistant on ***www*** folder):
- [`nspanel_eu.tft`](../nspanel_eu.tft)
- [`nspanel_us.tft`](../nspanel_us.tft)
- [`nspanel_us_land.tft`](../nspanel_us_land.tft)
Now Flash your panel with `nextion_update_url` pointing to one of the final TFT files and
press **Upload TFT** in the device's page (**Settings** > **Devices & Services** > **ESPHome**).
## Additional Tips and Resources
We have an useful guide for [troubleshooting TFT transfer issues](tft_upload.md).
Please take a look there first.