From df10d097363542ee95101e83b390530c5f87ff98 Mon Sep 17 00:00:00 2001 From: deejaybeam Date: Sat, 1 Apr 2023 02:17:04 +0200 Subject: [PATCH 1/3] upd: use current nextion-component --- nspanel_esphome.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/nspanel_esphome.yaml b/nspanel_esphome.yaml index 9e1a296..eafbd55 100644 --- a/nspanel_esphome.yaml +++ b/nspanel_esphome.yaml @@ -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: From a8172a1b06ad4b5bb292b5331a232d76e0cfd4b4 Mon Sep 17 00:00:00 2001 From: deejaybeam Date: Sun, 2 Apr 2023 08:49:02 +0200 Subject: [PATCH 2/3] fix: fallback state --- nspanel_esphome.yaml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/nspanel_esphome.yaml b/nspanel_esphome.yaml index eafbd55..e5975d1 100644 --- a/nspanel_esphome.yaml +++ b/nspanel_esphome.yaml @@ -419,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 ##### @@ -445,13 +447,15 @@ 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 @@ -964,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()); From 350b3f4ca7e14b4571295d27733a2b5b8e050938 Mon Sep 17 00:00:00 2001 From: deejaybeam Date: Sun, 2 Apr 2023 08:55:30 +0200 Subject: [PATCH 3/3] upd: use set_button on all button pages --- nspanel_blueprint.yaml | 373 ++++------------------------------------- 1 file changed, 36 insertions(+), 337 deletions(-) diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index b39c408..688a01d 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -35,7 +35,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l 🎉 Roadmap Roadmap can be found here [Roadmap](https://github.com/Blackymas/NSPanel_HA_Blueprint/labels/roadmap) -ℹ️ Version: v.3.2.1 +ℹ️ Version: v.3.2.2 ' @@ -2356,7 +2356,7 @@ trigger_variables: variables: ##### GENERAL ##### - blueprint_version: "3.2.1" + blueprint_version: "3.2.2" language: !input "language" date_format: !input "date_format" time_format: !input "time_format" @@ -4830,92 +4830,7 @@ action: {%- else -%} 0 {%- endif -%} - # ##### SET Buttons Background #### - # # - # ##### SET Button PIC ##### - # - service: "{{ command_printf }}" - # data: - # cmd: "{{ repeat.item.button }}pic.pic={{ btn_pic }}" - # ##### SET ICON Background ##### - # - delay: - # milliseconds: "{{ delay_value }}" - # - service: "{{ command_background_color }}" - # data: - # component: "{{ repeat.item.button }}icon" - # message: "{{ btn_bg }}" - # ##### SET LABEL Background ##### - # - delay: - # milliseconds: "{{ delay_value }}" - # - service: "{{ command_background_color }}" - # data: - # component: "{{ repeat.item.button }}text" - # message: "{{ btn_bg }}" - # ##### SET BRIGHTNESS Background Color ##### - # - delay: - # milliseconds: "{{ delay_value }}" - # - service: "{{ command_background_color }}" - # data: - # component: "{{ repeat.item.button }}bri" - # message: "{{ btn_bg }}" - - # ##### SET Buttons Font Color #### - # # - # ##### SET ICON Font Color ##### - # - delay: - # milliseconds: "{{ delay_value }}" - # - service: "{{ command_font_color }}" - # data: - # component: "{{ repeat.item.button }}icon" - # message: "{{ btn_icon_font }}" - # ##### SET LABEL Font Color ##### - # - delay: - # milliseconds: "{{ delay_value }}" - # - service: "{{ command_font_color }}" - # data: - # component: "{{ repeat.item.button }}text" - # message: "{{ btn_txt_font }}" - # ##### SET BRIGHTNESS Font Color ##### - # - delay: - # milliseconds: "{{ delay_value }}" - # - service: "{{ command_font_color }}" - # data: - # component: "{{ repeat.item.button }}bri" - # message: "{{ btn_bri_font }}" - - # ##### SET Buttons Text Value #### - # # - # ##### "ICON" Value ##### - # - delay: - # milliseconds: "{{ delay_value }}" - # - service: "{{ command_text_printf }}" - # data: - # component: "{{ repeat.item.button }}icon" - # message: "{{ btn_icon }}" - # ##### "LABEL" Value ##### - # - delay: - # milliseconds: "{{ delay_value }}" - # - service: "{{ command_text_printf }}" - # data: - # component: "{{ repeat.item.button }}text" - # message: "{{ btn_label }}" - - # ##### "BRIGHTNESS" Value ##### - # - delay: - # milliseconds: "{{ delay_value }}" - # - if: - # - condition: template - # value_template: "{{ btn_bri_txt == 0 }}" - # then: - # - service: "{{ command_text_printf }}" - # data: - # component: "{{ repeat.item.button }}bri" - # message: " " - # else: - # - service: "{{ command_text_printf }}" - # data: - # component: "{{ repeat.item.button }}bri" - # message: "{{ btn_bri_txt }}" - + ##### Set buttton ##### - service: "{{ command_set_button }}" data: btn_id: "{{ repeat.item.button }}" @@ -5094,91 +5009,19 @@ action: {%- else -%} 0 {%- endif -%} - ##### SET Buttons Background #### - # - ##### SET Button PIC ##### - - service: "{{ command_printf }}" + ##### Set buttton ##### + - service: "{{ command_set_button }}" data: - cmd: "{{ repeat.item.button }}pic.pic={{ btn_pic }}" - ##### SET ICON Background ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_background_color }}" - data: - component: "{{ repeat.item.button }}icon" - message: "{{ btn_bg }}" - ##### SET LABEL Background ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_background_color }}" - data: - component: "{{ repeat.item.button }}text" - message: "{{ btn_bg }}" - ##### SET BRIGHTNESS Background Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_background_color }}" - data: - component: "{{ repeat.item.button }}bri" - message: "{{ btn_bg }}" + btn_id: "{{ repeat.item.button }}" + btn_pic: "{{ btn_pic }}" + btn_bg: "{{ btn_bg }}" + btn_icon_font: "{{ btn_icon_font }}" + btn_txt_font: "{{ btn_txt_font }}" + btn_bri_font: "{{ btn_bri_font }}" + btn_icon: "{{ btn_icon }}" + btn_label: "{{ btn_label }}" + btn_bri_txt: "{{ btn_bri_txt }}" - ##### SET Buttons Font Color #### - # - ##### SET ICON Font Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_font_color }}" - data: - component: "{{ repeat.item.button }}icon" - message: "{{ btn_icon_font }}" - ##### SET LABEL Font Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_font_color }}" - data: - component: "{{ repeat.item.button }}text" - message: "{{ btn_txt_font }}" - ##### SET BRIGHTNESS Font Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_font_color }}" - data: - component: "{{ repeat.item.button }}bri" - message: "{{ btn_bri_font }}" - - ##### SET Buttons Text Value #### - # - ##### "ICON" Value ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}icon" - message: "{{ btn_icon }}" - ##### "LABEL" Value ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}text" - message: "{{ btn_label }}" - - ##### "BRIGHTNESS" Value ##### - - delay: - milliseconds: "{{ delay_value }}" - - if: - - condition: template - value_template: "{{ btn_bri_txt == 0 }}" - then: - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}bri" - message: " " - else: - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}bri" - message: "{{ btn_bri_txt }}" ###### SHOW All component when page loading done ##### - delay: milliseconds: "{{ delay_value }}" @@ -5345,91 +5188,19 @@ action: {%- else -%} 0 {%- endif -%} - ##### SET Buttons Background #### - # - ##### SET Button PIC ##### - - service: "{{ command_printf }}" + ##### Set buttton ##### + - service: "{{ command_set_button }}" data: - cmd: "{{ repeat.item.button }}pic.pic={{ btn_pic }}" - ##### SET ICON Background ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_background_color }}" - data: - component: "{{ repeat.item.button }}icon" - message: "{{ btn_bg }}" - ##### SET LABEL Background ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_background_color }}" - data: - component: "{{ repeat.item.button }}text" - message: "{{ btn_bg }}" - ##### SET BRIGHTNESS Background Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_background_color }}" - data: - component: "{{ repeat.item.button }}bri" - message: "{{ btn_bg }}" + btn_id: "{{ repeat.item.button }}" + btn_pic: "{{ btn_pic }}" + btn_bg: "{{ btn_bg }}" + btn_icon_font: "{{ btn_icon_font }}" + btn_txt_font: "{{ btn_txt_font }}" + btn_bri_font: "{{ btn_bri_font }}" + btn_icon: "{{ btn_icon }}" + btn_label: "{{ btn_label }}" + btn_bri_txt: "{{ btn_bri_txt }}" - ##### SET Buttons Font Color #### - # - ##### SET ICON Font Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_font_color }}" - data: - component: "{{ repeat.item.button }}icon" - message: "{{ btn_icon_font }}" - ##### SET LABEL Font Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_font_color }}" - data: - component: "{{ repeat.item.button }}text" - message: "{{ btn_txt_font }}" - ##### SET BRIGHTNESS Font Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_font_color }}" - data: - component: "{{ repeat.item.button }}bri" - message: "{{ btn_bri_font }}" - - ##### SET Buttons Text Value #### - # - ##### "ICON" Value ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}icon" - message: "{{ btn_icon }}" - ##### "LABEL" Value ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}text" - message: "{{ btn_label }}" - - ##### "BRIGHTNESS" Value ##### - - delay: - milliseconds: "{{ delay_value }}" - - if: - - condition: template - value_template: "{{ btn_bri_txt == 0 }}" - then: - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}bri" - message: " " - else: - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}bri" - message: "{{ btn_bri_txt }}" ###### SHOW All component when page loading done ##### - delay: milliseconds: "{{ delay_value }}" @@ -5596,91 +5367,19 @@ action: {%- else -%} 0 {%- endif -%} - ##### SET Buttons Background #### - # - ##### SET Button PIC ##### - - service: "{{ command_printf }}" + ##### Set buttton ##### + - service: "{{ command_set_button }}" data: - cmd: "{{ repeat.item.button }}pic.pic={{ btn_pic }}" - ##### SET ICON Background ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_background_color }}" - data: - component: "{{ repeat.item.button }}icon" - message: "{{ btn_bg }}" - ##### SET LABEL Background ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_background_color }}" - data: - component: "{{ repeat.item.button }}text" - message: "{{ btn_bg }}" - ##### SET BRIGHTNESS Background Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_background_color }}" - data: - component: "{{ repeat.item.button }}bri" - message: "{{ btn_bg }}" + btn_id: "{{ repeat.item.button }}" + btn_pic: "{{ btn_pic }}" + btn_bg: "{{ btn_bg }}" + btn_icon_font: "{{ btn_icon_font }}" + btn_txt_font: "{{ btn_txt_font }}" + btn_bri_font: "{{ btn_bri_font }}" + btn_icon: "{{ btn_icon }}" + btn_label: "{{ btn_label }}" + btn_bri_txt: "{{ btn_bri_txt }}" - ##### SET Buttons Font Color #### - # - ##### SET ICON Font Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_font_color }}" - data: - component: "{{ repeat.item.button }}icon" - message: "{{ btn_icon_font }}" - ##### SET LABEL Font Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_font_color }}" - data: - component: "{{ repeat.item.button }}text" - message: "{{ btn_txt_font }}" - ##### SET BRIGHTNESS Font Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_font_color }}" - data: - component: "{{ repeat.item.button }}bri" - message: "{{ btn_bri_font }}" - - ##### SET Buttons Text Value #### - # - ##### "ICON" Value ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}icon" - message: "{{ btn_icon }}" - ##### "LABEL" Value ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}text" - message: "{{ btn_label }}" - - ##### "BRIGHTNESS" Value ##### - - delay: - milliseconds: "{{ delay_value }}" - - if: - - condition: template - value_template: "{{ btn_bri_txt == 0 }}" - then: - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}bri" - message: " " - else: - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}bri" - message: "{{ btn_bri_txt }}" ###### SHOW All component when page loading done ##### - delay: milliseconds: "{{ delay_value }}"