diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index 33bb278..980be71 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -318,6 +318,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity01_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button01"** action*' + selector: + boolean: entity02: name: Button 02 (Optional) description: '* *Displayed on **"Button Page 1"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -342,6 +348,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity02_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button02"** action*' + selector: + boolean: entity03: name: Button 03 (Optional) description: '* *Displayed on **"Button Page 1"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -366,6 +378,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity03_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button03"** action*' + selector: + boolean: entity04: name: Button 04 (Optional) description: '* *Displayed on **"Button Page 1"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -390,6 +408,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity04_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button04"** action*' + selector: + boolean: entity05: name: Button 05 (Optional) description: '* *Displayed on **"Button Page 1"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -414,6 +438,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity05_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button05"** action*' + selector: + boolean: entity06: name: Button 06 (Optional) description: '* *Displayed on **"Button Page 1"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -438,6 +468,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity06_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button06"** action*' + selector: + boolean: entity07: name: Button 07 (Optional) description: '* *Displayed on **"Button Page 1"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -462,6 +498,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity07_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button07"** action*' + selector: + boolean: entity08: name: Button 08 (Optional) description: '* *Displayed on **"Button Page 1"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -486,6 +528,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity08_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button08"** action*' + selector: + boolean: entity09: name: Button 09 (Optional) description: '* *Displayed on **"Button Page 2"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -510,6 +558,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity09_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button09"** action*' + selector: + boolean: entity10: name: Button 10 (Optional) description: '* *Displayed on **"Button Page 2"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -534,6 +588,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity10_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button10"** action*' + selector: + boolean: entity11: name: Button 11 (Optional) description: '* *Displayed on **"Button Page 2"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -558,6 +618,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity11_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button11"** action*' + selector: + boolean: entity12: name: Button 12 (Optional) description: '* *Displayed on **"Button Page 2"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -582,6 +648,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity12_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button12"** action*' + selector: + boolean: entity13: name: Button 13 (Optional) description: '* *Displayed on **"Button Page 2"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -606,6 +678,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity13_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button13"** action*' + selector: + boolean: entity14: name: Button 14 (Optional) description: '* *Displayed on **"Button Page 2"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -630,6 +708,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity14_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button14"** action*' + selector: + boolean: entity15: name: Button 15 (Optional) description: '* *Displayed on **"Button Page 2"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -654,6 +738,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity15_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button15"** action*' + selector: + boolean: entity16: name: Button 16 (Optional) description: '* *Displayed on **"Button Page 2"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -678,6 +768,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity16_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button16"** action*' + selector: + boolean: entity17: name: Button 17 (Optional) description: '* *Displayed on **"Button Page 3"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -702,6 +798,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity17_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button17"** action*' + selector: + boolean: entity18: name: Button 18 (Optional) description: '* *Displayed on **"Button Page 3"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -726,6 +828,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity18_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button18"** action*' + selector: + boolean: entity19: name: Button 19 (Optional) description: '* *Displayed on **"Button Page 3"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -750,6 +858,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity19_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button19"** action*' + selector: + boolean: entity20: name: Button 20 (Optional) description: '* *Displayed on **"Button Page 3"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -774,6 +888,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity20_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button20"** action*' + selector: + boolean: entity21: name: Button 21 (Optional) description: '* *Displayed on **"Button Page 3"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -798,6 +918,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity21_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button21"** action*' + selector: + boolean: entity22: name: Button 22 (Optional) description: '* *Displayed on **"Button Page 3"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -822,6 +948,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity22_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button22"** action*' + selector: + boolean: entity23: name: Button 23 (Optional) description: '* *Displayed on **"Button Page 3"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -846,6 +978,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity23_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button23"** action*' + selector: + boolean: entity24: name: Button 24 (Optional) description: '* *Displayed on **"Button Page 3"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -870,6 +1008,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity24_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button24"** action*' + selector: + boolean: entity25: name: Button 25 (Optional) description: '* *Displayed on **"Button Page 4"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -894,6 +1038,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity25_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button25"** action*' + selector: + boolean: entity26: name: Button 26 (Optional) description: '* *Displayed on **"Button Page 4"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -918,6 +1068,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity26_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button26"** action*' + selector: + boolean: entity27: name: Button 27 (Optional) description: '* *Displayed on **"Button Page 4"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -942,6 +1098,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity27_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button27"** action*' + selector: + boolean: entity28: name: Button 28 (Optional) description: '* *Displayed on **"Button Page 4"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -966,6 +1128,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity28_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button28"** action*' + selector: + boolean: entity29: name: Button 29 (Optional) description: '* *Displayed on **"Button Page 4"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -990,6 +1158,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity29_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button29"** action*' + selector: + boolean: entity30: name: Button 30 (Optional) description: '* *Displayed on **"Button Page 4"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -1014,6 +1188,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity30_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button30"** action*' + selector: + boolean: entity31: name: Button 31 (Optional) description: '* *Displayed on **"Button Page 4"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -1038,6 +1218,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity31_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button31"** action*' + selector: + boolean: entity32: name: Button 32 (Optional) description: '* *Displayed on **"Button Page 4"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor)*' @@ -1062,6 +1248,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + entity32_confirm: + name: Confirm execution of the button press (Optional) + default: false + description: '* *Ask for confirmation to execute **"Button32"** action*' + selector: + boolean: mode: parallel max: 5000 @@ -1115,6 +1307,7 @@ variables: language: !input "language" notification_sound: "switch.{{ nspanel_name_trigger }}_notification_sound" + confirmation_message: "switch.{{ nspanel_name_trigger }}_confirmation_message" ##### PUSH TO NEXTION DISPLAY ##### command_text_printf: "esphome.{{ nspanel_name }}_send_command_text_printf" @@ -1608,6 +1801,33 @@ variables: {%- elif language == "HUN" -%} hő {%- elif language == "NOR" -%} varme {%- endif -%} + please_confirm_mui: >- + {%- if language == "DEU" -%} Bitte bestätigen + {%- elif language == "ENG" -%} Please confirm + {%- elif language == "BGR" -%} Please confirm + {%- elif language == "DNK" -%} Please confirm + {%- elif language == "EST" -%} Please confirm + {%- elif language == "FIN" -%} Please confirm + {%- elif language == "FRA" -%} Please confirm + {%- elif language == "GRC" -%} Please confirm + {%- elif language == "IDN" -%} Please confirm + {%- elif language == "ITA" -%} Please confirm + {%- elif language == "LVA" -%} Please confirm + {%- elif language == "LTU" -%} Please confirm + {%- elif language == "NLD" -%} Please confirm + {%- elif language == "POL" -%} Please confirm + {%- elif language == "PRT" -%} Please confirm + {%- elif language == "ROU" -%} Please confirm + {%- elif language == "SWE" -%} Please confirm + {%- elif language == "SVK" -%} Please confirm + {%- elif language == "SVN" -%} Please confirm + {%- elif language == "ESP" -%} Please confirm + {%- elif language == "CZE" -%} Please confirm + {%- elif language == "TUR" -%} Please confirm + {%- elif language == "UKR" -%} Please confirm + {%- elif language == "HUN" -%} Please confirm + {%- elif language == "NOR" -%} Please confirm + {%- endif -%} ##### FORCAST ACCUWEATHER - DAY 0 ##### @@ -1728,6 +1948,39 @@ variables: entity32: !input "entity32" entity32_name: !input "entity32_name" + entity01_confirm: !input "entity01_confirm" + entity02_confirm: !input "entity02_confirm" + entity03_confirm: !input "entity03_confirm" + entity04_confirm: !input "entity04_confirm" + entity05_confirm: !input "entity05_confirm" + entity06_confirm: !input "entity06_confirm" + entity07_confirm: !input "entity07_confirm" + entity08_confirm: !input "entity08_confirm" + entity09_confirm: !input "entity09_confirm" + entity10_confirm: !input "entity10_confirm" + entity11_confirm: !input "entity11_confirm" + entity12_confirm: !input "entity12_confirm" + entity13_confirm: !input "entity13_confirm" + entity14_confirm: !input "entity14_confirm" + entity15_confirm: !input "entity15_confirm" + entity16_confirm: !input "entity16_confirm" + entity17_confirm: !input "entity17_confirm" + entity18_confirm: !input "entity18_confirm" + entity19_confirm: !input "entity19_confirm" + entity20_confirm: !input "entity20_confirm" + entity21_confirm: !input "entity21_confirm" + entity22_confirm: !input "entity22_confirm" + entity23_confirm: !input "entity23_confirm" + entity24_confirm: !input "entity24_confirm" + entity25_confirm: !input "entity25_confirm" + entity26_confirm: !input "entity26_confirm" + entity27_confirm: !input "entity27_confirm" + entity28_confirm: !input "entity28_confirm" + entity29_confirm: !input "entity29_confirm" + entity30_confirm: !input "entity30_confirm" + entity31_confirm: !input "entity31_confirm" + entity32_confirm: !input "entity32_confirm" + ############################################################# ##### CLOSE - Variables ##### ############################################################# @@ -2713,6 +2966,8 @@ action: - conditions: - condition: trigger id: btn_notificationclearrelease + - condition: template + value_template: "{{ states(confirmation_message) != 'on'}} " sequence: - service: switch.turn_off data: @@ -2725,6 +2980,8 @@ action: - conditions: - condition: trigger id: btn_notificationacceptrelease + - condition: template + value_template: "{{ states(confirmation_message) != 'on'}} " sequence: - service: switch.turn_off data: @@ -3254,30 +3511,153 @@ action: {%- elif states(last_click) == "releasebuttonpage04button07" -%} {{ entity31 }} {%- elif states(last_click) == "releasebuttonpage04button08" -%} {{ entity32 }} {%- endif -%} + entity_confirm: >- + {%- if states(last_click) == "releasebuttonpage01button01" -%} {{ entity01_confirm }} + {%- elif states(last_click) == "releasebuttonpage01button02" -%} {{ entity02_confirm }} + {%- elif states(last_click) == "releasebuttonpage01button03" -%} {{ entity03_confirm }} + {%- elif states(last_click) == "releasebuttonpage01button04" -%} {{ entity04_confirm }} + {%- elif states(last_click) == "releasebuttonpage01button05" -%} {{ entity05_confirm }} + {%- elif states(last_click) == "releasebuttonpage01button06" -%} {{ entity06_confirm }} + {%- elif states(last_click) == "releasebuttonpage01button07" -%} {{ entity07_confirm }} + {%- elif states(last_click) == "releasebuttonpage01button08" -%} {{ entity08_confirm }} + {%- elif states(last_click) == "releasebuttonpage02button01" -%} {{ entity09_confirm }} + {%- elif states(last_click) == "releasebuttonpage02button02" -%} {{ entity10_confirm }} + {%- elif states(last_click) == "releasebuttonpage02button03" -%} {{ entity11_confirm }} + {%- elif states(last_click) == "releasebuttonpage02button04" -%} {{ entity12_confirm }} + {%- elif states(last_click) == "releasebuttonpage02button05" -%} {{ entity13_confirm }} + {%- elif states(last_click) == "releasebuttonpage02button06" -%} {{ entity14_confirm }} + {%- elif states(last_click) == "releasebuttonpage02button07" -%} {{ entity15_confirm }} + {%- elif states(last_click) == "releasebuttonpage02button08" -%} {{ entity16_confirm }} + {%- elif states(last_click) == "releasebuttonpage03button01" -%} {{ entity17_confirm }} + {%- elif states(last_click) == "releasebuttonpage03button02" -%} {{ entity18_confirm }} + {%- elif states(last_click) == "releasebuttonpage03button03" -%} {{ entity19_confirm }} + {%- elif states(last_click) == "releasebuttonpage03button04" -%} {{ entity20_confirm }} + {%- elif states(last_click) == "releasebuttonpage03button05" -%} {{ entity21_confirm }} + {%- elif states(last_click) == "releasebuttonpage03button06" -%} {{ entity22_confirm }} + {%- elif states(last_click) == "releasebuttonpage03button07" -%} {{ entity23_confirm }} + {%- elif states(last_click) == "releasebuttonpage03button08" -%} {{ entity24_confirm }} + {%- elif states(last_click) == "releasebuttonpage04button01" -%} {{ entity25_confirm }} + {%- elif states(last_click) == "releasebuttonpage04button02" -%} {{ entity26_confirm }} + {%- elif states(last_click) == "releasebuttonpage04button03" -%} {{ entity27_confirm }} + {%- elif states(last_click) == "releasebuttonpage04button04" -%} {{ entity28_confirm }} + {%- elif states(last_click) == "releasebuttonpage04button05" -%} {{ entity29_confirm }} + {%- elif states(last_click) == "releasebuttonpage04button06" -%} {{ entity30_confirm }} + {%- elif states(last_click) == "releasebuttonpage04button07" -%} {{ entity31_confirm }} + {%- elif states(last_click) == "releasebuttonpage04button08" -%} {{ entity32_confirm }} + {%- endif -%} - condition: template - value_template: '{{ entity_short is not match "person." and entity_short is not match "binary_sensor." }}' - - service: >- - {% if entity_short is match 'light.' %} - light.toggle - {% elif entity_short is match 'switch.' %} - switch.toggle - {% elif entity_short is match 'cover.' %} - cover.toggle - {% elif entity_short is match 'input_boolean.' %} - input_boolean.toggle - {% elif entity_short is match 'automation.' %} - automation.toggle - {% elif entity_short is match 'button.' %} - button.press - {% elif entity_short is match 'input_button.' %} - input_button.press - {% elif entity_short is match 'scene.' %} - scene.turn_on - {% elif entity_short is match 'script.' %} - script.turn_on - {% endif %} - data: - entity_id: "{{ entity_short }}" + value_template: '{{ entity_short is not match "person." and entity_short is not match "binary_sensor." }}' + - if: + - condition: template + #value_template: "{{ is_state(confirmation_message, 'on') }}" ####### TESTING ?? ########## - Replace with Confirm boolean for this entity + value_template: "{{ entity_confirm }}" + then: + - variables: + buttonpage: '{{ states(current_page) }}' + btn_entity_name: >- + {%- if state_attr(entity_short, "friendly_name") != None -%} {{ state_attr(entity_short, "friendly_name") }} + {%- elif state_attr(entity_short, "name") != None -%} {{ state_attr(entity_short, "name") }} + {%- else -%} "unknown" + {%- endif -%} + #### turn on switch confirmation_message + - service: switch.turn_on + data: + entity_id: '{{ confirmation_message }}' + - service: "{{ command_printf }}" + data: + cmd: "page {{ page_notification }}" + - service: "{{ command_text_printf }}" + data: + component: notification.notifi_text01 + message: "{{ btn_entity_name }}" + - delay: + milliseconds: "{{ delay_value }}" + - service: "{{ command_text_printf }}" + data: + component: notification.notifi_label + message: "{{ please_confirm_mui }}" + - wait_template: "{{ is_state(last_click, ['notificationacceptrelease','notificationclearrelease','homepage']) }}" + timeout: + seconds: 10 + continue_on_timeout: true + - choose: + - conditions: "{{ is_state(last_click, 'notificationacceptrelease') }}" + sequence: + - service: "{{ command_printf }}" + data: + cmd: "page {{ buttonpage }}" + - service: switch.turn_off + data: + entity_id: '{{ confirmation_message }}' + - service: >- + {% if entity_short is match 'light.' %} + light.toggle + {% elif entity_short is match 'switch.' %} + switch.toggle + {% elif entity_short is match 'cover.' %} + cover.toggle + {% elif entity_short is match 'input_boolean.' %} + input_boolean.toggle + {% elif entity_short is match 'automation.' %} + automation.toggle + {% elif entity_short is match 'button.' %} + button.press + {% elif entity_short is match 'input_button.' %} + input_button.press + {% elif entity_short is match 'scene.' %} + scene.turn_on + {% elif entity_short is match 'script.' %} + script.turn_on + {% endif %} + data: + entity_id: "{{ entity_short }}" + + - conditions: "{{ is_state(last_click, 'notificationclearrelease') }}" + sequence: + - service: "{{ command_printf }}" + data: + cmd: "page {{ buttonpage }}" + - service: switch.turn_off + data: + entity_id: '{{ confirmation_message }}' + + - conditions: "{{ is_state(last_click, 'homepage') }}" + sequence: + - service: switch.turn_off + data: + entity_id: '{{ confirmation_message }}' + + default: + - service: switch.turn_off + data: + entity_id: '{{ confirmation_message }}' + - service: "{{ command_printf }}" + data: + cmd: "page {{ page_home }}" + + else: + - service: >- + {% if entity_short is match 'light.' %} + light.toggle + {% elif entity_short is match 'switch.' %} + switch.toggle + {% elif entity_short is match 'cover.' %} + cover.toggle + {% elif entity_short is match 'input_boolean.' %} + input_boolean.toggle + {% elif entity_short is match 'automation.' %} + automation.toggle + {% elif entity_short is match 'button.' %} + button.press + {% elif entity_short is match 'input_button.' %} + input_button.press + {% elif entity_short is match 'scene.' %} + scene.turn_on + {% elif entity_short is match 'script.' %} + script.turn_on + {% endif %} + data: + entity_id: "{{ entity_short }}" ##### Page Button - LONG Press - JUMP to Page Lightsettings / Coversettings ##### diff --git a/nspanel_esphome.yaml b/nspanel_esphome.yaml index 53ffee0..d951b34 100644 --- a/nspanel_esphome.yaml +++ b/nspanel_esphome.yaml @@ -740,6 +740,14 @@ switch: restore_state: true optimistic: true + ##### Confirmation Message ##### + - platform: template + name: ${device_name} Confirmation Message + id: confirmation_message + entity_category: config + restore_state: false + optimistic: true + ##### UPDATE TFT DISPLAY ##### - platform: template name: ${device_name} Update TFT display