From 37cb7fb7f5ac795cd1fa52792a13e0ca6e58aacd Mon Sep 17 00:00:00 2001 From: vanseforge <59662590+vanseforge@users.noreply.github.com> Date: Sun, 6 Jul 2025 19:26:26 +0200 Subject: [PATCH 1/3] Switch to lock buttons --- home-assistant-voice.yaml | 53 +++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/home-assistant-voice.yaml b/home-assistant-voice.yaml index 639efcd2..849ffa97 100644 --- a/home-assistant-voice.yaml +++ b/home-assistant-voice.yaml @@ -195,6 +195,15 @@ switch: entity_category: config optimistic: true restore_mode: RESTORE_DEFAULT_ON + # Timer LED remaining time off switch + - platform: template + id: lock_buttons + name: Lock buttons + icon: "mdi:button-pointer" + entity_category: config + optimistic: true + restore_mode: RESTORE_DEFAULT_OFF + disabled_by_default: true # Internal switch to track when a timer is ringing on the device. - platform: template id: timer_ringing @@ -250,15 +259,23 @@ binary_sensor: number: GPIO0 inverted: true on_press: - - script.execute: control_leds + - if: + condition: + switch.is_off: lock_buttons + then: + - script.execute: control_leds on_release: - - script.execute: control_leds - # If a factory reset is requested, factory reset on release - - if: - condition: - lambda: return id(factory_reset_requested); - then: - - button.press: factory_reset_button + - if: + condition: + switch.is_off: lock_buttons + then: + - script.execute: control_leds + # If a factory reset is requested, factory reset on release + - if: + condition: + lambda: return id(factory_reset_requested); + then: + - button.press: factory_reset_button on_multi_click: # Simple Click: # - Abort "things" in order @@ -273,7 +290,7 @@ binary_sensor: then: - if: condition: - lambda: return !id(init_in_progress) && !id(color_changed); + lambda: return !id(init_in_progress) && !id(color_changed) && !id(lock_buttons).state; then: - if: condition: @@ -323,7 +340,7 @@ binary_sensor: then: - if: condition: - lambda: return !id(init_in_progress) && !id(color_changed); + lambda: return !id(init_in_progress) && !id(color_changed) && !id(lock_buttons).state; then: - script.execute: id: play_sound @@ -344,7 +361,7 @@ binary_sensor: then: - if: condition: - lambda: return !id(init_in_progress) && !id(color_changed); + lambda: return !id(init_in_progress) && !id(color_changed) && !id(lock_buttons).state; then: - script.execute: id: play_sound @@ -360,7 +377,7 @@ binary_sensor: then: - if: condition: - lambda: return !id(init_in_progress) && !id(color_changed); + lambda: return !id(init_in_progress) && !id(color_changed) && !id(lock_buttons).state; then: - script.execute: id: play_sound @@ -418,7 +435,7 @@ binary_sensor: then: - if: condition: - lambda: return !id(dial_touched); + lambda: return !id(dial_touched) && !id(lock_buttons).state; then: - light.turn_on: brightness: 100% @@ -447,7 +464,7 @@ binary_sensor: then: - if: condition: - lambda: return !id(dial_touched); + lambda: return !id(dial_touched) && !id(lock_buttons).state; then: - script.execute: id: play_sound @@ -939,7 +956,9 @@ sensor: - lambda: id(dial_touched) = true; - if: condition: - binary_sensor.is_off: center_button + and: + - binary_sensor.is_off: center_button + - switch.is_off: lock_buttons then: - script.execute: id: control_volume @@ -952,7 +971,9 @@ sensor: - lambda: id(dial_touched) = true; - if: condition: - binary_sensor.is_off: center_button + and: + - binary_sensor.is_off: center_button + - switch.is_off: lock_buttons then: - script.execute: id: control_volume From bffd2b884b960479228869c21b5b73a1fc54943b Mon Sep 17 00:00:00 2001 From: vanseforge <59662590+vanseforge@users.noreply.github.com> Date: Sun, 6 Jul 2025 19:39:15 +0200 Subject: [PATCH 2/3] correct indentation --- home-assistant-voice.yaml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/home-assistant-voice.yaml b/home-assistant-voice.yaml index 849ffa97..3c17dd8c 100644 --- a/home-assistant-voice.yaml +++ b/home-assistant-voice.yaml @@ -259,23 +259,23 @@ binary_sensor: number: GPIO0 inverted: true on_press: - - if: - condition: - switch.is_off: lock_buttons - then: - - script.execute: control_leds + - if: + condition: + switch.is_off: lock_buttons + then: + - script.execute: control_leds on_release: - - if: - condition: - switch.is_off: lock_buttons - then: - - script.execute: control_leds - # If a factory reset is requested, factory reset on release - - if: - condition: - lambda: return id(factory_reset_requested); - then: - - button.press: factory_reset_button + - if: + condition: + switch.is_off: lock_buttons + then: + - script.execute: control_leds + # If a factory reset is requested, factory reset on release + - if: + condition: + lambda: return id(factory_reset_requested); + then: + - button.press: factory_reset_button on_multi_click: # Simple Click: # - Abort "things" in order From 21d12afc808ab7c69dedcca7a6a9e7dfb916709c Mon Sep 17 00:00:00 2001 From: vanseforge <59662590+vanseforge@users.noreply.github.com> Date: Wed, 1 Oct 2025 18:52:04 +0200 Subject: [PATCH 3/3] factory reset still possible --- home-assistant-voice.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/home-assistant-voice.yaml b/home-assistant-voice.yaml index 52733f4f..b864696b 100644 --- a/home-assistant-voice.yaml +++ b/home-assistant-voice.yaml @@ -282,12 +282,12 @@ binary_sensor: switch.is_off: lock_buttons then: - script.execute: control_leds - # If a factory reset is requested, factory reset on release - - if: - condition: - lambda: return id(factory_reset_requested); - then: - - button.press: factory_reset_button + # If a factory reset is requested, factory reset on release + - if: + condition: + lambda: return id(factory_reset_requested); + then: + - button.press: factory_reset_button on_multi_click: # Simple Click: # - Abort "things" in order @@ -447,7 +447,7 @@ binary_sensor: then: - if: condition: - lambda: return !id(dial_touched) && !id(lock_buttons).state; + lambda: return !id(dial_touched); then: - light.turn_on: brightness: 100% @@ -476,7 +476,7 @@ binary_sensor: then: - if: condition: - lambda: return !id(dial_touched) && !id(lock_buttons).state; + lambda: return !id(dial_touched); then: - script.execute: id: play_sound