From 78d7969928caf9fcb73d4c3f2d63e0b1d3ad550e Mon Sep 17 00:00:00 2001 From: Olivier Bossaer Date: Wed, 9 Oct 2024 21:34:56 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Update=20volume=20level=20based=20o?= =?UTF-8?q?n=20alarm=20mode.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Volumes based on alarm mode - Alias armed_night to armed_home - Alias armed_vacation to armed_away - Refactor keypad automation actions to use "action" instead of "service" actions. --- keypad_blueprint.yaml | 82 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 70 insertions(+), 12 deletions(-) diff --git a/keypad_blueprint.yaml b/keypad_blueprint.yaml index 429853d..8d62b5d 100755 --- a/keypad_blueprint.yaml +++ b/keypad_blueprint.yaml @@ -35,8 +35,30 @@ blueprint: default: [] selector: action: + volume_normal: + name: Volume + description: Volume level for announcements on the keypad + default: 7 + selector: + number: + min: 0 + max: 10 + step: 1 + unit_of_measurement: "" + volume_night: + name: Night Mode Arm/Disarm Volume + description: Volume level for the keypad in Armed Night mode + default: 0 + selector: + number: + min: 0 + max: 10 + step: 1 + unit_of_measurement: "" variables: alarm: !input alarm + volume_night: !input volume_night + volume_normal: !input volume_normal mode: parallel max: 10 trace: @@ -113,10 +135,18 @@ trigger: entity_id: !input alarm to: armed_away id: alarm_armed_away + - platform: state + entity_id: !input alarm + to: armed_vacation + id: alarm_armed_away - platform: state entity_id: !input alarm to: armed_home id: alarm_armed_home + - platform: state + entity_id: !input alarm + to: armed_night + id: alarm_armed_home - platform: state entity_id: !input alarm to: pending @@ -138,7 +168,7 @@ action: - code_entered - keypad_disarm sequence: - - service: alarmo.disarm + - action: alarmo.disarm data: entity_id: !input alarm code: > @@ -158,7 +188,7 @@ action: entity_id: !input alarm state: disarmed sequence: - - service: alarmo.arm + - action: alarmo.arm data: entity_id: !input alarm mode: '{{ trigger.id.split("_")[2] }}' @@ -177,7 +207,7 @@ action: event_data: null timeout: '5' continue_on_timeout: false - - service: alarmo.arm + - action: alarmo.arm data: entity_id: !input alarm mode: '{{ trigger.id.split("_")[2] }}' @@ -191,7 +221,7 @@ action: id: - invalid_code sequence: - - service: zwave_js.set_value + - action: zwave_js.set_value target: device_id: !input keypad data: @@ -204,7 +234,7 @@ action: - condition: trigger id: need_bypass sequence: - - service: zwave_js.set_value + - action: zwave_js.set_value target: device_id: !input keypad data: @@ -217,7 +247,14 @@ action: - condition: trigger id: alarm_disarmed sequence: - - service: zwave_js.set_value + - action: zwave_js.set_config_parameter + target: + device_id: !input keypad + data: + endpoint: "0" + parameter: "4" + value: "{{ volume_normal if trigger.from_state.state != 'armed_night' else volume_night }}" + - action: zwave_js.set_value target: device_id: !input keypad data: @@ -226,11 +263,18 @@ action: property: "2" property_key: "1" value: 99 + - action: zwave_js.set_config_parameter + target: + device_id: !input keypad + data: + endpoint: "0" + parameter: "4" + value: "{{ volume_normal }}" - conditions: - condition: trigger id: alarm_armed_away sequence: - - service: zwave_js.set_value + - action: zwave_js.set_value target: device_id: !input keypad data: @@ -243,7 +287,14 @@ action: - condition: trigger id: alarm_armed_home sequence: - - service: zwave_js.set_value + - action: zwave_js.set_config_parameter + target: + device_id: !input keypad + data: + endpoint: "0" + parameter: "4" + value: "{{ volume_normal if trigger.to_state.state != 'armed_night' else volume_night }}" + - action: zwave_js.set_value target: device_id: !input keypad data: @@ -251,12 +302,19 @@ action: endpoint: "0" property: "10" property_key: "1" - value: 99 + value: 100 + - action: zwave_js.set_config_parameter + target: + device_id: !input keypad + data: + endpoint: "0" + parameter: "4" + value: "{{ volume_normal }}" - conditions: - condition: trigger id: alarm_arming sequence: - - service: zwave_js.set_value + - action: zwave_js.set_value target: device_id: !input keypad data: @@ -269,7 +327,7 @@ action: - condition: trigger id: alarm_pending sequence: - - service: zwave_js.set_value + - action: zwave_js.set_value target: device_id: !input keypad data: @@ -282,7 +340,7 @@ action: - condition: trigger id: alarm_triggered sequence: - - service: zwave_js.set_value + - action: zwave_js.set_value target: device_id: !input keypad data: