File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
|
|
||||||
##### ADVANCED CONFIGURATION - activate only when you know what you do ##############################
|
##### ADVANCED CONFIGURATION - activate only when you know what you do ##############################
|
||||||
# substitutions:
|
# substitutions:
|
||||||
# ## usage of secrets-file ## -> comment in ###### Change ME ######
|
# ## usage of secrets-file ## -> comment in ###### Change ME ######
|
||||||
# device_name: "nspanel-name" # Wird im Blueprint benötigt!
|
# device_name: "nspanel-name" # Wird im Blueprint benötigt!
|
||||||
# wifi_ssid: !secret nspanel_wifi_ssid # add in your esphome secrets file.
|
# wifi_ssid: !secret nspanel_wifi_ssid # add in your esphome secrets file.
|
||||||
@@ -36,7 +36,7 @@ wifi:
|
|||||||
ssid: ${wifi_ssid}
|
ssid: ${wifi_ssid}
|
||||||
password: ${wifi_password}
|
password: ${wifi_password}
|
||||||
power_save_mode: none
|
power_save_mode: none
|
||||||
##### advanced config - uncomment to use static IP-Config #####
|
##### advanced config - uncomment to use static IP-Config #####
|
||||||
# manual_ip:
|
# manual_ip:
|
||||||
# static_ip: ${ip}
|
# static_ip: ${ip}
|
||||||
# gateway: ${gw}
|
# gateway: ${gw}
|
||||||
@@ -49,15 +49,19 @@ wifi:
|
|||||||
password: ${wifi_password}
|
password: ${wifi_password}
|
||||||
|
|
||||||
##### Functionality for the Nextion display #####
|
##### Functionality for the Nextion display #####
|
||||||
external_components:
|
# external_components:
|
||||||
- source: github://pr#2956
|
# - source: github://pr#2956
|
||||||
components: [nextion]
|
# components: [nextion]
|
||||||
refresh: 1h
|
# refresh: 1h
|
||||||
|
|
||||||
##### ESPHOME CONFIGURATION #####
|
##### ESPHOME CONFIGURATION #####
|
||||||
esphome:
|
esphome:
|
||||||
name: ${device_name}
|
name: ${device_name}
|
||||||
min_version: 2022.10.2
|
min_version: 2022.10.2
|
||||||
|
on_boot:
|
||||||
|
priority: 601
|
||||||
|
then:
|
||||||
|
- lambda: id(disp1).send_command_printf("DRAKJHSUYDGBNCJHGJKSHBDN");
|
||||||
|
|
||||||
##### TYPE OF ESP BOARD #####
|
##### TYPE OF ESP BOARD #####
|
||||||
esp32:
|
esp32:
|
||||||
@@ -70,13 +74,13 @@ web_server:
|
|||||||
auth:
|
auth:
|
||||||
username: admin
|
username: admin
|
||||||
password: ${wifi_password}
|
password: ${wifi_password}
|
||||||
##### advanced config - change to use web_password #####
|
##### advanced config - change to use web_password #####
|
||||||
# password: ${web_password}
|
# password: ${web_password}
|
||||||
|
|
||||||
##### OTA PASSWORD #####
|
##### OTA PASSWORD #####
|
||||||
ota:
|
ota:
|
||||||
password: ${wifi_password}
|
password: ${wifi_password}
|
||||||
##### advanced config - change to use ota_password #####
|
##### advanced config - change to use ota_password #####
|
||||||
# password: ${ota_password}
|
# password: ${ota_password}
|
||||||
safe_mode: true
|
safe_mode: true
|
||||||
reboot_timeout: 3min
|
reboot_timeout: 3min
|
||||||
@@ -126,7 +130,7 @@ button:
|
|||||||
|
|
||||||
##### START - API CONFIGURATION #####
|
##### START - API CONFIGURATION #####
|
||||||
api:
|
api:
|
||||||
##### advanced config - activate to use api_password #####
|
##### advanced config - activate to use api_password #####
|
||||||
# password: ${api_password}
|
# password: ${api_password}
|
||||||
services:
|
services:
|
||||||
|
|
||||||
@@ -142,7 +146,7 @@ api:
|
|||||||
then:
|
then:
|
||||||
- lambda: 'id(disp1)->set_tft_url(url.c_str());'
|
- lambda: 'id(disp1)->set_tft_url(url.c_str());'
|
||||||
- lambda: 'id(disp1)->upload_tft();'
|
- lambda: 'id(disp1)->upload_tft();'
|
||||||
|
|
||||||
##### Service to send a command "printf" directly to the display #####
|
##### Service to send a command "printf" directly to the display #####
|
||||||
- service: send_command_printf
|
- service: send_command_printf
|
||||||
variables:
|
variables:
|
||||||
@@ -204,7 +208,7 @@ api:
|
|||||||
- wait_until:
|
- wait_until:
|
||||||
switch.is_on: nextion_init
|
switch.is_on: nextion_init
|
||||||
- lambda: 'id(disp1).set_component_font_color(component.c_str(), message);'
|
- lambda: 'id(disp1).set_component_font_color(component.c_str(), message);'
|
||||||
|
|
||||||
##### Service to send a command "background color" directly to the display #####
|
##### Service to send a command "background color" directly to the display #####
|
||||||
- service: send_command_background_color
|
- service: send_command_background_color
|
||||||
variables:
|
variables:
|
||||||
@@ -263,7 +267,7 @@ api:
|
|||||||
song_str: string
|
song_str: string
|
||||||
then:
|
then:
|
||||||
- rtttl.play:
|
- rtttl.play:
|
||||||
rtttl: !lambda 'return song_str;'
|
rtttl: !lambda 'return song_str;'
|
||||||
|
|
||||||
# Service to show a QR code on the display (ex. for WiFi password)
|
# Service to show a QR code on the display (ex. for WiFi password)
|
||||||
- service: qr_code
|
- service: qr_code
|
||||||
@@ -302,6 +306,41 @@ api:
|
|||||||
id(disp1).set_component_text_printf("target_temp", "%.1f°", value);
|
id(disp1).set_component_text_printf("target_temp", "%.1f°", value);
|
||||||
id(display_target_temp).publish_state(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 #####
|
##### START - GLOBALS CONFIGURATION #####
|
||||||
globals:
|
globals:
|
||||||
@@ -380,13 +419,15 @@ binary_sensor:
|
|||||||
api.connected:
|
api.connected:
|
||||||
then:
|
then:
|
||||||
- switch.toggle: relay_1
|
- switch.toggle: relay_1
|
||||||
- lambda: id(disp1).send_command_printf("home.icon_top_01.pic=51");
|
|
||||||
- lambda: id(disp1).send_command_printf("home.left_bt_pic.pic=98");
|
|
||||||
- if:
|
- if:
|
||||||
condition:
|
condition:
|
||||||
switch.is_on: relay_1
|
switch.is_on: relay_1
|
||||||
then:
|
then:
|
||||||
- lambda: id(disp1).send_command_printf("home.icon_top_01.pic=105");
|
- 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 #####
|
##### RIGHT BUTTON BELOW DISPLAY TO TOGGLE RELAY #####
|
||||||
@@ -406,19 +447,21 @@ binary_sensor:
|
|||||||
api.connected:
|
api.connected:
|
||||||
then:
|
then:
|
||||||
- switch.toggle: relay_2
|
- switch.toggle: relay_2
|
||||||
- lambda: id(disp1).send_command_printf("home.icon_top_02.pic=51");
|
|
||||||
- lambda: id(disp1).send_command_printf("home.right_bt_pic.pic=98");
|
|
||||||
- if:
|
- if:
|
||||||
condition:
|
condition:
|
||||||
switch.is_on: relay_2
|
switch.is_on: relay_2
|
||||||
then:
|
then:
|
||||||
- lambda: id(disp1).send_command_printf("home.icon_top_02.pic=106");
|
- 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 #####
|
##### JUMP PAGE TO SETTING PAGE #####
|
||||||
- platform: nextion
|
- platform: nextion
|
||||||
name: $device_name setting page
|
name: $device_name setting page
|
||||||
page_id: 0
|
page_id: 0
|
||||||
component_id: 53
|
component_id: 52
|
||||||
internal: true
|
internal: true
|
||||||
on_multi_click:
|
on_multi_click:
|
||||||
- timing:
|
- timing:
|
||||||
@@ -430,7 +473,7 @@ binary_sensor:
|
|||||||
- platform: nextion
|
- platform: nextion
|
||||||
name: ${device_name} Restart
|
name: ${device_name} Restart
|
||||||
page_id: 7
|
page_id: 7
|
||||||
component_id: 15
|
component_id: 13
|
||||||
internal: true
|
internal: true
|
||||||
on_click:
|
on_click:
|
||||||
- button.press: restart_nspanel
|
- button.press: restart_nspanel
|
||||||
@@ -439,7 +482,7 @@ binary_sensor:
|
|||||||
- platform: nextion
|
- platform: nextion
|
||||||
name: ${device_name} Restart
|
name: ${device_name} Restart
|
||||||
page_id: 8
|
page_id: 8
|
||||||
component_id: 5
|
component_id: 4
|
||||||
internal: true
|
internal: true
|
||||||
on_click:
|
on_click:
|
||||||
- button.press: restart_nspanel
|
- button.press: restart_nspanel
|
||||||
@@ -448,7 +491,7 @@ binary_sensor:
|
|||||||
- platform: nextion
|
- platform: nextion
|
||||||
name: ${device_name} Sleep Modus
|
name: ${device_name} Sleep Modus
|
||||||
page_id: 7
|
page_id: 7
|
||||||
component_id: 16
|
component_id: 14
|
||||||
internal: true
|
internal: true
|
||||||
on_click:
|
on_click:
|
||||||
- switch.toggle: sleep_modus
|
- switch.toggle: sleep_modus
|
||||||
@@ -538,7 +581,7 @@ sensor:
|
|||||||
- number.set:
|
- number.set:
|
||||||
id: display_brightness
|
id: display_brightness
|
||||||
value: !lambda 'return int(x);'
|
value: !lambda 'return int(x);'
|
||||||
# send text field percentage of current_lightslider_val
|
# send text field percentage of current_lightslider_val
|
||||||
- lambda: id(disp1).set_component_text_printf("settings.a03", "%i", id(display_brightness_global));
|
- lambda: id(disp1).set_component_text_printf("settings.a03", "%i", id(display_brightness_global));
|
||||||
|
|
||||||
###### Display DIM Brightness GET VALUE FROM NSPanel SLIDER #####
|
###### Display DIM Brightness GET VALUE FROM NSPanel SLIDER #####
|
||||||
@@ -554,7 +597,7 @@ sensor:
|
|||||||
- number.set:
|
- number.set:
|
||||||
id: display_dim_brightness
|
id: display_dim_brightness
|
||||||
value: !lambda 'return int(x);'
|
value: !lambda 'return int(x);'
|
||||||
# send text field percentage of current_lightslider_val
|
# send text field percentage of current_lightslider_val
|
||||||
- lambda: id(disp1).set_component_text_printf("settings.a04", "%i", id(display_dim_brightness_global));
|
- lambda: id(disp1).set_component_text_printf("settings.a04", "%i", id(display_dim_brightness_global));
|
||||||
|
|
||||||
###### Send current page to HA
|
###### Send current page to HA
|
||||||
@@ -623,7 +666,7 @@ text_sensor:
|
|||||||
value: !lambda return x;
|
value: !lambda return x;
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
id(page_timer)->execute(int(id(page_timeout).state));
|
id(page_timer)->execute(int(id(page_timeout).state));
|
||||||
|
|
||||||
##### last click lightsettings page, the main action variable - push to HA #####
|
##### last click lightsettings page, the main action variable - push to HA #####
|
||||||
- platform: nextion
|
- platform: nextion
|
||||||
nextion_id: disp1
|
nextion_id: disp1
|
||||||
@@ -741,7 +784,7 @@ text_sensor:
|
|||||||
id(page_timer)->execute(int(id(page_timeout).state));
|
id(page_timer)->execute(int(id(page_timeout).state));
|
||||||
|
|
||||||
|
|
||||||
##### START - SWITCH CONFIGURATION #####
|
##### START - SWITCH CONFIGURATION #####
|
||||||
switch:
|
switch:
|
||||||
|
|
||||||
# ##### Restart switch ######
|
# ##### Restart switch ######
|
||||||
@@ -798,7 +841,7 @@ switch:
|
|||||||
id: relay_2
|
id: relay_2
|
||||||
pin:
|
pin:
|
||||||
number: 19
|
number: 19
|
||||||
|
|
||||||
##### DISPLAY ALWAYS ON #####
|
##### DISPLAY ALWAYS ON #####
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
name: ${device_name} Screen Power
|
name: ${device_name} Screen Power
|
||||||
@@ -832,7 +875,7 @@ switch:
|
|||||||
value: '1'
|
value: '1'
|
||||||
- lambda: id(disp1).set_component_value("settings.a02",1);
|
- lambda: id(disp1).set_component_value("settings.a02",1);
|
||||||
|
|
||||||
##### Relay Local control Fallback #####
|
##### Relay Local control Fallback #####
|
||||||
- platform: template
|
- platform: template
|
||||||
name: ${device_name} Relay 1 Local Fallback
|
name: ${device_name} Relay 1 Local Fallback
|
||||||
id: relay1_fallback
|
id: relay1_fallback
|
||||||
@@ -925,7 +968,7 @@ display:
|
|||||||
on_setup:
|
on_setup:
|
||||||
then:
|
then:
|
||||||
- lambda: id(disp1).send_command_printf("page 8");
|
- lambda: id(disp1).send_command_printf("page 8");
|
||||||
- lambda: id(disp1).set_component_text_printf("boot.esph_version", "%s", "3.2"); ### esphome-version ###
|
- lambda: id(disp1).set_component_text_printf("boot.esph_version", "%s", "3.2.2"); ### esphome-version ###
|
||||||
- wait_until:
|
- wait_until:
|
||||||
api.connected
|
api.connected
|
||||||
- lambda: id(disp1).set_component_text_printf("boot.ip_addr", "%s", id(ip_address).state.c_str());
|
- lambda: id(disp1).set_component_text_printf("boot.ip_addr", "%s", id(ip_address).state.c_str());
|
||||||
|
|||||||
BIN
nspanel_eu.HMI
BIN
nspanel_eu.HMI
Binary file not shown.
BIN
nspanel_eu.tft
BIN
nspanel_eu.tft
Binary file not shown.
BIN
nspanel_us.HMI
BIN
nspanel_us.HMI
Binary file not shown.
BIN
nspanel_us.tft
BIN
nspanel_us.tft
Binary file not shown.
Reference in New Issue
Block a user