Compare commits
36 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 | ||
|
|
ecd806b1c5 | ||
|
|
4392bf251b | ||
|
|
9616ea4c8f | ||
|
|
2a9162e809 | ||
|
|
881c50dd1f |
File diff suppressed because it is too large
Load Diff
@@ -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:
|
||||
@@ -302,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:
|
||||
@@ -380,13 +419,15 @@ 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");
|
||||
- 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 #####
|
||||
@@ -406,19 +447,21 @@ 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");
|
||||
- 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: 53
|
||||
component_id: 52
|
||||
internal: true
|
||||
on_multi_click:
|
||||
- timing:
|
||||
@@ -430,7 +473,7 @@ binary_sensor:
|
||||
- platform: nextion
|
||||
name: ${device_name} Restart
|
||||
page_id: 7
|
||||
component_id: 15
|
||||
component_id: 13
|
||||
internal: true
|
||||
on_click:
|
||||
- button.press: restart_nspanel
|
||||
@@ -439,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
|
||||
@@ -448,7 +491,7 @@ binary_sensor:
|
||||
- platform: nextion
|
||||
name: ${device_name} Sleep Modus
|
||||
page_id: 7
|
||||
component_id: 16
|
||||
component_id: 14
|
||||
internal: true
|
||||
on_click:
|
||||
- switch.toggle: sleep_modus
|
||||
@@ -925,7 +968,7 @@ display:
|
||||
on_setup:
|
||||
then:
|
||||
- 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:
|
||||
api.connected
|
||||
- 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