From 9a1b447087d7394a8484008ff91f79e8afa93eb3 Mon Sep 17 00:00:00 2001 From: deejaybeam Date: Tue, 24 Jan 2023 00:21:12 +0100 Subject: [PATCH 1/2] upd: change qr-code-call --- nspanel_blueprint.yaml | 32 ++++++++++++++++---------------- nspanel_esphome.yaml | 1 + 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index e61f874..591404b 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -2884,10 +2884,26 @@ action: id: open_qrcode_page - condition: template value_template: '{{ qrcode_state == true }}' + - condition: template + value_template: '{{ qrcode_value |length > 0 }}' sequence: - service: "{{ command_printf }}" data: cmd: "page {{ page_qrcode }}" + - if: + - condition: template + value_template: '{{ qrcode_label |length > 0 }}' + then: + - service: "{{ command_text_printf }}" + data: + component: "qrcode_label" + message: "{{ qrcode_label }}" + - delay: + milliseconds: "{{ delay_value }}" + - service: "{{ command_text_printf }}" + data: + component: "qrcode_value" + message: "{{ qrcode_value }}" ##### Button Notification clear ##### - conditions: @@ -5940,22 +5956,6 @@ action: ## PAGE QR Code ## - conditions: '{{ trigger.event.data.new_state.state == page_qrcode }}' sequence: - ##### QR Code Page Label ##### - - if: - - condition: template - value_template: '{{ qrcode_label |length > 0 }}' - then: - - service: "{{ command_text_printf }}" - data: - component: "qrcode_label" - message: "{{ qrcode_label }}" - - delay: - milliseconds: "{{ delay_value }}" - - - service: "{{ command_text_printf }}" - data: - component: "qrcode_value" - message: "{{ qrcode_value }}" ##### Open Climate Settings ##### - conditions: diff --git a/nspanel_esphome.yaml b/nspanel_esphome.yaml index 38ba39a..8205a86 100644 --- a/nspanel_esphome.yaml +++ b/nspanel_esphome.yaml @@ -246,6 +246,7 @@ api: - 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 #### From eb9d9e0f1e02eacf8beffb5b9649c04e869d7fa8 Mon Sep 17 00:00:00 2001 From: deejaybeam Date: Tue, 24 Jan 2023 01:05:09 +0100 Subject: [PATCH 2/2] upd: set local fallback via blueprint --- nspanel_blueprint.yaml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index 591404b..078b885 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -279,6 +279,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + relay_1_local_fallback: + name: Activate Relay 1 local Fallback (Optional) + default: false + description: '* *activate this to use left button to toggle relay 1 if display is offline* ' + selector: + boolean: right_button_entity: name: Right Button (Optional) description: '* *Right Hardware Button - Select the entity that should be switched*' @@ -302,6 +308,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + relay_2_local_fallback: + name: Activate Relay 2 local Fallback (Optional) + default: false + description: '* *activate this to use right button to toggle relay 2 if display is offline* ' + selector: + boolean: ##### BUTTON Page Labels ##### button_page01_label: @@ -1410,6 +1422,8 @@ variables: qrcode_label: !input "qrcode_label" qrcode_value: !input "qrcode_value" qrcode_state: !input "qrcode_state" + relay_1_local_fallback: !input "relay_1_local_fallback" + relay_2_local_fallback: !input "relay_2_local_fallback" #### HARDWARE BUTTONS ##### left_button_entity: !input "left_button_entity" @@ -2830,6 +2844,30 @@ action: data: song_str: "two short:d=4,o=5,b=100:16e6,16e6" + ###### Set local fallback ###### + - if: + - condition: template + value_template: '{{ relay_1_local_fallback }}' + then: + - service: switch.turn_on + data: + entity_id: 'switch.{{ nspanel_name }}_relay_1_local_fallback' + else: + - service: switch.turn_off + data: + entity_id: 'switch.{{ nspanel_name }}_relay_1_local_fallback' + - if: + - condition: template + value_template: '{{ relay_2_local_fallback }}' + then: + - service: switch.turn_on + data: + entity_id: 'switch.{{ nspanel_name }}_relay_2_local_fallback' + else: + - service: switch.turn_off + data: + entity_id: 'switch.{{ nspanel_name }}_relay_2_local_fallback' + ##### NSPanel boot init finished and jump to Home Page##### - delay: milliseconds: "{{ delay_value }}"