Compare commits
180 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
787f337220 | ||
|
|
44aaea74ec | ||
|
|
4a346ce2d2 | ||
|
|
4ead4382a2 | ||
|
|
1e64e134f9 | ||
|
|
68190ece4b | ||
|
|
81d0bcf304 | ||
|
|
94364d711e | ||
|
|
2953942fbd | ||
|
|
51173352d2 | ||
|
|
1bec2b1160 | ||
|
|
4921453a1b | ||
|
|
95a4447eeb | ||
|
|
350b3f4ca7 | ||
|
|
a8172a1b06 | ||
|
|
df10d09736 | ||
|
|
4f31326b8e | ||
|
|
f0e557b5e4 | ||
|
|
80d19b1da1 | ||
|
|
df0855862f | ||
|
|
d23fe9616c | ||
|
|
76fee43d3b | ||
|
|
e8fd5e2020 | ||
|
|
89faeb3ec1 | ||
|
|
a006af2654 | ||
|
|
4ea23c7cf5 | ||
|
|
1e7ead8e46 | ||
|
|
d88290474e | ||
|
|
75f17f0d3e | ||
|
|
8a21f88df9 | ||
|
|
5a01431670 | ||
|
|
7c90677d99 | ||
|
|
fe65530eb5 | ||
|
|
ecd806b1c5 | ||
|
|
72e59947b6 | ||
|
|
8869eb2f67 | ||
|
|
c7c54261cb | ||
|
|
27185ea88c | ||
|
|
bfe2c65bfd | ||
|
|
45dafc3d0d | ||
|
|
c9c31bba57 | ||
|
|
485e5cc8d2 | ||
|
|
175c927ee8 | ||
|
|
4392bf251b | ||
|
|
9616ea4c8f | ||
|
|
2a9162e809 | ||
|
|
df976b0a90 | ||
|
|
220b5fb02b | ||
|
|
a0a0d16af7 | ||
|
|
f97b298d00 | ||
|
|
6feba8a56d | ||
|
|
0ff61a2e4a | ||
|
|
aee6e7bb57 | ||
|
|
602a58cc40 | ||
|
|
5e45641687 | ||
|
|
8b2beec50c | ||
|
|
3278de673a | ||
|
|
3cf5fb3eeb | ||
|
|
d53a34b83f | ||
|
|
e4f0dba8fa | ||
|
|
3ea33a6dfa | ||
|
|
6b11ffb7cf | ||
|
|
3047204272 | ||
|
|
61af338a96 | ||
|
|
729414944b | ||
|
|
22dbd2814b | ||
|
|
44836d1e4d | ||
|
|
881c50dd1f | ||
|
|
ce7dfb1423 | ||
|
|
c45bd4057f | ||
|
|
3401340563 | ||
|
|
7f7d496beb | ||
|
|
c7ec9f97b7 | ||
|
|
3c58a29e73 | ||
|
|
7fd5658630 | ||
|
|
81f6783ca1 | ||
|
|
cf430fc1a8 | ||
|
|
7f6c9c696b | ||
|
|
7580a38b4f | ||
|
|
14532444bc | ||
|
|
f2a424027d | ||
|
|
f038eaed87 | ||
|
|
3f00773927 | ||
|
|
7e63a4cb18 | ||
|
|
e6fd475947 | ||
|
|
1869f8023d | ||
|
|
860f5ddbba | ||
|
|
218ef94c9c | ||
|
|
730e0acd99 | ||
|
|
c8afa129b5 | ||
|
|
ee0c21128d | ||
|
|
1aed46b71f | ||
|
|
4e38a928fc | ||
|
|
d58ba87dbb | ||
|
|
640e245cf8 | ||
|
|
f056dace88 | ||
|
|
3211f44770 | ||
|
|
bd5b1303f2 | ||
|
|
8ff0cad379 | ||
|
|
fdcd37c6d0 | ||
|
|
6a464325d7 | ||
|
|
3af0c20670 | ||
|
|
7ee10d4ca6 | ||
|
|
884c8d91e6 | ||
|
|
07b8e99b01 | ||
|
|
d74b70f864 | ||
|
|
e70fcd54eb | ||
|
|
ea5b80e3b8 | ||
|
|
b5cd83240f | ||
|
|
7d241d1400 | ||
|
|
ee2e1d53d2 | ||
|
|
36e0344345 | ||
|
|
eb6eebfd46 | ||
|
|
0de7850c39 | ||
|
|
5f1d2b9d10 | ||
|
|
0abd5531cb | ||
|
|
0fdcd088ec | ||
|
|
29df75263b | ||
|
|
5035b89956 | ||
|
|
9de5abff25 | ||
|
|
a113e0cd43 | ||
|
|
a2f5e69b76 | ||
|
|
0e41a87659 | ||
|
|
f6a6a7adb0 | ||
|
|
8abfee7b54 | ||
|
|
70038014a2 | ||
|
|
268c6a7e23 | ||
|
|
133165e79e | ||
|
|
99f2b2815d | ||
|
|
d6f0958652 | ||
|
|
6704e320da | ||
|
|
d0d09b93a4 | ||
|
|
155ab33086 | ||
|
|
55ed836400 | ||
|
|
6ac6a25803 | ||
|
|
26844cd290 | ||
|
|
7dc0f49809 | ||
|
|
71cd913135 | ||
|
|
dfa3ee901a | ||
|
|
f7131aaca0 | ||
|
|
fefb1374fd | ||
|
|
8f5165bd1b | ||
|
|
94a51da6fe | ||
|
|
e422a158ca | ||
|
|
b43d83291b | ||
|
|
e751938cdd | ||
|
|
b8321807dc | ||
|
|
3a42c12c00 | ||
|
|
d552fb458b | ||
|
|
a7b96d8582 | ||
|
|
18f188bb32 | ||
|
|
f44d3fd8d1 | ||
|
|
a0b8697a4f | ||
|
|
de8f463968 | ||
|
|
6642a46a04 | ||
|
|
0b856cbb83 | ||
|
|
e41c02e883 | ||
|
|
6f3dc4a010 | ||
|
|
d46eecc57c | ||
|
|
7223103905 | ||
|
|
547338c5b1 | ||
|
|
811aca8cfa | ||
|
|
0465a9eb8b | ||
|
|
45907e1ce5 | ||
|
|
3ff82ef8cd | ||
|
|
5f6cc373fe | ||
|
|
4801f6c6b9 | ||
|
|
02b4f6e178 | ||
|
|
b0161d41f8 | ||
|
|
d1702ccacf | ||
|
|
281be927a7 | ||
|
|
c352047991 | ||
|
|
c058fd4fb1 | ||
|
|
e4e5cb0f51 | ||
|
|
da611e384a | ||
|
|
5292bbff8b | ||
|
|
a22311c4e8 | ||
|
|
0d250fb56b | ||
|
|
5ba5d2fb08 | ||
|
|
51170c514d |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,6 @@
|
||||
# Ignore Mac DS_Store files
|
||||
.DS_Store
|
||||
**/.DS_Store
|
||||
|
||||
# Ignore IntelliJ IDEA project directory
|
||||
.idea
|
||||
|
||||
Binary file not shown.
11029
nspanel_blueprint.yaml
11029
nspanel_blueprint.yaml
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@
|
||||
|
||||
|
||||
##### ADVANCED CONFIGURATION - activate only when you know what you do ##############################
|
||||
# substitutions:
|
||||
# substitutions:
|
||||
# ## usage of secrets-file ## -> comment in ###### Change ME ######
|
||||
# device_name: "nspanel-name" # Wird im Blueprint benötigt!
|
||||
# wifi_ssid: !secret nspanel_wifi_ssid # add in your esphome secrets file.
|
||||
@@ -36,7 +36,7 @@ wifi:
|
||||
ssid: ${wifi_ssid}
|
||||
password: ${wifi_password}
|
||||
power_save_mode: none
|
||||
##### advanced config - uncomment to use static IP-Config #####
|
||||
##### advanced config - uncomment to use static IP-Config #####
|
||||
# manual_ip:
|
||||
# static_ip: ${ip}
|
||||
# gateway: ${gw}
|
||||
@@ -49,15 +49,19 @@ wifi:
|
||||
password: ${wifi_password}
|
||||
|
||||
##### Functionality for the Nextion display #####
|
||||
external_components:
|
||||
- source: github://pr#2956
|
||||
components: [nextion]
|
||||
refresh: 1h
|
||||
# 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:
|
||||
@@ -70,13 +74,13 @@ web_server:
|
||||
auth:
|
||||
username: admin
|
||||
password: ${wifi_password}
|
||||
##### advanced config - change to use web_password #####
|
||||
##### advanced config - change to use web_password #####
|
||||
# password: ${web_password}
|
||||
|
||||
##### OTA PASSWORD #####
|
||||
ota:
|
||||
password: ${wifi_password}
|
||||
##### advanced config - change to use ota_password #####
|
||||
##### advanced config - change to use ota_password #####
|
||||
# password: ${ota_password}
|
||||
safe_mode: true
|
||||
reboot_timeout: 3min
|
||||
@@ -107,16 +111,26 @@ uart:
|
||||
baud_rate: 115200
|
||||
id: tf_uart
|
||||
|
||||
###### REBOOT BUTTON #####
|
||||
##### 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 #####
|
||||
##### advanced config - activate to use api_password #####
|
||||
# password: ${api_password}
|
||||
services:
|
||||
|
||||
@@ -132,7 +146,7 @@ api:
|
||||
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:
|
||||
@@ -161,7 +175,7 @@ api:
|
||||
- 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
|
||||
- service: send_command_hide ### unused ###
|
||||
variables:
|
||||
component: string
|
||||
then:
|
||||
@@ -170,7 +184,7 @@ api:
|
||||
- lambda: 'id(disp1).hide_component(component.c_str());'
|
||||
|
||||
##### Service to send a command "show componente" directly to the display #####
|
||||
- service: send_command_show
|
||||
- service: send_command_show ### unused ###
|
||||
variables:
|
||||
component: string
|
||||
then:
|
||||
@@ -178,6 +192,13 @@ api:
|
||||
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:
|
||||
@@ -187,7 +208,7 @@ api:
|
||||
- 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:
|
||||
@@ -229,6 +250,16 @@ api:
|
||||
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
|
||||
@@ -236,7 +267,7 @@ api:
|
||||
song_str: string
|
||||
then:
|
||||
- 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: qr_code
|
||||
@@ -275,6 +306,41 @@ api:
|
||||
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:
|
||||
@@ -338,18 +404,13 @@ binary_sensor:
|
||||
|
||||
###### LEFT BUTTON BELOW DISPLAY TO TOGGLE RELAY#####
|
||||
- platform: gpio
|
||||
# name: ${device_name} Left Button
|
||||
name: ${device_name} Left Button
|
||||
id: left_button
|
||||
pin:
|
||||
number: 14
|
||||
inverted: true
|
||||
on_click:
|
||||
- min_length: 50ms
|
||||
max_length: 1000ms
|
||||
then:
|
||||
- binary_sensor.template.publish:
|
||||
id: left_button_short
|
||||
state: ON
|
||||
- if:
|
||||
condition:
|
||||
and:
|
||||
@@ -358,57 +419,26 @@ binary_sensor:
|
||||
api.connected:
|
||||
then:
|
||||
- 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:
|
||||
condition:
|
||||
switch.is_on: relay_1
|
||||
then:
|
||||
- lambda: id(disp1).send_command_printf("home.icon_top_01.pic=105");
|
||||
- delay: 500ms
|
||||
- binary_sensor.template.publish:
|
||||
id: left_button_short
|
||||
state: OFF
|
||||
on_press:
|
||||
then:
|
||||
- lambda: |-
|
||||
if (id(disp1_currentpage).state == "lightsettings" or id(disp1_currentpage).state == "coversettings") {
|
||||
ESP_LOGD("nspanel", "settingspage -> no press");
|
||||
} else {
|
||||
// ESP_LOGD("nspanel", "release button");
|
||||
id(disp1_lastclick_general).set_state("pressbuttonleft",true,true);
|
||||
}
|
||||
on_release:
|
||||
then:
|
||||
- lambda: |-
|
||||
if (id(disp1_currentpage).state == "lightsettings" or id(disp1_currentpage).state == "coversettings") {
|
||||
ESP_LOGD("nspanel", "settingspage -> no release");
|
||||
} else {
|
||||
// ESP_LOGD("nspanel", "release button");
|
||||
id(disp1_lastclick_general).set_state("releasebuttonleft",true,true);
|
||||
}
|
||||
|
||||
- platform: template
|
||||
name: ${device_name} Left Button
|
||||
id: left_button_short
|
||||
lambda: |-
|
||||
return {};
|
||||
- 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
|
||||
name: ${device_name} Right Button
|
||||
id: right_button
|
||||
pin:
|
||||
number: 27
|
||||
inverted: true
|
||||
on_click:
|
||||
- min_length: 50ms
|
||||
max_length: 1000ms
|
||||
then:
|
||||
- binary_sensor.template.publish:
|
||||
id: right_button_short
|
||||
state: ON
|
||||
- if:
|
||||
condition:
|
||||
and:
|
||||
@@ -417,47 +447,33 @@ binary_sensor:
|
||||
api.connected:
|
||||
then:
|
||||
- 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:
|
||||
condition:
|
||||
switch.is_on: relay_2
|
||||
then:
|
||||
- lambda: id(disp1).send_command_printf("home.icon_top_02.pic=106");
|
||||
- delay: 500ms
|
||||
- binary_sensor.template.publish:
|
||||
id: right_button_short
|
||||
state: OFF
|
||||
on_press:
|
||||
then:
|
||||
- lambda: |-
|
||||
if (id(disp1_currentpage).state == "lightsettings" or id(disp1_currentpage).state == "coversettings") {
|
||||
ESP_LOGD("nspanel", "settingspage -> no press");
|
||||
} else {
|
||||
// ESP_LOGD("nspanel", "release button");
|
||||
id(disp1_lastclick_general).set_state("pressbuttonright",true,true);
|
||||
}
|
||||
on_release:
|
||||
then:
|
||||
- lambda: |-
|
||||
if (id(disp1_currentpage).state == "lightsettings" or id(disp1_currentpage).state == "coversettings") {
|
||||
ESP_LOGD("nspanel", "settingspage -> no release");
|
||||
} else {
|
||||
// ESP_LOGD("nspanel", "release button");
|
||||
id(disp1_lastclick_general).set_state("releasebuttonright",true,true);
|
||||
}
|
||||
- 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");
|
||||
|
||||
- platform: template
|
||||
name: ${device_name} Right Button
|
||||
id: right_button_short
|
||||
lambda: |-
|
||||
return {};
|
||||
##### 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: 8
|
||||
component_id: 13
|
||||
internal: true
|
||||
on_click:
|
||||
- button.press: restart_nspanel
|
||||
@@ -466,7 +482,7 @@ binary_sensor:
|
||||
- platform: nextion
|
||||
name: ${device_name} Restart
|
||||
page_id: 8
|
||||
component_id: 5
|
||||
component_id: 4
|
||||
internal: true
|
||||
on_click:
|
||||
- button.press: restart_nspanel
|
||||
@@ -475,7 +491,7 @@ binary_sensor:
|
||||
- platform: nextion
|
||||
name: ${device_name} Sleep Modus
|
||||
page_id: 7
|
||||
component_id: 3
|
||||
component_id: 14
|
||||
internal: true
|
||||
on_click:
|
||||
- switch.toggle: sleep_modus
|
||||
@@ -504,6 +520,14 @@ sensor:
|
||||
- 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
|
||||
@@ -557,7 +581,7 @@ sensor:
|
||||
- number.set:
|
||||
id: display_brightness
|
||||
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));
|
||||
|
||||
###### Display DIM Brightness GET VALUE FROM NSPanel SLIDER #####
|
||||
@@ -573,7 +597,7 @@ sensor:
|
||||
- number.set:
|
||||
id: display_dim_brightness
|
||||
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));
|
||||
|
||||
###### Send current page to HA
|
||||
@@ -616,6 +640,10 @@ text_sensor:
|
||||
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
|
||||
@@ -638,7 +666,7 @@ text_sensor:
|
||||
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
|
||||
@@ -756,7 +784,7 @@ text_sensor:
|
||||
id(page_timer)->execute(int(id(page_timeout).state));
|
||||
|
||||
|
||||
##### START - SWITCH CONFIGURATION #####
|
||||
##### START - SWITCH CONFIGURATION #####
|
||||
switch:
|
||||
|
||||
# ##### Restart switch ######
|
||||
@@ -800,16 +828,6 @@ switch:
|
||||
restore_state: false
|
||||
optimistic: true
|
||||
|
||||
##### UPDATE TFT DISPLAY #####
|
||||
- platform: template
|
||||
name: ${device_name} Update TFT display
|
||||
id: tft_update
|
||||
entity_category: config
|
||||
turn_on_action:
|
||||
- delay: 16ms
|
||||
- lambda: id(disp1).upload_tft();
|
||||
- switch.turn_off: tft_update
|
||||
|
||||
##### PHYSICAL SWITCH 1 #####
|
||||
- platform: gpio
|
||||
name: ${device_name} Relay 1
|
||||
@@ -823,7 +841,7 @@ switch:
|
||||
id: relay_2
|
||||
pin:
|
||||
number: 19
|
||||
|
||||
|
||||
##### DISPLAY ALWAYS ON #####
|
||||
- platform: gpio
|
||||
name: ${device_name} Screen Power
|
||||
@@ -857,7 +875,7 @@ switch:
|
||||
value: '1'
|
||||
- lambda: id(disp1).set_component_value("settings.a02",1);
|
||||
|
||||
##### Relay Local control Fallback #####
|
||||
##### Relay Local control Fallback #####
|
||||
- platform: template
|
||||
name: ${device_name} Relay 1 Local Fallback
|
||||
id: relay1_fallback
|
||||
@@ -950,11 +968,11 @@ display:
|
||||
on_setup:
|
||||
then:
|
||||
- lambda: id(disp1).send_command_printf("page 8");
|
||||
- lambda: id(disp1).set_component_text_printf("boot.esph_version", "%s", "3.1.0"); ### esphome-version ###
|
||||
- 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: 0.5s
|
||||
- delay: 1s
|
||||
- number.set:
|
||||
id: display_brightness
|
||||
value: !lambda 'return id(display_brightness_global);'
|
||||
@@ -967,7 +985,7 @@ display:
|
||||
- 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: 0.5s
|
||||
- delay: 1s
|
||||
- switch.template.publish:
|
||||
id: nextion_init
|
||||
state: on
|
||||
@@ -988,4 +1006,3 @@ script:
|
||||
ESP_LOGD("nspanel", "timer->home");
|
||||
id(disp1).send_command_printf("page 0");
|
||||
}
|
||||
|
||||
|
||||
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