From 549a9787364b83dcf6f3658754b787fc9cbc8025 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 22 Dec 2022 13:56:10 +0100 Subject: [PATCH 1/3] fix: no exec on unavailable state --- nspanel_blueprint.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index 8794855..b6198a1 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -2240,6 +2240,8 @@ action: - current_state_entity30 - current_state_entity31 - current_state_entity32 + - condition: template + value_template: "{{ trigger.to_state.state != 'unavailable' }}" sequence: - alias: "Set variable(s) for entity change" variables: @@ -3298,6 +3300,8 @@ action: - conditions: - condition: trigger id: humidity_state + - condition: template + value_template: "{{ trigger.event.data.new_state.state != 'unavailable' }}" sequence: - service: "{{ command_text_printf }}" data: @@ -3309,6 +3313,8 @@ action: - conditions: - condition: trigger id: hotwatertemp_state + - condition: template + value_template: "{{ trigger.event.data.new_state.state != 'unavailable' }}" sequence: - service: "{{ command_text_printf }}" data: @@ -3331,6 +3337,8 @@ action: - conditions: - condition: trigger id: outdoortemp_state + - condition: template + value_template: "{{ trigger.event.data.new_state.state != 'unavailable' }}" sequence: - service: "{{ command_text_printf }}" data: @@ -3348,6 +3356,8 @@ action: - conditions: - condition: trigger id: weather_state_change + - condition: template + value_template: "{{ trigger.event.data.new_state.state != 'unavailable' }}" sequence: - if: - condition: template @@ -5018,6 +5028,8 @@ action: - conditions: - condition: trigger id: climate_state + - condition: template + value_template: "{{ trigger.event.data.new_state.state != 'unavailable' }}" # - condition: template # value_template: '{{ states(current_page) == page_climate }}' # - condition: template From a1e420e2cfa1e1a1181a4e98b2c10e8e1357b0be Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 22 Dec 2022 14:44:42 +0100 Subject: [PATCH 2/3] upd: add script domain for buttons --- nspanel_blueprint.yaml | 104 ++++++++++++++++++++++++++++------------- 1 file changed, 72 insertions(+), 32 deletions(-) diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index b6198a1..6946fab 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -238,7 +238,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l ##### BUTTONS ##### entity01: name: Button 01 (Optional) - description: '* *Displayed on **"Button Page 1"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 1"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -252,6 +252,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity01_name: name: Name "Button 01" (Optional) description: '* *Button label - 10 characters are supported*' @@ -260,7 +261,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity02: name: Button 02 (Optional) - description: '* *Displayed on **"Button Page 1"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 1"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -274,6 +275,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity02_name: name: Name "Button 02" (Optional) description: '* *Button label - 10 characters are supported*' @@ -282,7 +284,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity03: name: Button 03 (Optional) - description: '* *Displayed on **"Button Page 1"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 1"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -296,6 +298,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity03_name: name: Name "Button 03" (Optional) description: '* *Button label - 10 characters are supported*' @@ -304,7 +307,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity04: name: Button 04 (Optional) - description: '* *Displayed on **"Button Page 1"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 1"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -318,6 +321,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity04_name: name: Name "Button 04" (Optional) description: '* *Button label - 10 characters are supported*' @@ -326,7 +330,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity05: name: Button 05 (Optional) - description: '* *Displayed on **"Button Page 1"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 1"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -340,6 +344,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity05_name: name: Name "Button 05" (Optional) description: '* *Button label - 10 characters are supported*' @@ -348,7 +353,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity06: name: Button 06 (Optional) - description: '* *Displayed on **"Button Page 1"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 1"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -362,6 +367,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity06_name: name: Name "Button 06" (Optional) description: '* *Button label - 10 characters are supported*' @@ -370,7 +376,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity07: name: Button 07 (Optional) - description: '* *Displayed on **"Button Page 1"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 1"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -384,6 +390,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity07_name: name: Name "Button 07" (Optional) description: '* *Button label - 10 characters are supported*' @@ -392,7 +399,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity08: name: Button 08 (Optional) - description: '* *Displayed on **"Button Page 1"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 1"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -406,6 +413,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity08_name: name: Name "Button 08" (Optional) description: '* *Button label - 10 characters are supported*' @@ -414,7 +422,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity09: name: Button 09 (Optional) - description: '* *Displayed on **"Button Page 2"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 2"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -428,6 +436,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity09_name: name: Name "Button 09" (Optional) description: '* *Button label - 10 characters are supported*' @@ -436,7 +445,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity10: name: Button 10 (Optional) - description: '* *Displayed on **"Button Page 2"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 2"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -450,6 +459,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity10_name: name: Name "Button 10" (Optional) description: '* *Button label - 10 characters are supported*' @@ -458,7 +468,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity11: name: Button 11 (Optional) - description: '* *Displayed on **"Button Page 2"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 2"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -472,6 +482,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity11_name: name: Name "Button 11" (Optional) description: '* *Button label - 10 characters are supported*' @@ -480,7 +491,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity12: name: Button 12 (Optional) - description: '* *Displayed on **"Button Page 2"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 2"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -494,6 +505,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity12_name: name: Name "Button 12" (Optional) description: '* *Button label - 10 characters are supported*' @@ -502,7 +514,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity13: name: Button 13 (Optional) - description: '* *Displayed on **"Button Page 2"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 2"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -516,6 +528,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity13_name: name: Name "Button 13" (Optional) description: '* *Button label - 10 characters are supported*' @@ -524,7 +537,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity14: name: Button 14 (Optional) - description: '* *Displayed on **"Button Page 2"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 2"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -538,6 +551,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity14_name: name: Name "Button 14" (Optional) description: '* *Button label - 10 characters are supported*' @@ -546,7 +560,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity15: name: Button 15 (Optional) - description: '* *Displayed on **"Button Page 2"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 2"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -560,6 +574,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity15_name: name: Name "Button 15" (Optional) description: '* *Button label - 10 characters are supported*' @@ -568,7 +583,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity16: name: Button 16 (Optional) - description: '* *Displayed on **"Button Page 2"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 2"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -582,6 +597,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity16_name: name: Name "Button 16" (Optional) description: '* *Button label - 10 characters are supported*' @@ -590,7 +606,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity17: name: Button 17 (Optional) - description: '* *Displayed on **"Button Page 3"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 3"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -604,6 +620,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity17_name: name: Name "Button 17" (Optional) description: '* *Button label - 10 characters are supported*' @@ -612,7 +629,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity18: name: Button 18 (Optional) - description: '* *Displayed on **"Button Page 3"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 3"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -626,6 +643,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity18_name: name: Name "Button 18" (Optional) description: '* *Button label - 10 characters are supported*' @@ -634,7 +652,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity19: name: Button 19 (Optional) - description: '* *Displayed on **"Button Page 3"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 3"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -648,6 +666,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity19_name: name: Name "Button 19" (Optional) description: '* *Button label - 10 characters are supported*' @@ -656,7 +675,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity20: name: Button 20 (Optional) - description: '* *Displayed on **"Button Page 3"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 3"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -670,6 +689,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity20_name: name: Name "Button 20" (Optional) description: '* *Button label - 10 characters are supported*' @@ -678,7 +698,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity21: name: Button 21 (Optional) - description: '* *Displayed on **"Button Page 3"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 3"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -692,6 +712,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity21_name: name: Name "Button 21" (Optional) description: '* *Button label - 10 characters are supported*' @@ -700,7 +721,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity22: name: Button 22 (Optional) - description: '* *Displayed on **"Button Page 3"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 3"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -714,6 +735,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity22_name: name: Name "Button 22" (Optional) description: '* *Button label - 10 characters are supported*' @@ -722,7 +744,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity23: name: Button 23 (Optional) - description: '* *Displayed on **"Button Page 3"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 3"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -736,6 +758,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity23_name: name: Name "Button 23" (Optional) description: '* *Button label - 10 characters are supported*' @@ -744,7 +767,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity24: name: Button 24 (Optional) - description: '* *Displayed on **"Button Page 3"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 3"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -758,6 +781,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity24_name: name: Name "Button 24" (Optional) description: '* *Button label - 10 characters are supported*' @@ -766,7 +790,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity25: name: Button 25 (Optional) - description: '* *Displayed on **"Button Page 4"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 4"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -780,6 +804,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity25_name: name: Name "Button 25" (Optional) description: '* *Button label - 10 characters are supported*' @@ -788,7 +813,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity26: name: Button 26 (Optional) - description: '* *Displayed on **"Button Page 4"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 4"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -802,6 +827,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity26_name: name: Name "Button 26" (Optional) description: '* *Button label - 10 characters are supported*' @@ -810,7 +836,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity27: name: Button 27 (Optional) - description: '* *Displayed on **"Button Page 4"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 4"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -824,6 +850,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity27_name: name: Name "Button 27" (Optional) description: '* *Button label - 10 characters are supported*' @@ -832,7 +859,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity28: name: Button 28 (Optional) - description: '* *Displayed on **"Button Page 4"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 4"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -846,6 +873,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity28_name: name: Name "Button 28" (Optional) description: '* *Button label - 10 characters are supported*' @@ -854,7 +882,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity29: name: Button 29 (Optional) - description: '* *Displayed on **"Button Page 4"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 4"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -868,6 +896,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity29_name: name: Name "Button 29" (Optional) description: '* *Button label - 10 characters are supported*' @@ -876,7 +905,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity30: name: Button 30 (Optional) - description: '* *Displayed on **"Button Page 4"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 4"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -890,6 +919,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity30_name: name: Name "Button 30" (Optional) description: '* *Button label - 10 characters are supported*' @@ -898,7 +928,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity31: name: Button 31 (Optional) - description: '* *Displayed on **"Button Page 4"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 4"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -912,6 +942,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity31_name: name: Name "Button 31" (Optional) description: '* *Button label - 10 characters are supported*' @@ -920,7 +951,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l text: {} entity32: name: Button 32 (Optional) - description: '* *Displayed on **"Button Page 4"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person)*' + description: '* *Displayed on **"Button Page 4"** - (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script)*' default: [] selector: entity: @@ -934,6 +965,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - input_button - scene - person + - script entity32_name: name: Name "Button 32" (Optional) description: '* *Button label - 10 characters are supported*' @@ -1034,6 +1066,8 @@ variables: button_scene_on: "114" button_person_off: "111" button_person_on: "112" + button_script_off: "107" + button_script_on: "108" hardware_button_pic_off: "98" hardware_button_pic_on: "99" @@ -1907,6 +1941,8 @@ action: {%- elif repeat.item.entity is match "button." -%} {{ button_button_off }} {%- elif repeat.item.entity is match "input_button." -%} {{ button_button_off }} {%- elif repeat.item.entity is match "scene." -%} {{ button_scene_off }} + {%- elif repeat.item.entity is match "script." and states[repeat.item.entity].state == 'on' -%} {{ button_script_on }} + {%- elif repeat.item.entity is match "script." and states[repeat.item.entity].state == 'off' -%} {{ button_script_off }} {%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state == 'home' -%} {{ button_person_on }} {%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state != 'home' -%} {{ button_person_off }} {%- endif -%} @@ -2294,6 +2330,8 @@ action: {%- elif trigger.to_state.entity_id is match "button." -%} {{ button_button_on }} {%- elif trigger.to_state.entity_id is match "input_button." -%} {{ button_button_on }} {%- elif trigger.to_state.entity_id is match "scene." -%} {{ button_scene_on }} + {%- elif trigger.to_state.entity_id is match "script." and trigger.to_state.state == 'on' -%} {{ button_script_on }} + {%- elif trigger.to_state.entity_id is match "script." and trigger.to_state.state == 'off' -%} {{ button_script_off }} {%- elif trigger.to_state.entity_id is match "person." and trigger.to_state.state == 'home' -%} {{ button_person_on }} {%- elif trigger.to_state.entity_id is match "person." and trigger.to_state.state != 'home' -%} {{ button_person_off }} {%- endif -%} @@ -2727,6 +2765,8 @@ action: 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 }}" From 805317e865b01db3d13fe00d2f34c8bb8cd271c9 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 22 Dec 2022 14:59:24 +0100 Subject: [PATCH 3/3] upd: additional domains for hw-buttons --- nspanel_blueprint.yaml | 46 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index 6946fab..6b90bb2 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -182,6 +182,11 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - switch - input_boolean - cover + - automation + - button + - input_button + - scene + - script left_button_name: name: Name "Left Button" (Optional) description: '* *Left Button label - 10 characters are supported*' @@ -199,6 +204,11 @@ The goal was to create a version that allows everyone to use the NSpanel fully l - switch - input_boolean - cover + - automation + - button + - input_button + - scene + - script right_button_name: name: Name "Right Button" (Optional) description: '* *Right Button label - 10 characters are supported*' @@ -3245,13 +3255,23 @@ action: sequence: - service: >- {% if left_button_entity is match 'light.' %} - light.toggle + light.toggle {% elif left_button_entity is match 'switch.' %} - switch.toggle + switch.toggle {% elif left_button_entity is match 'cover.' %} - cover.toggle + cover.toggle {% elif left_button_entity is match 'input_boolean.' %} - input_boolean.toggle + input_boolean.toggle + {% elif left_button_entity is match 'automation.' %} + automation.toggle + {% elif left_button_entity is match 'button.' %} + button.press + {% elif left_button_entity is match 'input_button.' %} + input_button.press + {% elif left_button_entity is match 'scene.' %} + scene.turn_on + {% elif left_button_entity is match 'script.' %} + script.turn_on {% endif %} data: entity_id: "{{ left_button_entity }}" @@ -3286,13 +3306,23 @@ action: sequence: - service: >- {% if right_button_entity is match 'light.' %} - light.toggle + light.toggle {% elif right_button_entity is match 'switch.' %} - switch.toggle + switch.toggle {% elif right_button_entity is match 'cover.' %} - cover.toggle + cover.toggle {% elif right_button_entity is match 'input_boolean.' %} - input_boolean.toggle + input_boolean.toggle + {% elif right_button_entity is match 'automation.' %} + automation.toggle + {% elif right_button_entity is match 'button.' %} + button.press + {% elif right_button_entity is match 'input_button.' %} + input_button.press + {% elif right_button_entity is match 'scene.' %} + scene.turn_on + {% elif right_button_entity is match 'script.' %} + script.turn_on {% endif %} data: entity_id: "{{ right_button_entity }}"