From 4523bdce439d7780371d73b42842b622c8d821f6 Mon Sep 17 00:00:00 2001 From: Matthew Grove Date: Sat, 26 Sep 2026 20:42:11 +0100 Subject: [PATCH] Increase default H2 EU dimmer deadzone and attempt fix for single presses being seen as stop_rotating actions --- aqara-h2-eu-dimmer-z2m-light-control.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/aqara-h2-eu-dimmer-z2m-light-control.yaml b/aqara-h2-eu-dimmer-z2m-light-control.yaml index 27b3e1c..1fe58dc 100644 --- a/aqara-h2-eu-dimmer-z2m-light-control.yaml +++ b/aqara-h2-eu-dimmer-z2m-light-control.yaml @@ -45,7 +45,7 @@ blueprint: rotation_deadzone: name: Rotation Deadzone (Anti-knock) description: The minimum rotation angle (in degrees) required to trigger a dimming action. Increase this if you accidentally dim the lights when clicking the knob. - default: 10 + default: 20 selector: number: min: 0 @@ -116,7 +116,14 @@ action: - variables: # Safely extract payload variables directly from the MQTT JSON message payload: "{{ trigger.payload_json if trigger.payload_json is defined else {} }}" - action_type: "{{ payload.action | default('') }}" + raw_action_type: "{{ payload.action | default('') }}" + rotation_button_state: "{{ payload.action_rotation_button_state | default('') }}" + action_type: > + {% if raw_action_type == 'stop_rotating' and rotation_button_state == 'pressed' %} + single + {% else %} + {{ raw_action_type }} + {% endif %} raw_angle: "{{ payload.action_rotation_angle | default(0) | float(0) }}" # Pull inputs into variables so they can be safely evaluated in templates below @@ -189,4 +196,4 @@ action: target: !input target_light data: brightness_step_pct: "{{ scaled_step }}" - transition: !input dim_transition + transition: !input dim_transition \ No newline at end of file