Replies: 15 comments 14 replies
-
Update on this. The only TFT that fulle uploads sucsessful on both panels are the nspanel_blank.tft. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I have the same problem - did you find any solution? |
Beta Was this translation helpful? Give feedback.
-
i just had a go at updating the ns panel (i got 5 of them) first one done the reset while trying to update and then was taking forever so i tried it from the homeassistant server and again it done the reset thing and failed so in the end i downloaded the eu tft file uploaded it onto my webspace renamed the file nspanel.tft no dashes or owt and then changed the github http address to my address where i hosted the tft file and guess what it worked first time and all the other 5 flashed the tft firmware fine over the internet. not sure if it was to do with the github address being a https or if the file name with the _ underscore in the file name affected it. but after uploading it to my website space and doing http://mywebsite.com/nspanel.tft for the webaddress (much shorter and no special characters) it just works |
Beta Was this translation helpful? Give feedback.
-
so after a bit of investigation if i use https://mywebsite.com/nspanel_eu.tft then it does not work, but if i use http:// it works fine also between each flash i was making sure to flash the nspanel_blank.tft file to get the white screen then turn off for a minute then update the yaml and then try flashing again. people who are struggling get some free webspace that you can host a file from and upload the nspanel_blank.tft and then the nspanel_eu.tft or us and host them on that making sure it can be downloaded through http:// and not https:// change the config to point to the blank.tft then wirelessly upload it, then turn off at wall for 1 minute then turn on again and then update the tft through esp home, once the screen goes white it will be sucessfull then go back into the config and point the url to the nspanel_eu.tft making sure its from http:// and not https:// then upload the config wirelessly once done turn it off at the wall wait 1 minute then back on again once its booted back up and showing in esphome press the update tft and then sit back and wait. |
Beta Was this translation helpful? Give feedback.
-
Im having the same problem updating the TFT on the US version:
Been running 20+ hours. |
Beta Was this translation helpful? Give feedback.
-
Hello, I also got trouble to upload TFT file. I was with Tasmota before and flashed some other tft files and I was unable to flash the blank screen with the installation procedure (ESPHome).
Hope this can help... |
Beta Was this translation helpful? Give feedback.
-
So, anyone here still having issues when uploading TFT file? |
Beta Was this translation helpful? Give feedback.
-
Good morning and thanks a lot for the quick reply. Could you please define a little more precisely which yaml file you mean. Sorry I'm a beginner.
Gesendet: Sonntag, 16. April 2023 um 20:39 Uhr
Von: "Edward Firmo" ***@***.***>
An: "Blackymas/NSPanel_HA_Blueprint" ***@***.***>
Cc: "langemb" ***@***.***>, "Comment" ***@***.***>
Betreff: Re: [Blackymas/NSPanel_HA_Blueprint] Update TFT (Discussion #367)
Could you please share your ESPHome yaml settings? Please make sure to remove any private info (wifi credentials, etc) before sharing.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I flashed two panels. One panel (panel02) with the current version of the blackymas template. I then read here in the wiki that you should use the original yaml if you have problems. I did that at panel01. I put the nspanel_eu.tft on my webspace because the suggested way on the homeassistant server caused problems.
By the way, my logs look exactly like in kelhojc's thread.
Attached are the two yaml files.
Gesendet: Montag, 17. April 2023 um 11:46 Uhr
Von: "Edward Firmo" ***@***.***>
An: "Blackymas/NSPanel_HA_Blueprint" ***@***.***>
Cc: "langemb" ***@***.***>, "Comment" ***@***.***>
Betreff: Re: [Blackymas/NSPanel_HA_Blueprint] Update TFT (Discussion #367)
Could you please define a little more precisely which yaml file you mean. Sorry I'm a beginner.
Go to ESPHome dashboard and click "Edit" in the box related to your NSPanel. Copy all that text and paste here as a code. ;)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Here are the code:
Panel01
#####################################################################################################
##### NSPANEL ESPHOME created by Blackymas - https://github.com/Blackymas/NSPanel_HA_Blueprint #####
##### ADVANCED CONFIG + FULL ESPHOME CODE! #####
##### PLEASE only make changes if it is necessary and also the required knowledge is available. #####
##### For normal use with the Blueprint, no changes are necessary. #####
#####################################################################################################
##### ADVANCED CONFIGURATION - activate only when you know what you do ##############################
substitutions:
# ## usage of secrets-file ## -> comment in ###### Change ME ######
device_name: "panel01" # Wird im Blueprint benötigt!
wifi_ssid: !secret wifi_ssid # add in your esphome secrets file.
wifi_password: !secret wifi_password # add in your esphome secrets file. -> per default this is also used for ota_password and web_password
# ota_password: !secret nspanel_ota_password # add in your esphome secrets file. - manual change in code required to activate
# web_password: !secret nspanel_web_password # add in your esphome secrets file. - manual change in code required to activate
# api_password: !secret nspanel_api_password # add in your esphome secrets file. - manual change in code required to activate
nextion_update_url: "http://bmlange.de/nspanel_eu.tft"
# add in your esphome secrets file. Example: "http://"HOME ASSISTANT IP":8123/local/nspanel/nspanel.tft"
# ## static ip config ##
# ip: "10.0.0.7"
# gw: "10.0.0.138"
# subnet: "255.255.255.0"
# dns: "10.0.0.138"
# domain: ".local"
##### if you rename this file to .nspanel_esphome.yaml then you can activate nested config
##### use the ADVANCED CONFIG-Section as device configuration
##### https://esphome.io/guides/configuration-types.html#yaml-insertion-operator
# <<: !include .nspanel_esphome.yaml
##### END OF ADVANCED CONFIGURATION ##############################################################
##### WIFI SETUP #####
wifi:
ssid: ${wifi_ssid}
password: ${wifi_password}
power_save_mode: none
##### advanced config - uncomment to use static IP-Config #####
# manual_ip:
# static_ip: ${ip}
# gateway: ${gw}
# subnet: ${subnet}
# dns1: ${dns}
# domain: ${domain}
##### Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "${device_name}"
password: ${wifi_password}
##### Functionality for the Nextion display #####
# external_components:
# - source: github://pr#2956
# components: [nextion]
# refresh: 1h
##### ESPHOME CONFIGURATION #####
esphome:
name: ${device_name}
min_version: 2022.10.2
on_boot:
priority: 601
then:
- lambda: id(disp1).send_command_printf("DRAKJHSUYDGBNCJHGJKSHBDN");
##### TYPE OF ESP BOARD #####
esp32:
board: esp32dev
captive_portal:
web_server:
port: 80
auth:
username: admin
password: ${wifi_password}
##### advanced config - change to use web_password #####
# password: ${web_password}
##### OTA PASSWORD #####
ota:
password: ${wifi_password}
##### advanced config - change to use ota_password #####
# password: ${ota_password}
safe_mode: true
reboot_timeout: 3min
num_attempts: 3
##### LOGGER #####
logger:
# baud_rate: 0
# level: WARN
##### CONFIGURE INTERNAL BUZZER #####
output:
##### BUZZER FOR PLAYING RINGTONES #####
- platform: ledc
id: buzzer_out
pin:
number: 21
##### ENABLE RINGTONE MUSIC SUPPORT #####
rtttl:
id: buzzer
output: buzzer_out
##### UART FOR NEXTION DISPLAY #####
uart:
tx_pin: 16
rx_pin: 17
baud_rate: 115200
id: tf_uart
##### START - BUTTON CONFIGURATION #####
button:
###### REBOOT BUTTON #####
- platform: restart
name: ${device_name} Restart
id: restart_nspanel
##### UPDATE TFT DISPLAY #####
- platform: template
name: ${device_name} Update TFT display
icon: mdi:file-sync
id: tft_update
entity_category: config
on_press:
- delay: 16ms
- lambda: id(disp1).upload_tft();
##### START - API CONFIGURATION #####
api:
##### advanced config - activate to use api_password #####
# password: ${api_password}
services:
##### SERVICE TO UPDATE THE HMI FILE #####
- service: upload_tft
then:
- lambda: 'id(disp1)->upload_tft();'
##### SERVICE TO UPDATE THE TFT FILE from URL #####
- service: upload_tft_url
variables:
url: string
then:
- lambda: 'id(disp1)->set_tft_url(url.c_str());'
- lambda: 'id(disp1)->upload_tft();'
##### Service to send a command "printf" directly to the display #####
- service: send_command_printf
variables:
cmd: string
then:
- lambda: 'id(disp1).send_command_printf("%s", cmd.c_str());'
##### Service to send a command "text_printf" directly to the display #####
- service: send_command_text_printf
variables:
component: string
message: string
then:
- wait_until:
switch.is_on: nextion_init
- lambda: 'id(disp1).set_component_text_printf(component.c_str(), "%s", message.c_str());'
##### Service to send a command "component_value (Dualstate Button)" directly to the display #####
- service: send_command_value
variables:
component: string
message: int
then:
- wait_until:
switch.is_on: nextion_init
- lambda: 'id(disp1).set_component_value(component.c_str(), message);'
##### Service to send a command "hide componente" directly to the display #####
- service: send_command_hide ### unused ###
variables:
component: string
then:
- wait_until:
switch.is_on: nextion_init
- lambda: 'id(disp1).hide_component(component.c_str());'
##### Service to send a command "show componente" directly to the display #####
- service: send_command_show ### unused ###
variables:
component: string
then:
- wait_until:
switch.is_on: nextion_init
- lambda: 'id(disp1).show_component(component.c_str());'
##### Service to send a command "show ALL componente" directly to the display #####
- service: send_command_show_all ### unused ###
then:
- wait_until:
switch.is_on: nextion_init
- lambda: 'id(disp1).show_component("255");'
##### Service to send a command "font color" directly to the display #####
- service: send_command_font_color
variables:
component: string
message: int
then:
- wait_until:
switch.is_on: nextion_init
- lambda: 'id(disp1).set_component_font_color(component.c_str(), message);'
##### Service to send a command "background color" directly to the display #####
- service: send_command_background_color
variables:
component: string
message: int
then:
- wait_until:
switch.is_on: nextion_init
- lambda: 'id(disp1).set_component_background_color(component.c_str(), message);'
##### Service to show a notification-message on the screen #####
- service: notification_show
variables:
label: string
text: string
then:
- wait_until:
switch.is_on: nextion_init
- lambda: |-
id(disp1).send_command_printf("page notification");
id(disp1).set_component_text_printf("notification.notifi_label", "%s", label.c_str());
id(disp1).set_component_text_printf("notification.notifi_text01", "%s", text.c_str());
id(notification_label).publish_state(label.c_str());
id(notification_text).publish_state(text.c_str());
- switch.turn_on: notification_unread
- if:
condition:
switch.is_on: notification_sound
then:
- rtttl.play: "two short:d=4,o=5,b=100:16e6,16e6"
##### Service to clear the notification #####
- service: notification_clear
then:
- wait_until:
switch.is_on: nextion_init
- lambda: |-
id(notification_label).publish_state("");
id(notification_text).publish_state("");
- switch.turn_off: notification_unread
##### Service to set entity-information for settings-page(s)
- service: set_settings_entity
variables:
entity: string
then:
- wait_until:
switch.is_on: nextion_init
- lambda: |-
id(settings_entity).publish_state(entity.c_str());
##### Service to play a rtttl tones #####
# Example tones : https://codebender.cc/sketch:109888#RTTTL%20Songs.ino
- service: play_rtttl
variables:
song_str: string
then:
- rtttl.play:
rtttl: !lambda 'return song_str;'
# Service to show a QR code on the display (ex. for WiFi password)
- service: qr_code
variables:
qrdata: string
then:
- wait_until:
switch.is_on: nextion_init
- lambda: |-
id(disp1).send_command_printf("page qrcode");
id(disp1).set_component_text_printf("qrcode.qrcode_value", "%s", qrdata.c_str());
#### Service to send thermostat cycle state ####
- service: send_thermostat_cycle_state
variables:
value: float
then:
- wait_until:
switch.is_on: nextion_init
- lambda: |-
//ESP_LOGD("nextion", "thermostat sendig value %f", value);
int v = int(2 * std::min(std::max(value - 13.5, 0.0), 5.0));
int left = v + (v ? 19 : 16); // 16 is empty left.
v = int(2 * std::min(std::max(value - 18.0, 0.0), 4.0));
int mid = v + (v ? 29 : 17); // 17 is empty mid.
v = int(2 * std::min(std::max(value - 21.5, 0.0), 5.5));
int right = v + (v ? 37 : 18); // 18 is empty right.
// sends the 3 images to the display
//ESP_LOGD("nextion", "thermostat left %i", left);
//ESP_LOGD("nextion", "thermostat mid %i", mid);
//ESP_LOGD("nextion", "thermostat right %i", right);
id(disp1).send_command_printf("climate_left.pic=%i", left);
id(disp1).send_command_printf("climate_middle.pic=%i", mid);
id(disp1).send_command_printf("climate_right.pic=%i", right);
// send target-temp
id(disp1).set_component_text_printf("target_temp", "%.1f°", value);
id(display_target_temp).publish_state(value);
#### Service to set the buttons ####
- service: set_button
variables:
btn_id: string
btn_pic: int
btn_bg: int
btn_icon_font: int
btn_txt_font: int
btn_bri_font: int
btn_icon: string
btn_label: string
btn_bri_txt: string
then:
- wait_until:
switch.is_on: nextion_init
- lambda: |-
// ESP_LOGD("nextion", "set button %s", btn_id.c_str());
std::string btnicon = btn_id.c_str() + std::string("icon");
std::string btntext = btn_id.c_str() + std::string("text");
std::string btnbri = btn_id.c_str() + std::string("bri");
id(disp1).send_command_printf("%spic.pic=%i", btn_id.c_str(), btn_pic);
id(disp1).set_component_background_color(btnicon.c_str(), btn_bg);
id(disp1).set_component_background_color(btntext.c_str(), btn_bg);
id(disp1).set_component_background_color(btnbri.c_str(), btn_bg);
id(disp1).set_component_font_color(btnicon.c_str(), btn_icon_font);
id(disp1).set_component_font_color(btntext.c_str(), btn_txt_font);
id(disp1).set_component_font_color(btnbri.c_str(), btn_bri_font);
id(disp1).set_component_text_printf(btnicon.c_str(), "%s", btn_icon.c_str());
id(disp1).set_component_text_printf(btntext.c_str(), "%s", btn_label.c_str());
// id(disp1).set_component_text_printf(btnbri.c_str(), "%s", btn_bri_txt.c_str());
if (strcmp(btn_bri_txt.c_str(), "0") != 0) {
id(disp1).set_component_text_printf(btnbri.c_str(), "%s", btn_bri_txt.c_str());
} else {
id(disp1).set_component_text_printf(btnbri.c_str(), " ");
}
##### START - GLOBALS CONFIGURATION #####
globals:
##### Save Display Brightness for NSPanel reboot #####
- id: display_brightness_global
type: int
restore_value: true
initial_value: '100'
##### Save Display DIM Brightness for NSPanel reboot
- id: display_dim_brightness_global
type: int
restore_value: true
initial_value: '10'
##### Temperature Correction #####
- id: temperature_correction_global
type: float
restore_value: true
initial_value: '0.0'
##### Save Display DIM Brightness for NSPanel reboot
- id: sleep_modus_global
type: int
restore_value: true
initial_value: '0'
##### lastclick_general State #####
- id: lastclick_general_global
type: std::string
restore_value: no
initial_value: ''
##### lastclick_lightsettings State #####
- id: lastclick_lightsettings_global
type: std::string
restore_value: no
initial_value: ''
##### lastclick_coversettings State #####
- id: lastclick_coversettings_global
type: std::string
restore_value: no
initial_value: ''
##### lastclick_climatesettings State #####
- id: lastclick_climatesettings_global
type: std::string
restore_value: no
initial_value: ''
##### lastclick_currentpage State #####
- id: currentpage_global
type: std::string
restore_value: no
initial_value: ''
##### START - BINARY SENSOR CONFIGURATION #####
binary_sensor:
###### LEFT BUTTON BELOW DISPLAY TO TOGGLE RELAY#####
- platform: gpio
name: ${device_name} Left Button
id: left_button
pin:
number: 14
inverted: true
on_click:
then:
- if:
condition:
and:
- switch.is_on: relay1_fallback
- not:
api.connected:
then:
- switch.toggle: relay_1
- if:
condition:
switch.is_on: relay_1
then:
- lambda: id(disp1).send_command_printf("home.left_bt_pic.pic=78");
- lambda: id(disp1).send_command_printf("home.icon_top_01","\U0000E3A5");
else:
- lambda: id(disp1).send_command_printf("home.left_bt_pic.pic=77");
- lambda: id(disp1).send_command_printf("home.icon_top_01","\U0000FFFF");
##### RIGHT BUTTON BELOW DISPLAY TO TOGGLE RELAY #####
- platform: gpio
name: ${device_name} Right Button
id: right_button
pin:
number: 27
inverted: true
on_click:
then:
- if:
condition:
and:
- switch.is_on: relay2_fallback
- not:
api.connected:
then:
- switch.toggle: relay_2
- if:
condition:
switch.is_on: relay_2
then:
- lambda: id(disp1).send_command_printf("home.right_bt_pic.pic=78");
- lambda: id(disp1).send_command_printf("home.icon_top_02","\U0000E3A8");
else:
- lambda: id(disp1).send_command_printf("home.right_bt_pic.pic=77");
- lambda: id(disp1).send_command_printf("home.icon_top_02","\U0000FFFF");
##### JUMP PAGE TO SETTING PAGE #####
- platform: nextion
name: $device_name setting page
page_id: 0
component_id: 52
internal: true
on_multi_click:
- timing:
- ON for at least 1s #LONG Press
then:
- lambda: 'id(disp1).send_command_printf("page settings");'
##### Restart NSPanel Button - Setting Page #####
- platform: nextion
name: ${device_name} Restart
page_id: 7
component_id: 13
internal: true
on_click:
- button.press: restart_nspanel
##### Restart NSPanel Button - Boot Page #####
- platform: nextion
name: ${device_name} Restart
page_id: 8
component_id: 4
internal: true
on_click:
- button.press: restart_nspanel
##### Sleep Modus NSPanel Button #####
- platform: nextion
name: ${device_name} Sleep Modus
page_id: 7
component_id: 14
internal: true
on_click:
- switch.toggle: sleep_modus
##### Hotwater Charge #####
# - platform: nextion
# name: ${device_name} Hotwater Charge
# page_id: 6
# component_id: 20
# on_click:
# - homeassistant.service:
# service: switch.toggle
# data:
# entity_id: ${ha_hotwater_charge}
##### START - SENSOR CONFIGURATION #####
sensor:
##### Uptime #####
- platform: uptime
name: ${device_name} uptime
disabled_by_default: true
##### WIFI Signal stregth
- platform: wifi_signal
name: ${device_name} RSSI
update_interval: 60s
on_value:
- if:
condition:
wifi.connected:
then:
- lambda: id(disp1).set_component_text_printf("home.wifi_icon", "%s", "\U0000E5A8");
else:
- lambda: id(disp1).set_component_text_printf("home.wifi_icon", "%s", "\U0000FFFF");
##### INTERNAL TEMPERATURE SENSOR, ADC VALUE #####
- platform: adc
id: ntc_source
pin: 38
update_interval: 60s
attenuation: 11db
##### INTERNAL TEMPERATURE SENSOR, adc reading converted to resistance (calculation)#####
- platform: resistance
id: resistance_sensor
sensor: ntc_source
configuration: DOWNSTREAM
resistor: 11.2kOhm
##### INTERNAL TEMPERATURE SENSOR, resistance to temperature (calculation) #####
- platform: ntc
name: ${device_name} Temperature
id: temp_nspanel
sensor: resistance_sensor
calibration:
b_constant: 3950
reference_temperature: 25°C
reference_resistance: 10kOhm
filters:
- lambda: return x + id(temperature_correction_global);
# on_value:
# then:
# - wait_until:
# switch.is_on: nextion_init
# - lambda: id(disp1).set_component_text_printf("home.current_temp", "%.1f°", id(temp_nspanel).state); # onboard temp (thermostat temp) to home page.
# - lambda: id(disp1).set_component_text_printf("climate.current_temp", "%.1f", id(temp_nspanel).state);
##### current value of page-climate target_temp #####
- platform: template
name: ${device_name} Display Target Temperature
id: display_target_temp
lambda: return {};
update_interval: 10s
###### Display Brightness GET VALUE FROM NSPanel SLIDER #####
- platform: nextion
id: brightslider
name: ${device_name} brightness Slider
variable_name: brightslider
internal: true
on_value:
then:
- wait_until:
switch.is_on: nextion_init
- number.set:
id: display_brightness
value: !lambda 'return int(x);'
# send text field percentage of current_lightslider_val
- lambda: id(disp1).set_component_text_printf("settings.a03", "%i", id(display_brightness_global));
###### Display DIM Brightness GET VALUE FROM NSPanel SLIDER #####
- platform: nextion
id: dimslider
name: ${device_name} dim brightness slider
variable_name: dimslider
internal: true
on_value:
then:
- wait_until:
switch.is_on: nextion_init
- number.set:
id: display_dim_brightness
value: !lambda 'return int(x);'
# send text field percentage of current_lightslider_val
- lambda: id(disp1).set_component_text_printf("settings.a04", "%i", id(display_dim_brightness_global));
###### Send current page to HA
# - platform: nextion
# id: current_page
# name: "${device_name} Current Page"
# variable_name: dp
# update_interval: 1s
# accuracy_decimals: 0
# filters:
# - delta: 1.0
# - lambda: return int(x);
##### START - TEXT SENSOR CONFIGURATION #####
text_sensor:
##### ESPhome version used to compile the app #####
- platform: version
name: ${device_name} ESPhome Version
disabled_by_default: true
- platform: wifi_info
ip_address:
name: ${device_name} IP
disabled_by_default: true
id: ip_address
ssid:
name: ${device_name} SSID
disabled_by_default: true
bssid:
name: ${device_name} BSSID
disabled_by_default: true
- platform: template
name: ${device_name} Notification Label
id: notification_label
- platform: template
name: ${device_name} Notification Text
id: notification_text
- platform: template
name: ${device_name} Settings Entity
id: settings_entity
##### last click sensor, the main action variable - push to HA #####
- platform: nextion
nextion_id: disp1
name: ${device_name} Last Click
id: disp1_lastclick_general
update_interval: 50ms
component_name: lastclick
internal: false
filters:
- lambda: |-
if (strcmp(x.c_str(), id(lastclick_general_global).c_str()) != 0) {
return x;
} else {
return {};
}
on_value:
then:
- globals.set:
id: lastclick_general_global
value: !lambda return x;
- lambda: |-
id(page_timer)->execute(int(id(page_timeout).state));
##### last click lightsettings page, the main action variable - push to HA #####
- platform: nextion
nextion_id: disp1
name: ${device_name} last click lightsettings
id: disp1_lastclick_lightsettings
update_interval: 50ms
component_name: lightsetting
internal: false
filters:
- lambda: |-
if (strcmp(x.c_str(), id(lastclick_lightsettings_global).c_str()) != 0) {
return x;
} else {
return {};
}
on_value:
then:
- globals.set:
id: lastclick_lightsettings_global
value: !lambda return x;
- lambda: |-
id(page_timer)->execute(int(id(page_timeout).state));
##### last click coversettings page, the main action variable - push to HA #####
- platform: nextion
nextion_id: disp1
name: ${device_name} last click coversettings
id: disp1_lastclick_coversettings
update_interval: 50ms
component_name: coversetting
internal: false
filters:
- lambda: |-
if (strcmp(x.c_str(), id(lastclick_coversettings_global).c_str()) != 0) {
return x;
} else {
return {};
}
on_value:
then:
- globals.set:
id: lastclick_coversettings_global
value: !lambda return x;
- lambda: |-
id(page_timer)->execute(int(id(page_timeout).state));
##### last click climate page, the main action variable - push to HA #####
- platform: nextion
nextion_id: disp1
name: ${device_name} last click climatesettings
id: disp1_lastclick_climatesettings
update_interval: 50ms
component_name: climatesetting
internal: false
filters:
- lambda: |-
if (strcmp(x.c_str(), id(lastclick_climatesettings_global).c_str()) != 0) {
return x;
} else {
return {};
}
on_value:
then:
- globals.set:
id: lastclick_climatesettings_global
value: !lambda return x;
- lambda: |-
id(page_timer)->execute(int(id(page_timeout).state));
##### currentpage sensor, the main action variable - push to HA #####
- platform: nextion
nextion_id: disp1
name: ${device_name} currentpage
id: disp1_currentpage
update_interval: 50ms
component_name: currentpage
internal: false
filters:
- lambda: |-
if (strcmp(x.c_str(), id(currentpage_global).c_str()) != 0) {
return x;
} else {
return {};
}
on_value:
then:
- globals.set:
id: currentpage_global
value: !lambda return x;
- lambda: |-
id(page_timer)->execute(int(id(page_timeout).state));
##### touchevent sensor, Reset the page timeout #####
- platform: nextion
nextion_id: disp1
#name: ${device_name} touchevent
id: disp1_touchevent
update_interval: 50ms
component_name: touchevent
internal: true
filters:
- lambda: |-
static std::string touchevent_history = "";
if (strcmp(x.c_str(), touchevent_history.c_str()) != 0) {
touchevent_history = x;
return x;
// touchevent_history = "";
} else {
return {};
}
on_value:
then:
- lambda: |-
id(page_timer)->execute(int(id(page_timeout).state));
##### START - SWITCH CONFIGURATION #####
switch:
# ##### Restart switch ######
# - platform: restart
# name: ${device_name} Restart
# ##### Restart in safe-mode #####
# - platform: safe_mode
# name: ${device_name} Restart (Safe Mode)
##### global variable to keep track on whether the Nextion display is ready or not. Delays initial info from HA to the display #####
- platform: template
name: ${device_name} Nextion inited
id: nextion_init
entity_category: config
restore_state: false
assumed_state: off
optimistic: true
##### Notification unread #####
- platform: template
name: ${device_name} Notification unread
id: notification_unread
entity_category: config
restore_state: true
optimistic: true
##### Notification sound #####
- platform: template
name: ${device_name} Notification sound
id: notification_sound
entity_category: config
restore_state: true
optimistic: true
##### Confirmation Message #####
- platform: template
name: ${device_name} Confirmation Message
id: confirmation_message
entity_category: config
restore_state: false
optimistic: true
##### PHYSICAL SWITCH 1 #####
- platform: gpio
name: ${device_name} Relay 1
id: relay_1
pin:
number: 22
##### PHYSICAL SWITCH 2 ######
- platform: gpio
name: ${device_name} Relay 2
id: relay_2
pin:
number: 19
##### DISPLAY ALWAYS ON #####
- platform: gpio
name: ${device_name} Screen Power
id: screen_power
entity_category: config
pin:
number: 4
inverted: true
restore_mode: ALWAYS_ON
internal: true
##### Switch Display Sleep Modus #####
- platform: template
device_class: switch
name: ${device_name} Sleep Modus
id: sleep_modus
entity_category: config
restore_state: true
assumed_state: false
optimistic: true
on_turn_off:
- lambda: id(disp1).send_command_printf("home.sleepmodus.val=0");
- globals.set:
id: sleep_modus_global
value: '0'
- lambda: id(disp1).set_component_value("settings.bt1",0);
on_turn_on:
- lambda: id(disp1).send_command_printf("home.sleepmodus.val=1");
- globals.set:
id: sleep_modus_global
value: '1'
- lambda: id(disp1).set_component_value("settings.bt1",1);
##### Relay Local control Fallback #####
- platform: template
name: ${device_name} Relay 1 Local Fallback
id: relay1_fallback
entity_category: config
restore_state: true
optimistic: true
- platform: template
name: ${device_name} Relay 2 Local Fallback
id: relay2_fallback
entity_category: config
restore_state: true
optimistic: true
##### START - NUMBER CONFIGURATION #####
number:
##### SCREEN BRIGHTNESS #####
- platform: template
name: ${device_name} Display Brightness
id: display_brightness
entity_category: config
unit_of_measurement: '%'
min_value: 1
max_value: 100
step: 1
restore_value: true
optimistic: true
set_action:
then:
- lambda: 'id(disp1).set_backlight_brightness(x/100);'
- lambda: 'id(disp1).send_command_printf("home.brightness.val=%i", int(x));'
- globals.set:
id: display_brightness_global
value: !lambda 'return int(x);'
##### SCREEN BRIGHTNESS DIMMED DOWN #####
- platform: template
name: ${device_name} Display Brightness Dimdown
id: display_dim_brightness
entity_category: config
unit_of_measurement: '%'
min_value: 1
max_value: 100
step: 1
restore_value: true
optimistic: true
set_action:
then:
- lambda: 'id(disp1).send_command_printf("home.brightdd.val=%i", int(x));'
- globals.set:
id: display_dim_brightness_global
value: !lambda 'return int(x);'
##### Temperature Correction #####
- platform: template
name: ${device_name} Temperature Correction
id: temperature_correction
entity_category: config
unit_of_measurement: '°C'
min_value: -10
max_value: 10
step: 0.5
restore_value: true
optimistic: true
set_action:
then:
- globals.set:
id: temperature_correction_global
value: !lambda 'return x;'
##### page-timeout #####
- platform: template
name: ${device_name} Page Timeout
id: page_timeout
entity_category: config
min_value: 0
max_value: 60
initial_value: 10
step: 1
restore_value: true
optimistic: true
##### START - DISPLAY START CONFIGURATION #####
display:
- platform: nextion
id: disp1
uart_id: tf_uart
tft_url: ${nextion_update_url}
on_setup:
then:
- lambda: id(disp1).send_command_printf("page 8");
- lambda: id(disp1).set_component_text_printf("boot.esph_version", "%s", "3.2.2"); ### esphome-version ###
- wait_until:
api.connected
- lambda: id(disp1).set_component_text_printf("boot.ip_addr", "%s", id(ip_address).state.c_str());
- delay: 1s
- number.set:
id: display_brightness
value: !lambda 'return id(display_brightness_global);'
- number.set:
id: display_dim_brightness
value: !lambda 'return id(display_dim_brightness_global);'
- lambda: id(disp1).set_component_text_printf("settings.a03", "%i", id(display_brightness_global));
- lambda: id(disp1).set_component_text_printf("settings.a04", "%i", id(display_dim_brightness_global));
- lambda: id(disp1).send_command_printf("settings.brightslider.val=%i", id(display_brightness_global));
- lambda: id(disp1).send_command_printf("settings.dimslider.val=%i", id(display_dim_brightness_global));
- lambda: id(disp1).send_command_printf("home.sleepmodus.val=%i", id(sleep_modus_global));
- lambda: id(disp1).set_component_value("settings.a02", id(sleep_modus_global) == 1);
- delay: 1s
- switch.template.publish:
id: nextion_init
state: on
### Script for page_timer
script:
- id: page_timer
mode: restart
parameters:
delay: int
then:
- lambda: ESP_LOGD("nspanel", "start page-timer delay %i", int(id(page_timeout).state));
- delay: !lambda return delay *1000;
- lambda: |-
if (id(disp1_currentpage).state == "home" or id(disp1_currentpage).state == "screensaver" or id(disp1_currentpage).state == "boot" or int(id(page_timeout).state) == 0) {
ESP_LOGD("nspanel", "no page-jump");
} else {
ESP_LOGD("nspanel", "timer->home");
id(disp1).send_command_printf("page 0");
}
Panel02:
ubstitutions:
###### CHANGE ME START ######
device_name: "panel02"
wifi_ssid: "xxxxxxxx"
wifi_password: "xxxxxxxx"
nextion_update_url: "http://bmlange.de/nspanel_eu.tft" # URL to local tft File
# nextion_update_url: "https://raw.githubusercontent.com/Blackymas/NSPanel_HA_Blueprint/main/nspanel_eu.tft" # URL to Github
##### CHANGE ME END #####
##### DO NOT CHANGE ANYTHING! #####
packages:
##### download esphome code from Github
remote_package:
url: https://github.com/Blackymas/NSPanel_HA_Blueprint
ref: main
files: [nspanel_esphome.yaml]
refresh: 300s
##### DO NOT CHANGE ANYTHING! #####
Gesendet: Montag, 17. April 2023 um 15:03 Uhr
Von: "Edward Firmo" ***@***.***>
An: "Blackymas/NSPanel_HA_Blueprint" ***@***.***>
Cc: "langemb" ***@***.***>, "Comment" ***@***.***>
Betreff: Re: [Blackymas/NSPanel_HA_Blueprint] Update TFT (Discussion #367)
I don't email think attachments will be supported here. You will have to copy/paste.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
panel02 is based on the blueprint. apart from the tft upload, the other commands work, e.g. relay.
another tip, after flashing and rebooting, the sonoff standard screen appears on both panels.
Gesendet: Montag, 17. April 2023 um 15:05 Uhr
Von: "Edward Firmo" ***@***.***>
An: "Blackymas/NSPanel_HA_Blueprint" ***@***.***>
Cc: "langemb" ***@***.***>, "Comment" ***@***.***>
Betreff: Re: [Blackymas/NSPanel_HA_Blueprint] Update TFT (Discussion #367)
I flashed two panels.
Have you successfully got the Blueprint working with any of your panels?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
No, I first deleted everything on both panels with the espressif esptool, then installed the original espressif firmware for esp32. Finally came the flashing with esphome.
Gesendet: Montag, 17. April 2023 um 15:27 Uhr
Von: "scoudibou" ***@***.***>
An: "Blackymas/NSPanel_HA_Blueprint" ***@***.***>
Cc: "langemb" ***@***.***>, "Comment" ***@***.***>
Betreff: Re: [Blackymas/NSPanel_HA_Blueprint] Update TFT (Discussion #367)
Have you tried to install Tasmota first and upload tft and then install yaml with ESP ?
#367 (comment)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hello,
I solved my problem with a workaround. I deleted the flash, then installed tasmota, activated the display (joBr99/nspanel-lovelace-ui) and the nspanel_eu.tft installed. then flashed esphome and it works. However, I did not press the "upload tft" button.
Gesendet: Montag, 17. April 2023 um 15:05 Uhr
Von: "Edward Firmo" ***@***.***>
An: "Blackymas/NSPanel_HA_Blueprint" ***@***.***>
Cc: "langemb" ***@***.***>, "Comment" ***@***.***>
Betreff: Re: [Blackymas/NSPanel_HA_Blueprint] Update TFT (Discussion #367)
I flashed two panels.
Have you successfully got the Blueprint working with any of your panels?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Anyone in this discussion still waiting for support to have TFT uploaded? |
Beta Was this translation helpful? Give feedback.
-
How long time should the update of the tft-display be?
Just got two new white NSpanel and having trouble getting theese updated.
One EU and one US panel - Updating with the blank TFT file takes about 1-3 min and nspanel_eu/us takes 24+h..
When done is still does not work.
Have one Grey unit, and this unit is much faster.
Beta Was this translation helpful? Give feedback.
All reactions