ZHA - Philips Hue Tap Switch Mini - Media Controls (RDM002)

Important Note: RMD002 support is added to the November 2024 release of Home Assistant. This blueprint will not work with earlier versions.

This blueprint enables simple control of a media player using a Philips Hue Tap Dial (RDM002) control. In addition to controlling a media player, you can provide custom automations for long press and long release as well as single, double, triple, quadruple, and quintuple presses of the controller buttons that aren’t pre-configured for media control.

I’ve made another blueprint which allows for full customization without assuming a media player. That blueprint can be found here: ZHA - Philips Hue Tap Switch Mini - Custom Controls (RDM002)

How To:

  • Install the blueprint
  • Select the your RDM002 controller and the “Media Player” you’d like to control. This can be any “Media Player” device which includes Sonos, Roon, and many others
  • Button 1 will now act as play/pause. Button 3 will act as “Previous Track”. Button 4 will act as “Next Track”. The rotating dial will control volume
  • The dial will do velocity-sensitive volume control based on your speed of rotation. You can configure this precisely using the blueprint - detailed instructions are provided within the blueprint itself
  • Provide any custom automations you want for additional single, double, triple, and quadruple button presses

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

This is an image of the blueprint’s UI for configuring volume controls:

This is how the blueprint supports configuring custom actions. This is for “Button 2” for which all custom actions are available. Buttons 1, 2, and 4 don’t have options for short presses since those are dedicated to Play/Pause, Previous Track, and Next Track:

Blueprint code is available at this gist.

1 Like

Hi

Huge fan of this blueprint!
Thanks a lot!

I am using it with spotify and several grouped Denon/HEOS speakers.

I noticed the following:
My spotify media player remains unresponsive after the button 1 short-press if it is in “idle” state. Music does not play.

Available media_player attributes in “idle” state:

As a workaround I added the following condition to the blueprint, which sets the player’s state to “paused”.
(I inserted that condition right after the definition of the variables.)

if:
  - condition: state
    entity_id: media_player.spotify_take_5
    state: "idle"
then:
  target:
    entity_id: media_player.spotify_take_5
  data:
    source: MySpeakerGroup
  action: media_player.select_source

(I am a home assistant newbie, so there might be more elegant solutions.)

In the “paused” state, media-related attributes and a source are available and music starts playing.

Issue might be similar to this:

If you could add the option to select a default speaker group for cases where “source” is available because of the player’s idle state, that would be great!

1 Like

Thanks for this feedback! I’m traveling now and can’t look at this - I’ll take a look when I’m back home in a week or so. Thanks again!

This blueprint has been updated to fix an issue with multi-press events. If you’ve previously imported this blueprint, you should be able to install the updated version by re-installing using the installation button in the first post and choosing to override your existing blueprint.

1 Like

Hi, @take5

I’m glad you’re enjoying the blueprint! Sorry for the slow response - I just got back from a couple of weeks of vacation.

I took a look at your suggestion for supporting the “idle” state. The problem with the “idle” state, as you may have already figured out, is that the Home Assistant “Media Player” documentation defines “Idle” as:

The media player is turned on and accepting commands, but currently not playing any media. Possibly at some idle home screen.

The documentation is here: Media player - Home Assistant

This means that there is no standard behavior for making it “play” because there is nothing to play. If you, for example, were to use the Spotify app, or some other strategy, to start music playing, then button 1 would behave as expected. I don’t think I can modify this blueprint with your suggestion and have that work in the general case. So I think I should leave it as is.

If you find that the behavior you added works specifically for your Spotify case, then I have a couple of suggestions

  • Because you added the code that you created immediately after the variables, it will run whenever this automation runs, which means on any button press or dial rotation. That’s probably not what you want.

  • You could add this code as a button 2 behavior or a behavior of any double, triple, etc. button press. For example, when Spotify is in the “Idle” state, you could double press the play / pause button to get it selected or whatever. You can extend it to do whatever you like. Once it’s playing, I hope that the play/pause behavior of button 1 will work. That behavior simply, as I’m sure you’ve seen, just uses the media player’s “toggle” behavior which transitions between playing and paused states.

  • If you don’t like the idea of a new button behavior, you can check out my other blueprint which isn’t specific to media controls. You can make button 1 behave exactly as it makes sense for it to behave for your setup. You would also need to implement volume changes, but that’s pretty easy with the other blueprint, too. That blueprint is available here: ZHA - Philips Hue Tap Switch Mini - Custom Controls (RDM002)

Thanks again for using this and I hope this helps!