Ignore small rotations within deadzone on Aqara dimmer

This commit is contained in:
mg committed 2026-09-01 21:26:45 +01:00
1 parent 08f7332b7e
commit 863f977ec0
1 file changed
+14
+14
View File
@@ -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 }}"