diff --git a/aqara-h2-eu-dimmer-z2m-light-control.yaml b/aqara-h2-eu-dimmer-z2m-light-control.yaml index 068525f..27b3e1c 100644 --- a/aqara-h2-eu-dimmer-z2m-light-control.yaml +++ b/aqara-h2-eu-dimmer-z2m-light-control.yaml @@ -41,6 +41,16 @@ blueprint: min: 0.05 max: 2.0 step: 0.05 + + 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 + selector: + number: + min: 0 + max: 45 + step: 1 invert_rotation: name: Invert Rotation @@ -113,6 +123,7 @@ action: sens: !input rotation_sensitivity invert: !input invert_rotation enable_toggle: !input enable_default_single_press + deadzone: !input rotation_deadzone # Calculate the final brightness step dynamically based on the rotation direction scaled_step: > @@ -168,6 +179,9 @@ action: - condition: template value_template: "{{ action_type == 'rotation' }}" sequence: + # Filter out accidental micro-rotations (knocks) below the deadzone + - condition: template + value_template: "{{ (raw_angle | abs) >= (deadzone | float(0)) }}" # Only fire the turn_on service if there was a registrable angle change - condition: template value_template: "{{ scaled_step != 0 }}"