Skip to content

Instantly share code, notes, and snippets.

@Garywoo
Created August 1, 2026 03:11
Show Gist options
  • Select an option

  • Save Garywoo/e4e4bc8ab5c012eba482e0e203f334b3 to your computer and use it in GitHub Desktop.

Select an option

Save Garywoo/e4e4bc8ab5c012eba482e0e203f334b3 to your computer and use it in GitHub Desktop.
Home Assistant blueprint: Hue Dimmer Switch on a Hue bridge, with hold actions that fire while the button is held rather than on release. Fork of codycodes' Dec 2021 blueprint.
blueprint:
name: Hue Dimmer Remote (hold on long press)
description: >-
For a Philips Hue dimmer switch paired to a Hue bridge and surfaced in Home
Assistant through the Hue integration, using `hue` domain device triggers.
Short press slots fire on `short_release`, when you let go of a quick tap.
Hold slots fire on `long_press`, the moment the bridge recognises the hold,
while the button is still held down. The stock blueprint used
`long_release`, which only fires once you let go.
Button numbering: 1 = On, 2 = Brightness Up, 3 = Brightness Down, 4 = Off.
Fork of codycodes' December 2021 "Hue Dimmer Remote":
https://gist.github.com/codycodes/f051781c35cfdfee15162ff680c9cbd8
domain: automation
input:
dimmer_device:
name: Dimmer remote device
description: >-
Your Hue dimmer switch. It must be paired to a Hue bridge and visible
under the Hue integration.
selector:
device:
integration: hue
multiple: false
button_1_on:
name: Button 1 (On)
icon: mdi:lightbulb-on
collapsed: false
input:
on_short_action:
name: On, short press
description: Runs on `short_release` of button 1.
default: []
selector:
action: {}
on_long_action:
name: On, hold
description: Runs on `long_press` of button 1, while the button is held.
default: []
selector:
action: {}
button_2_brightness_up:
name: Button 2 (Brightness Up)
icon: mdi:brightness-7
collapsed: false
input:
brightness_up_short_action:
name: Brightness Up, short press
description: Runs on `short_release` of button 2.
default: []
selector:
action: {}
brightness_up_long_action:
name: Brightness Up, hold
description: Runs on `long_press` of button 2, while the button is held.
default: []
selector:
action: {}
button_3_brightness_down:
name: Button 3 (Brightness Down)
icon: mdi:brightness-5
collapsed: false
input:
brightness_down_short_action:
name: Brightness Down, short press
description: Runs on `short_release` of button 3.
default: []
selector:
action: {}
brightness_down_long_action:
name: Brightness Down, hold
description: Runs on `long_press` of button 3, while the button is held.
default: []
selector:
action: {}
button_4_off:
name: Button 4 (Off)
icon: mdi:lightbulb-off
collapsed: false
input:
off_short_action:
name: Off, short press
description: Runs on `short_release` of button 4.
default: []
selector:
action: {}
off_long_action:
name: Off, hold
description: Runs on `long_press` of button 4, while the button is held.
default: []
selector:
action: {}
mode: queued
max: 10
triggers:
- trigger: device
device_id: !input dimmer_device
domain: hue
type: short_release
subtype: 1
id: on short
- trigger: device
device_id: !input dimmer_device
domain: hue
type: long_press
subtype: 1
id: on long
- trigger: device
device_id: !input dimmer_device
domain: hue
type: short_release
subtype: 2
id: brightness up short
- trigger: device
device_id: !input dimmer_device
domain: hue
type: long_press
subtype: 2
id: brightness up long
- trigger: device
device_id: !input dimmer_device
domain: hue
type: short_release
subtype: 3
id: brightness down short
- trigger: device
device_id: !input dimmer_device
domain: hue
type: long_press
subtype: 3
id: brightness down long
- trigger: device
device_id: !input dimmer_device
domain: hue
type: short_release
subtype: 4
id: off short
- trigger: device
device_id: !input dimmer_device
domain: hue
type: long_press
subtype: 4
id: off long
conditions: []
actions:
- choose:
- conditions:
- condition: trigger
id: on short
sequence: !input on_short_action
- conditions:
- condition: trigger
id: on long
sequence: !input on_long_action
- conditions:
- condition: trigger
id: brightness up short
sequence: !input brightness_up_short_action
- conditions:
- condition: trigger
id: brightness up long
sequence: !input brightness_up_long_action
- conditions:
- condition: trigger
id: brightness down short
sequence: !input brightness_down_short_action
- conditions:
- condition: trigger
id: brightness down long
sequence: !input brightness_down_long_action
- conditions:
- condition: trigger
id: off short
sequence: !input off_short_action
- conditions:
- condition: trigger
id: off long
sequence: !input off_long_action
default:
- action: persistent_notification.create
data:
title: Uncaught Hue dimmer command
message: >-
The Hue dimmer blueprint received a button event it has no branch
for. Check the automation using this blueprint.
notification_id: hue_dimmer_blueprint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment