Skip to content

Instantly share code, notes, and snippets.

@LennartPl
Last active May 21, 2025 19:36
Show Gist options
  • Select an option

  • Save LennartPl/935df53406082d55fe9a73b583250d07 to your computer and use it in GitHub Desktop.

Select an option

Save LennartPl/935df53406082d55fe9a73b583250d07 to your computer and use it in GitHub Desktop.
Homeassistant Blueprint "Hue Dimmer Counter"
blueprint:
name: Hue Dimmer Counter
description: Debounces the Hue Dimmer events to enable click counters and fires an event with that counter as payload once the timeout is reached
domain: automation
input:
hue_dimmer_device_id:
name: Hue Dimmer
description: This is the Hue Dimmer device
selector:
device:
filter:
manufacturer: Philips
model: Hue dimmer switch
debounce_time:
name: Debounce time
description: Maximum time between two triggers before final event is fired
default: 500
selector:
number:
min: 0
max: 10000
unit_of_measurement: "ms"
helper_counter:
name: "[Helper] Internal click counter"
description: used in the automation to count clicks between the triggers
selector:
entity:
filter:
domain: counter
triggers:
- domain: mqtt
device_id: !input hue_dimmer_device_id
type: action
subtype: on_press_release
trigger: device
id: "1"
enabled: true
- domain: mqtt
device_id: !input hue_dimmer_device_id
type: action
subtype: up_press_release
trigger: device
id: "1"
- domain: mqtt
device_id: !input hue_dimmer_device_id
type: action
subtype: down_press_release
trigger: device
id: "1"
- domain: mqtt
device_id: !input hue_dimmer_device_id
type: action
subtype: off_press_release
trigger: device
id: "1"
- trigger: event
event_type: hue_dimmer_counter_event_internal
event_data: {}
id: event
conditions: []
actions:
- choose:
- conditions:
- condition: not
conditions:
- condition: trigger
id:
- event
sequence:
- action: counter.increment
metadata: {}
data: {}
target:
entity_id: counter.huedimmerclickcounter
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: !input debounce_time
- event: hue_dimmer_counter_event_internal
event_data:
payload: "{{trigger.payload}}"
- conditions:
- condition: trigger
id:
- event
sequence:
- event: hue_dimmer_debounced
event_data:
count: "{{ states('counter.huedimmerclickcounter') | int }}"
trigger: "{{ trigger.event.data.payload }}"
- action: counter.reset
metadata: {}
data: {}
target:
entity_id: counter.huedimmerclickcounter
mode: restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment