From ed5a341c1f09bbf31977f8bb05af684f26fc9230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dav=C3=AD=C3=B0=20Steinn=20Geirsson?= Date: Sat, 6 Sep 2025 01:04:42 +0000 Subject: [PATCH] Make off behaviour configurable --- hue_dimmer_zigbee2mqtt.yaml | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/hue_dimmer_zigbee2mqtt.yaml b/hue_dimmer_zigbee2mqtt.yaml index a0f4c7d..b4439f3 100644 --- a/hue_dimmer_zigbee2mqtt.yaml +++ b/hue_dimmer_zigbee2mqtt.yaml @@ -1,5 +1,5 @@ blueprint: - name: Philips Hue 929002398602 + Zigbee2MQTT + Light + name: Philips Hue Dimmer MQTT control config description: | # Requirements: - Philips Hue Dimmer Switch 929002398602 @@ -16,6 +16,20 @@ blueprint: name: Target MQTT Topic description: Target light (e.g., zigbee2mqtt/light_1/set) default: "zigbee2mqtt//set" + off_brightness: + name: off_brightness + description: Brightness to set when off button is pressed + selector: + number: + min: 0 + max: 254 + step: 1 + mode: slider + default: 0 + off_state: + name: off_state + description: State to set when off button is pressed + default: "OFF" move_rate: name: Brightness Move Rate [steps/s] @@ -42,6 +56,8 @@ blueprint: variables: move_rate: !input move_rate + off_brightness: !input off_brightness + off_state: !input off_state color_temp: !input color_temp color: !input color remote_topic: !input Remote_MQTT_Topic @@ -72,6 +88,22 @@ action: - conditions: - condition: template value_template: "{{ trigger.payload == 'off_press' }}" + sequence: + - service: mqtt.publish + data: + topic: "{{ target_topic }}" + payload: '{ "brightness": {{ off_brightness }} }' + qos: 0 + retain: false + - service: mqtt.publish + data: + topic: "{{ target_topic }}" + payload: '{ "state": "{{ off_state }}" }' + qos: 0 + retain: false + - conditions: + - condition: template + value_template: "{{ trigger.payload == 'off_hold' }}" # Long press sequence: - service: mqtt.publish data: @@ -82,7 +114,7 @@ action: - service: mqtt.publish data: topic: "{{ target_topic }}" - payload: '{ "state":"OFF" }' + payload: '{ "state": "OFF" }' qos: 0 retain: false - conditions: