Hue Dimmer Remote blueprint that allows you to assign actions to the default exposed button methods attached to the device on Home Assistant using hue_event
, including:
- Long Press (or just “hold”?)
- Short Press
There is no logic included for detecting other button presses, but below a fellow contributor added support for the repeat
event; this blueprint’s purpose is to make it easier to just select your Hue Remote and the actions you want for each of the buttons for each of the behaviors (making for 8 assignable behaviors, four short and four long, total!)
NOTE: This blueprint probably won’t work for pre-December 2021 versions of Home Assistant due to the
event_data
changing; this blueprint is targeted to the new Home Assistant release (December 2021) and fixes an issue to restore previous functionality (read below if you’re interested in learning more).
UPDATE May 19th, 2022: just got an RWL022 remote and was able to successfully use this blueprint to configure its actions without any modifications . @ppyrrhula says that RWL021 is also working.
Backstory: After upgrading to the final release of 2021 I learned that my Hue dimmer remote wasn’t working anymore, and actually, my automations would no longer reload due to the following error:
Invalid config for [automation]: expected int for dictionary value @ data['subtype']. Got None.
! I remembered that this was something that may’ve been a breaking change, and after fixing the issue for myself and seeing some others with the issue decided this would be a great blueprint to make and ship, for others as well as myself!
blueprint:
name: Hue Dimmer Remote
description: |
(Dec 2021 Update) Using a Hue bridge with which a dimmer remote is paired, allows you to configure actions based on said Hue Dimmer Remote
NOTE: tested with RWL020 and RWL022, but community says it also works with RWL021!
domain: automation
source_url: https://gist.github.com/codycodes/f051781c35cfdfee15162ff680c9cbd8
input:
dimmer_device:
name: Dimmer Remote Device
description: "Your Hue dimmer remote (e.g. RWL020); check Hue integration and/or Hue app if you don't know the name"
selector:
device:
integration: hue
on_short_action:
name: On Short Press Action
description: Action to perform after pressing ON shortly
default: []
selector:
action:
on_long_action:
name: On Long Press Action
description: Action to perform after pressing ON for a long period
default: []
selector:
action:
brightness_up_short_action:
name: Brightness Up Short Press Action
description: Action to perform after pressing brightness up shortly
default: []
selector:
action:
brightness_up_long_action:
name: Brightness Up Long Press Action
description: Action to perform after pressing brightness up for a long period
default: []
selector:
action:
brightness_down_short_action:
name: Brightness Down Short Press Action
description: Action to perform after pressing brightness down shortly
default: []
selector:
action:
brightness_down_long_action:
name: Brightness Down Long Press Action
description: Action to perform after pressing brightness down for a long period
default: []
selector:
action:
off_short_action:
name: Off Short Press Action
description: Action to perform after pressing OFF shortly
default: []
selector:
action:
off_long_action:
name: Off Long Press Action
description: Action to perform after pressing OFF for a long period
default: []
selector:
action:
mode: single
trigger:
- device_id: !input dimmer_device
domain: hue
platform: device
type: short_release
subtype: 1
id: on short
- device_id: !input dimmer_device
domain: hue
platform: device
type: long_release
subtype: 1
id: on long
- device_id: !input dimmer_device
domain: hue
platform: device
type: short_release
subtype: 2
id: brightness up short
- device_id: !input dimmer_device
domain: hue
platform: device
type: long_release
subtype: 2
id: brightness up long
- device_id: !input dimmer_device
domain: hue
platform: device
type: short_release
subtype: 3
id: brightness down short
- device_id: !input dimmer_device
domain: hue
platform: device
type: long_release
subtype: 3
id: brightness down long
- device_id: !input dimmer_device
domain: hue
platform: device
type: short_release
subtype: 4
id: off short
- device_id: !input dimmer_device
domain: hue
platform: device
type: long_release
subtype: 4
id: off long
condition: []
action:
- 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:
- service: persistent_notification.create
data:
message:
Hue dimmer ran default event from "choose" action on button press!
Please check any automations which may not be handling this event!
notification_id: hue_dimmer_blueprint
title: Uncaught Dimmer Command
Tips & Tricks
Utilize automations created from both the regular short/long press blueprint as well as the repeat
action one
Inside of either the UI or YAML editor, actions within automations can be disabled on an ad-hoc basis. What this means is that for me when the long press repeat
blueprint was added by a fellow poster here, I only needed to override those long press repeat actions on the new automation, and could use the old automation’s actions and simply disable the hold actions while still being able to leverage the short press ones. This allows you to
- reduce how much code was written initially
- reduce how much code will be written and have both options easily toggle-able
If you decide that repeat actions aren’t for you, then you can simply re-enable the functionality for the original automation for hold actions and re-enable the long press actions as needed without needing to create new automations.
Troubleshooting
Blueprint not working? Using a fresh Hue starter kit including a remote? @aki1987 discovered that after purchasing a Hue starter kit (one in which the remote was already paired with the hub) the Hue integration discovered the device/accessory but hue_event
s were not being read from the hub. The remote was working, however, in the Hue app. In this case the easiest solution was to go into the Hue app, remove the remote, and then add it back as an accessory. Reload the Hue integration or restart Home Assistant and the automations should work
Additionally, I want to give a shoutout to @lksnyder0 , who’s able to extend this blueprint to support the repeat
event, which allows you to repeat an action by holding on a given button:
An important consideration: this will interfere with any long-press actions on a given button.
If you already have long-press actions setup but want to make use of repeat button actions, you can just disable those specific actions from a given automation and switch to using a repeat action for that button (or vice-versa).