diff --git a/blueprint.yaml b/blueprint.yaml index 497b3d6..7987924 100644 --- a/blueprint.yaml +++ b/blueprint.yaml @@ -894,97 +894,97 @@ trigger: id: tft_upload #### NSPanel boot Step 0 - Start #### nextion_inited_trigger - # - platform: state - # entity_id: !input "nextion_inited" - # to: "on" - # id: nspanel_boot_start + # - platform: state + # entity_id: !input "nextion_inited" + # to: "on" + # id: nspanel_boot_start - platform: template value_template: '{{ states(nextion_inited_trigger) is match "on" }}' id: nspanel_boot_start #### NSPanel boot Step 1 - Language #### - # - platform: state - # entity_id: !input "nextion_inited" - # to: "on" - # for: - # seconds: 5 + # - platform: state + # entity_id: !input "nextion_inited" + # to: "on" + # for: + # seconds: 5 - platform: template value_template: '{{ states(nextion_inited_trigger) is match "on" }}' for: "00:00:5" id: nspanel_boot_language #### NSPanel boot Step 2 - Buttonpage 1 #### - # - platform: state - # entity_id: !input "nextion_inited" - # to: "on" - # for: - # seconds: 10 + # - platform: state + # entity_id: !input "nextion_inited" + # to: "on" + # for: + # seconds: 10 - platform: template value_template: '{{ states(nextion_inited_trigger) is match "on" }}' for: "00:00:10" id: nspanel_boot_buttonpage01 #### NSPanel boot Step 3 - Buttonpage 2 #### - # - platform: state - # entity_id: !input "nextion_inited" - # to: "on" - # for: - # seconds: 15 + # - platform: state + # entity_id: !input "nextion_inited" + # to: "on" + # for: + # seconds: 15 - platform: template value_template: '{{ states(nextion_inited_trigger) is match "on" }}' for: "00:00:15" id: nspanel_boot_buttonpage02 #### NSPanel boot Step 4 - Buttonpage 3 #### - # - platform: state - # entity_id: !input "nextion_inited" - # to: "on" - # for: - # seconds: 20 + # - platform: state + # entity_id: !input "nextion_inited" + # to: "on" + # for: + # seconds: 20 - platform: template value_template: '{{ states(nextion_inited_trigger) is match "on" }}' for: "00:00:20" id: nspanel_boot_buttonpage03 #### NSPanel boot Step 5 - Buttonpage 4 #### - # - platform: state - # entity_id: !input "nextion_inited" - # to: "on" - # for: - # seconds: 25 + # - platform: state + # entity_id: !input "nextion_inited" + # to: "on" + # for: + # seconds: 25 - platform: template value_template: '{{ states(nextion_inited_trigger) is match "on" }}' for: "00:00:25" id: nspanel_boot_buttonpage04 #### NSPanel boot Step 6 - Weather #### - # - platform: state - # entity_id: !input "nextion_inited" - # to: "on" - # for: - # seconds: 30 + # - platform: state + # entity_id: !input "nextion_inited" + # to: "on" + # for: + # seconds: 30 - platform: template value_template: '{{ states(nextion_inited_trigger) is match "on" }}' for: "00:00:30" id: nspanel_boot_weather #### NSPanel boot Step 7 - Entities #### - # - platform: state - # entity_id: !input "nextion_inited" - # to: "on" - # for: - # seconds: 35 + # - platform: state + # entity_id: !input "nextion_inited" + # to: "on" + # for: + # seconds: 35 - platform: template value_template: '{{ states(nextion_inited_trigger) is match "on" }}' for: "00:00:35" id: nspanel_boot_entities #### NSPanel boot Step 8 - Entities #### - # - platform: state - # entity_id: !input "nextion_inited" - # to: "on" - # for: - # seconds: 50 + # - platform: state + # entity_id: !input "nextion_inited" + # to: "on" + # for: + # seconds: 50 - platform: template value_template: '{{ states(nextion_inited_trigger) is match "on" }}' for: "00:00:50" @@ -1074,166 +1074,201 @@ trigger: id: right_button_press ##### Button Sync Trigger ################################################################################################################# - - ##### Button01 Sync - Trigger ##### - platform: state - entity_id: !input "entity01" - id: current_state_entity01 + entity_id: + - !input 'entity01' + - !input 'entity02' + - !input 'entity03' + - !input 'entity04' + - !input 'entity05' + - !input 'entity06' + - !input 'entity07' + - !input 'entity08' + - !input 'entity09' + - !input 'entity10' + - !input 'entity11' + - !input 'entity12' + - !input 'entity13' + - !input 'entity14' + - !input 'entity15' + - !input 'entity16' + - !input 'entity17' + - !input 'entity18' + - !input 'entity19' + - !input 'entity20' + - !input 'entity21' + - !input 'entity22' + - !input 'entity23' + - !input 'entity24' + - !input 'entity25' + - !input 'entity26' + - !input 'entity27' + - !input 'entity28' + - !input 'entity29' + - !input 'entity30' + - !input 'entity31' + - !input 'entity32' + id: state_change_of_entity - ##### Button02 Sync - Trigger ##### - - platform: state - entity_id: !input "entity02" - id: current_state_entity02 + # ##### Button01 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity01" + # id: current_state_entity01 - ##### Button03 Sync - Trigger ##### - - platform: state - entity_id: !input "entity03" - id: current_state_entity03 + # ##### Button02 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity02" + # id: current_state_entity02 - ##### Button04 Sync - Trigger ##### - - platform: state - entity_id: !input "entity04" - id: current_state_entity04 + # ##### Button03 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity03" + # id: current_state_entity03 - ##### Button05 Sync - Trigger ##### - - platform: state - entity_id: !input "entity05" - id: current_state_entity05 + # ##### Button04 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity04" + # id: current_state_entity04 - ##### Button06 Sync - Trigger ##### - - platform: state - entity_id: !input "entity06" - id: current_state_entity06 + # ##### Button05 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity05" + # id: current_state_entity05 - ##### Button07 Sync - Trigger ##### - - platform: state - entity_id: !input "entity07" - id: current_state_entity07 + # ##### Button06 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity06" + # id: current_state_entity06 - ##### Button08 Sync - Trigger ##### - - platform: state - entity_id: !input "entity08" - id: current_state_entity08 + # ##### Button07 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity07" + # id: current_state_entity07 - ##### Button09 Sync - Trigger ##### - - platform: state - entity_id: !input "entity09" - id: current_state_entity09 + # ##### Button08 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity08" + # id: current_state_entity08 - ##### Button10 Sync - Trigger ##### - - platform: state - entity_id: !input "entity10" - id: current_state_entity10 + # ##### Button09 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity09" + # id: current_state_entity09 - ##### Button11 Sync - Trigger ##### - - platform: state - entity_id: !input "entity11" - id: current_state_entity11 + # ##### Button10 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity10" + # id: current_state_entity10 - ##### Button12 Sync - Trigger ##### - - platform: state - entity_id: !input "entity12" - id: current_state_entity12 + # ##### Button11 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity11" + # id: current_state_entity11 - ##### Button13 Sync - Trigger ##### - - platform: state - entity_id: !input "entity13" - id: current_state_entity13 + # ##### Button12 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity12" + # id: current_state_entity12 - ##### Button14 Sync - Trigger ##### - - platform: state - entity_id: !input "entity14" - id: current_state_entity14 + # ##### Button13 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity13" + # id: current_state_entity13 - ##### Button15 Sync - Trigger ##### - - platform: state - entity_id: !input "entity15" - id: current_state_entity15 + # ##### Button14 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity14" + # id: current_state_entity14 - ##### Button16 Sync - Trigger ##### - - platform: state - entity_id: !input "entity16" - id: current_state_entity16 + # ##### Button15 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity15" + # id: current_state_entity15 - ##### Button17 Sync - Trigger ##### - - platform: state - entity_id: !input "entity17" - id: current_state_entity17 + # ##### Button16 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity16" + # id: current_state_entity16 - ##### Button18 Sync - Trigger ##### - - platform: state - entity_id: !input "entity18" - id: current_state_entity18 + # ##### Button17 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity17" + # id: current_state_entity17 - ##### Button19 Sync - Trigger ##### - - platform: state - entity_id: !input "entity19" - id: current_state_entity19 + # ##### Button18 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity18" + # id: current_state_entity18 - ##### Button20 Sync - Trigger ##### - - platform: state - entity_id: !input "entity20" - id: current_state_entity20 + # ##### Button19 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity19" + # id: current_state_entity19 - ##### Button21 Sync - Trigger ##### - - platform: state - entity_id: !input "entity21" - id: current_state_entity21 + # ##### Button20 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity20" + # id: current_state_entity20 - ##### Button22 Sync - Trigger ##### - - platform: state - entity_id: !input "entity22" - id: current_state_entity22 + # ##### Button21 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity21" + # id: current_state_entity21 - ##### Button23 Sync - Trigger ##### - - platform: state - entity_id: !input "entity23" - id: current_state_entity23 + # ##### Button22 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity22" + # id: current_state_entity22 - ##### Button24 Sync - Trigger ##### - - platform: state - entity_id: !input "entity24" - id: current_state_entity24 + # ##### Button23 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity23" + # id: current_state_entity23 - ##### Button25 Sync - Trigger ##### - - platform: state - entity_id: !input "entity25" - id: current_state_entity25 + # ##### Button24 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity24" + # id: current_state_entity24 - ##### Button26 Sync - Trigger ##### - - platform: state - entity_id: !input "entity26" - id: current_state_entity26 + # ##### Button25 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity25" + # id: current_state_entity25 - ##### Button27 Sync - Trigger ##### - - platform: state - entity_id: !input "entity27" - id: current_state_entity27 + # ##### Button26 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity26" + # id: current_state_entity26 - ##### Button28 Sync - Trigger ##### - - platform: state - entity_id: !input "entity28" - id: current_state_entity28 + # ##### Button27 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity27" + # id: current_state_entity27 - ##### Button29 Sync - Trigger ##### - - platform: state - entity_id: !input "entity29" - id: current_state_entity29 + # ##### Button28 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity28" + # id: current_state_entity28 - ##### Button30 Sync - Trigger ##### - - platform: state - entity_id: !input "entity30" - id: current_state_entity30 + # ##### Button29 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity29" + # id: current_state_entity29 - ##### Button31 Sync - Trigger ##### - - platform: state - entity_id: !input "entity31" - id: current_state_entity31 + # ##### Button30 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity30" + # id: current_state_entity30 - ##### Button32 Sync - Trigger ##### - - platform: state - entity_id: !input "entity32" - id: current_state_entity32 + # ##### Button31 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity31" + # id: current_state_entity31 + + # ##### Button32 Sync - Trigger ##### + # - platform: state + # entity_id: !input "entity32" + # id: current_state_entity32 ######################################### # @@ -1402,6 +1437,149 @@ action: ######################################################################################################################## + # main - alias: "choose alias (name)" + - choose: + #### Update button on entity state_change #### + - conditions: + - condition: trigger + id: state_change_of_entity + sequence: + - alias: "Set variable(s) for entity change" + variables: + component_to_update: >- + {%- if trigger.entity_id == entity01 -%} buttonpage01.button01 + {%- elif trigger.entity_id == entity02 -%} buttonpage01.button02 + {%- elif trigger.entity_id == entity03 -%} buttonpage01.button03 + {%- elif trigger.entity_id == entity04 -%} buttonpage01.button04 + {%- elif trigger.entity_id == entity05 -%} buttonpage01.button05 + {%- elif trigger.entity_id == entity06 -%} buttonpage01.button06 + {%- elif trigger.entity_id == entity07 -%} buttonpage01.button07 + {%- elif trigger.entity_id == entity08 -%} buttonpage01.button08 + {%- elif trigger.entity_id == entity09 -%} buttonpage02.button01 + {%- elif trigger.entity_id == entity10 -%} buttonpage02.button02 + {%- elif trigger.entity_id == entity11 -%} buttonpage02.button03 + {%- elif trigger.entity_id == entity12 -%} buttonpage02.button04 + {%- elif trigger.entity_id == entity13 -%} buttonpage02.button05 + {%- elif trigger.entity_id == entity14 -%} buttonpage02.button06 + {%- elif trigger.entity_id == entity15 -%} buttonpage02.button07 + {%- elif trigger.entity_id == entity16 -%} buttonpage02.button08 + {%- elif trigger.entity_id == entity17 -%} buttonpage03.button01 + {%- elif trigger.entity_id == entity18 -%} buttonpage03.button02 + {%- elif trigger.entity_id == entity19 -%} buttonpage03.button03 + {%- elif trigger.entity_id == entity20 -%} buttonpage03.button04 + {%- elif trigger.entity_id == entity21 -%} buttonpage03.button05 + {%- elif trigger.entity_id == entity22 -%} buttonpage03.button06 + {%- elif trigger.entity_id == entity23 -%} buttonpage03.button07 + {%- elif trigger.entity_id == entity24 -%} buttonpage03.button08 + {%- elif trigger.entity_id == entity25 -%} buttonpage04.button01 + {%- elif trigger.entity_id == entity26 -%} buttonpage04.button02 + {%- elif trigger.entity_id == entity27 -%} buttonpage04.button03 + {%- elif trigger.entity_id == entity28 -%} buttonpage04.button04 + {%- elif trigger.entity_id == entity29 -%} buttonpage04.button05 + {%- elif trigger.entity_id == entity30 -%} buttonpage04.button06 + {%- elif trigger.entity_id == entity31 -%} buttonpage04.button07 + {%- elif trigger.entity_id == entity32 -%} buttonpage04.button08 + {%- endif -%} + # Button PIC + btn_pic: >- + {%- if trigger.to_state.entity_id is match "light." and trigger.to_state.state == 'on' -%} {{ button_light_on }} + {%- elif trigger.to_state.entity_id is match "light." and trigger.to_state.state == 'off' -%} {{ button_light_off }} + {%- elif trigger.to_state.entity_id is match "switch." and trigger.to_state.state == 'on' -%} {{ button_switch_on }} + {%- elif trigger.to_state.entity_id is match "switch." and trigger.to_state.state == 'off' -%} {{ button_switch_off }} + {%- elif trigger.to_state.entity_id is match "input_boolean." and trigger.to_state.state == 'on' -%} {{ button_switch_on }} + {%- elif trigger.to_state.entity_id is match "input_boolean." and trigger.to_state.state == 'off' -%} {{ button_switch_off }} + {%- elif trigger.to_state.entity_id is match "cover." and trigger.to_state.state == 'on' -%} {{ button_cover_on }} + {%- elif trigger.to_state.entity_id is match "cover." and trigger.to_state.state == 'off' -%} {{ button_cover_off }} + {%- endif -%} + # TEXT and BRIGHTNESS Background + btn_bg: >- + {%- if trigger.to_state.state == 'on' or trigger.to_state.state == 'open' -%} {{ button_color_1 }} + {%- elif trigger.to_state.state == 'off' or trigger.to_state.state == 'closed' -%} {{ button_color_2 }} + {%- endif -%} + # TEXT Font + btn_txt_font: >- + {%- if trigger.to_state.state == 'on' or trigger.to_state.state == 'open' -%} {{ button_color_2 }} + {%- elif trigger.to_state.state == 'off' or trigger.to_state.state == 'closed' -%} {{ button_color_1 }} + {%- endif -%} + # BRIGHTNESS Font + btn_bri_font: "{{ button_color_2 }}" + # BTN Label + btn_label: >- + {%- if trigger.entity_id == entity01 -%} {{ entity01_name }} + {%- elif trigger.entity_id == entity02 -%} {{ entity02_name }} + {%- elif trigger.entity_id == entity03 -%} {{ entity03_name }} + {%- elif trigger.entity_id == entity04 -%} {{ entity04_name }} + {%- elif trigger.entity_id == entity05 -%} {{ entity05_name }} + {%- elif trigger.entity_id == entity06 -%} {{ entity06_name }} + {%- elif trigger.entity_id == entity07 -%} {{ entity07_name }} + {%- elif trigger.entity_id == entity08 -%} {{ entity08_name }} + {%- elif trigger.entity_id == entity09 -%} {{ entity09_name }} + {%- elif trigger.entity_id == entity10 -%} {{ entity10_name }} + {%- elif trigger.entity_id == entity11 -%} {{ entity11_name }} + {%- elif trigger.entity_id == entity12 -%} {{ entity12_name }} + {%- elif trigger.entity_id == entity13 -%} {{ entity13_name }} + {%- elif trigger.entity_id == entity14 -%} {{ entity14_name }} + {%- elif trigger.entity_id == entity15 -%} {{ entity15_name }} + {%- elif trigger.entity_id == entity16 -%} {{ entity16_name }} + {%- elif trigger.entity_id == entity17 -%} {{ entity17_name }} + {%- elif trigger.entity_id == entity18 -%} {{ entity18_name }} + {%- elif trigger.entity_id == entity19 -%} {{ entity19_name }} + {%- elif trigger.entity_id == entity20 -%} {{ entity20_name }} + {%- elif trigger.entity_id == entity21 -%} {{ entity21_name }} + {%- elif trigger.entity_id == entity22 -%} {{ entity22_name }} + {%- elif trigger.entity_id == entity23 -%} {{ entity23_name }} + {%- elif trigger.entity_id == entity24 -%} {{ entity24_name }} + {%- elif trigger.entity_id == entity25 -%} {{ entity25_name }} + {%- elif trigger.entity_id == entity26 -%} {{ entity26_name }} + {%- elif trigger.entity_id == entity27 -%} {{ entity27_name }} + {%- elif trigger.entity_id == entity28 -%} {{ entity28_name }} + {%- elif trigger.entity_id == entity29 -%} {{ entity29_name }} + {%- elif trigger.entity_id == entity30 -%} {{ entity30_name }} + {%- elif trigger.entity_id == entity31 -%} {{ entity31_name }} + {%- elif trigger.entity_id == entity32 -%} {{ entity32_name }} + {%- endif -%} + btn_bri_txt: >- + {%- if trigger.to_state.entity_id is match "light." and trigger.to_state.state == 'on' -%} {{ trigger.to_state.attributes.brightness | int * 100 /254 | round(0) }}% + {%- elif trigger.to_state.entity_id is match "cover." and trigger.to_state.state == 'open' -%} {{ trigger.to_state.attributes.current_position | int | round(0) }}% + {%- else -%} " " + {%- endif -%} + + ##### Button PIC ##### + - service: "{{ command_printf }}" + data: + cmd: "{{ component_to_update }}pic.pic={{ btn_pic }}" + ##### TEXT Background ##### + - service: "{{ command_background_color }}" + data: + component: "{{ component_to_update }}text" + message: "{{ btn_bg }}" + ##### TEXT Font Color ##### + - service: "{{ command_font_color }}" + data: + component: "{{ component_to_update }}text" + message: "{{ btn_txt_font }}" + ##### BRIGHTNESS Background Color ##### + - service: "{{ command_background_color }}" + data: + component: "{{ component_to_update }}bri" + message: "{{ btn_bg }}" + ##### BRIGHTNESS Font Color ##### + - service: "{{ command_font_color }}" + data: + component: "{{ component_to_update }}bri" + message: "{{ btn_bri_font }}" + ##### "TEXT" Label ##### + - service: "{{ command_text_printf }}" + data: + component: "{{ component_to_update }}text" + message: "{{ btn_label }}" + ##### "BRIGHTNESS" Text ##### + - service: "{{ command_text_printf }}" + data: + component: "{{ component_to_update }}bri" + message: "{{ btn_bri_txt }}" + + ##### NSPanel Loading##### - choose: - conditions: