Philips Hue Tap Dial Switch (Z2M / ZHA) Custom, Light and Media mode [RDM002]

Hi danieldeni,
Many thanks for your blueprint (and to those you based it on) !

I am using this to control 4 lights - 2 Philips hue and 2 Tapo multi-coloured lights.

With your code the dimming on the tapo lights was changing the brightness by approximately 3% but I wanted to make this 1%. I noticed that each click of the dial increased the raw data by 8 so I adjusted the variables section in the code as follows:

1469  step_size_raw: "{{ trigger.event.data.params.step_size | default('0') }}"
1470  step_size: "{{( step_size_raw / 8 )}}"

This code now means every small step rotation is a step of 1.
(I am new to HA blueprinting and I couldn’t work out how to divide by 8 in one line!)

To dim the light in all the rotate left or right aliases I changed all references of:

brightness_step to brightness_step_pct

This means 1 click of the dial will change the brightness by 1% if the dial is moved slowly, and if the dial is moved quickly the brightness step will change accordingly. The dial automatically reports a larger step size which is great!

My Tapo lights change brightness from 1% to 100% in steps of 1% so I find this works best for these lights, particularly if you want to set it at the minimum setting as a night light. It also works well for the Philips lights, but they are less sensitive.

Feel free to integrate this in your blueprint if you or anyone else finds it useful!

Thanks again for your hard work!

Best Regards!

I am only using Philips Hue lights and those have 255 steps of brightness as it doesn’t target the % of the light but the raw brightness values through the step command. For Zigbee lights this is common, but I guess Wifi based lights like Tapo only have 100 steps using this?

I’ll need to check when I have time to make the step size configurable for this use case, as it will be too slow for Zigbee lights with your changes.

Hi @danieldeni - I’ve been using your Blueprint for a while now but I think I have run into an issue with using a Schedule.

My Hue downlights are switched my Clipsal Wiser switches so I have an automation that keeps the light state and switch state in sync but also using different light settings (brightness, colour temp) depending on the time of day.

I replicated those time of day settings in a Schedule, created via the UI:

image


I have added that Schedule to the automation created from the Blueprint, however the Blueprint seems to be ignoring the Schedule:

When I use Button 2 after 19:30, the lights come on using the settings in the Blueprint rather than what is specified in the Schedule.

Check the example I have in the start post. The additional data should be with these names per field:

brightness_pct: 30
color_temp_kelvin: 3333

Where you can put your own numbers of course, per preference.

Do keep in mind the Blueprint doesn’t trigger the schedules automatically on changes, only if you press the button. I have a separate automation in place that triggers on schedule change, might integrate that later into the blueprint.

I’ll try that out, thank you.

Note though that the documentation for Schedules - https://www.home-assistant.io/integrations/schedule/#adding-additional-data - show the formatting as I have it:

That’s an example for generic use yes. And might be updated in the future outside of my control.

color_temp was linked to mired in the past and was changed somewhere in 2024 to be based on kelvin. To avoid confusion I used color_temp_kelvin .

My start post has instructions for my blueprint specifically. You can use whichever names are set inside the blueprint, others are ignored as they are not put in the logic of the automations and variables.

1 Like

Now working as expected. Thank you.

1 Like

@danieldeni
Great work and thank you for your efforts with this!

Is it possible to have it work so that toggling a light will retain it’s brightness setting?

E.g.
Button 1: Ceiling Light set to toggle

If I tap button 1 it will turn on my ceiling light as expected, and if I rotate the dial it changes brightness as expected, let’s say to 50% in my example.

If I then tap button 1 again it will turn the light off, as expected being a toggle.

If I tap button 1 once more the light toggles back on, but to 100% (or whatever the preset brightness is in the automation using your blueprint).

I would wish for my ceiling light to come back on at the pre-changed brightness, int this case 50%

Can you add functionality to enable and disable presets please?

I suppose more ideally than the above config would be to have each button select but not turn off a light with a single tap and either a long press or double tap to turn off the light. That does seem possible but it’s the returning to defaults that is throwing out my setup. It would be super handy to just leave the brightness to whatever I have set regardless of whatever else is going on with lights on/off.

Also…

Would it be possible to have a slider for each light so that the % step can be adjusted for dimming and brightening the lights. I have some lights that step far more slowly than others and it would be good to be able to tweak them so the more slowly transitioning lights step up and down faster through brightness changes.

I guess as a ‘Brucey bonus’ it would be awesome to be able to use the dial to change temperature or the lights.

Many, many thanks!

I need to check when I have time to change the logic where the presets are optional, but this will require quite a rework of the logic to do what you are asking, so don’t know when I would be able to do that.

I am using short press for turn on and reset to preset, and long press for turn off, so I don’t have this issue myself.

For the time being you can alter the way they react by not using the Light mode at all and use the Custom Actions to set your own Automations per different option. That way you can set a simple toggle without using the presets, the lights automatically store their last state so if you use a pure toggle command, it should restore the last state automatically.

The dimming and brightening steps are dynamically calculated, depending on the speed you turn the dial. I can check if I can create a factor that can be set to increase/decrease the speed to someone’s preferences.

As requested, and replied before about the change temperature function, this is not supported by ZHA or Zigbee itself, so there is no way for me to implement it fluently. If I would want to implement it now, the blueprint would need to poll the light state to be able to change the colour temperature of the lights that way. There is no native Zigbee command to increase or decrease colour temp. Due to delays in Zigbee this will never be fluid. The dimming feature uses a built in Move function that doesn’t poll the lights while dimming/brightening.

As it cannot be fluent, I am not sure how useful the function would be, as I use presets myself depending on time of day, I never change the colour temp manually.

Thanks for the update and the answers.

And of course re: time to work on, I appreciate you’re doing this for free and do thank you for your efforts!

The issue I have re: tapping and long-presses is that unfortunately I have a neurological issues, so so the simpler my interactions with any device the better.

Using a single tap to turn on a light and tap to hold to turn off is kind of ok, as not much dexterity in that, but if I am changing between lights and adapting their brightnesses, if changing light 1, and then light 2, if I want to tweak light 1’s brightness just a little bit more, as stands presently (so far as I can tell) as soon as I tap on light 1, this sends a command to reset the brightness completely, which is both a bit jarring in the room, but also needing more rotation interactions.

I had initially expected the ‘Light:Turn on’, to work more like a 'Light:Turn on (if not already on) OR select light/assigned function (if already on and just wanting to use the dial for that light or function).

I suppose to be somewhat ‘fancy’ it would be pretty cool to be able to use a timer - so that brightness settings could be stored for a given amount of time, before returning to ‘default’.

That way could make use of schedules still, but also allow for a bit of user input/override.

Noted re: temperature changes. Interesting that lights in HA do all have temperature sliders - I’d not considered the ‘behind the scenes’ complexity re: zigbee in this regard.

I’ll deffo have a play with the custom functions rather than light specific ones in the meantime though. This could work nicely with sunset/sunrise offsets :slight_smile:

Thanks again!

Just wanted to say a huge thanks. This is exactly what I needed.

:warning: New Update Available (2025.12.1)

What’s New:

  • Add Zigbee2MQTT (Z2M) support alongside existing ZHA
  • Add Auto-Adjust feature: automatically update lights when schedule changes
  • Add Reset to Defaults action for light mode
  • Add configurable Dimming Speed for light transitions
  • Add integration type selector to choose Z2M, ZHA, or both
  • Add Z2M configuration section (base topic, device friendly name)
  • Implement double press detection for Z2M using wait_for_trigger
  • Rename blueprint to reflect dual integration support

Note: Triple/quad/quint press is only supported with ZHA (native). Z2M double press is handled by the blueprint logic.

Upgrade Instructions:

Please re-import the blueprint and reconfigure your automations.

The blueprint has been renamed from zha-philips-hue-tap-dial-switch.yaml to philips-hue-tap-dial-switch.yaml. To keep your existing settings:

  1. Open your automation in the YAML editor
  2. Change the blueprint path from: danielpetrovic/zha-philips-hue-tap-dial-switch.yaml to: danielpetrovic/philips-hue-tap-dial-switch.yaml
  3. Save and reload

This preserves all your current configuration without needing to reconfigure from scratch.

1 Like

Doing this throws an error:

Did you try re-importing through the link in the startpost? The URL changed, so the existing blueprint can’t be imported through Home Assistant directly.

Afterwards you will have two versions and once you have updated your Automations to use the new version, you can remove the old one with zha- in front of the filename.

Any next versions will not change in name anymore, so this would be a one time change.

Doh! No, I just reimported from within HA.

:warning: New Update Available (2025.12.2)

What’s New:

  • Add Light Adjustment Mode selector for all 4 buttons (Static/Adaptive/Schedule)
  • Add Adaptive brightness and color temp helper inputs per button
  • Add Auto-adjust triggers for adaptive mode
  • Add support for Adaptive Lighting Scheduler blueprint

Simply set the Light Adjustment Mode to “Adaptive” and point to the helpers updated by the scheduler!

Upgrade Instructions:

Please re-import the blueprint. Your existing settings will be preserved - the new options default to “Static” mode for backwards compatibility.

The re-import button causes an error in my HomeAssistant, saying “Unable to re-import the blueprint: source not found.” Some investigation turned out there might be conflicting source urls for the previous and current version of the blueprint:

* https://github.com/danielpetrovic/home-assistant-config/blob/81e7aeef8ced492e585d43835aa6afd2ede4ba6d/blueprints/automation/danielpetrovic/zha-philips-hue-tap-dial-switch.yaml
* https://github.com/danielpetrovic/home-assistant-config/blob/81e7aeef8ced492e585d43835aa6afd2ede4ba6d/blueprints/automation/danielpetrovic/philips-hue-tap-dial-switch.yaml

Is this intended and if so, how can I update the blueprint?

Yes, this is intended, Home Assistant doesn’t support the renaming of a blueprint file so for your Home Assistant installation it will be a new blueprint. See a few posts above:

The link is now also without the randomid of the blob and will be pushed to main for future updates. So it should not break re-importing in the future anymore.

I’m seeing the following in my logs:

I’m using ZHA and Z2M is unticked in the automation. Is the automation trying to connect to both ZHA and Z2M irrespective of which one is selected?

Ah, I’ve found where this went wrong. The next update should fix this.

Sadly there is no way to make triggers fully optional in a blueprint. By not selecting Z2M it will not run any automations based on data interpreted from the MQTT Broker.

1 Like