This is my take on using a Phillips Hue Dimmer Switch to control a single light entity.
It requires the manual creation of two input booleans prior to being imported/configured as a blueprint automation. An example of the 2 input booleans is provided below. Once those are added to your config.yaml and HA is restarted, you can configure an automation with the blueprint.
Please note that the dim function is currently hard coded to a “-10” step as my current attempts to invert the configured steps have been fruitless. I welcome any guidance/suggestions anyone has to rectify this.
Input booleans:
input_boolean:
media_room_brighten:
name: Brighten Media Room
icon: mdi:sun
media_room_dim:
name: Dim Media Room
icon: mdi:moon
Blueprint:
blueprint:
name: Hue Switch – Switch Multi-Flow (Device + Light + Booleans)
description: >
Combines toggle, hold-to-brighten/dim (with repeat), and instant bright/dim.
Select the MQTT device, the target light, and two input booleans.
domain: automation
input:
remote_device:
name: MQTT Button/Remote Device
description: The MQTT device that emits action events (on_press, up/down hold, etc.)
selector:
device:
integration: mqtt
light_entity:
name: Target Light
selector:
entity:
domain: light
brighten_boolean:
name: Brighten Boolean
selector:
entity:
domain: input_boolean
dim_boolean:
name: Dim Boolean
selector:
entity:
domain: input_boolean
step_size:
name: Brightness Step
description: Amount to change brightness each tick (positive for brighten, negative for dim path).
default: 10
selector:
number:
min: 1
max: 50
step: 1
mode: slider
tick_ms:
name: Repeat Interval (ms)
description: How often to apply the step while holding.
default: 500
selector:
number:
min: 100
max: 2000
step: 50
unit_of_measurement: ms
mode: parallel
max: 10
trigger:
# Button actions from the MQTT device
- id: toggle
platform: device
domain: mqtt
device_id: !input remote_device
type: action
subtype: on_press
- id: brighten_hold
platform: device
domain: mqtt
device_id: !input remote_device
type: action
subtype: up_hold
- id: brighten_release
platform: device
domain: mqtt
device_id: !input remote_device
type: action
subtype: up_hold_release
- id: dim_hold
platform: device
domain: mqtt
device_id: !input remote_device
type: action
subtype: down_hold
- id: dim_release
platform: device
domain: mqtt
device_id: !input remote_device
type: action
subtype: down_hold_release
- id: instant_bright
platform: device
domain: mqtt
device_id: !input remote_device
type: action
subtype: up_press_release
- id: instant_dim
platform: device
domain: mqtt
device_id: !input remote_device
type: action
subtype: down_press_release
# State triggers to start the repeat loops
- id: brighten_loop
platform: state
entity_id: !input brighten_boolean
to: 'on'
- id: dim_loop
platform: state
entity_id: !input dim_boolean
to: 'on'
action:
- choose:
# Toggle light
- conditions: "{{ trigger.id == 'toggle' }}"
sequence:
- service: light.toggle
target:
entity_id: !input light_entity
data:
transition: 1
# Hold to brighten: set boolean
- conditions: "{{ trigger.id == 'brighten_hold' }}"
sequence:
- service: input_boolean.turn_on
target:
entity_id: !input brighten_boolean
# Release brighten: unset booleans (mirrors your original behavior)
- conditions: "{{ trigger.id == 'brighten_release' }}"
sequence:
- service: input_boolean.turn_off
target:
entity_id:
- !input brighten_boolean
- !input dim_boolean
# Hold to dim: set boolean
- conditions: "{{ trigger.id == 'dim_hold' }}"
sequence:
- service: input_boolean.turn_on
target:
entity_id: !input dim_boolean
# Release dim: unset boolean
- conditions: "{{ trigger.id == 'dim_release' }}"
sequence:
- service: input_boolean.turn_off
target:
entity_id: !input dim_boolean
# Instant 100%
- conditions: "{{ trigger.id == 'instant_bright' }}"
sequence:
- service: light.turn_on
target:
entity_id: !input light_entity
data:
brightness_pct: 100
transition: 1
# Instant 5%
- conditions: "{{ trigger.id == 'instant_dim' }}"
sequence:
- service: light.turn_on
target:
entity_id: !input light_entity
data:
brightness_pct: 5
transition: 1
# Brighten loop while boolean stays on
- conditions: "{{ trigger.id == 'brighten_loop' }}"
sequence:
- repeat:
while:
- condition: state
entity_id: !input brighten_boolean
state: 'on'
sequence:
- service: light.turn_on
target:
entity_id: !input light_entity
data:
brightness_step: !input step_size
- delay:
milliseconds: !input tick_ms
# Dim loop while boolean stays on
- conditions: "{{ trigger.id == 'dim_loop' }}"
sequence:
- repeat:
while:
- condition: state
entity_id: !input dim_boolean
state: 'on'
sequence:
- service: light.turn_on
target:
entity_id: !input light_entity
data:
brightness_step: -10
- delay:
milliseconds: !input tick_ms