Philips Hue: Smooth Dimming and Set Color/CT/Brightness While Off

Latest Version Installs

If you have a Hue Bridge and want to dim Hue lights smoothly with a non-Hue button, or to change a light’s color or brightness before it turns on, then this integration is for you.

:sparkles: Key Features

  • :white_check_mark: Create smooth “press to dim, release to stop” automations without janky dimming steps
  • :white_check_mark: Set color/CT/brightness while lights are off

:electric_plug: Requirements

  • A Philips Hue Bridge (V2 or Pro) with the core Philips Hue integration set up in Home Assistant.
  • All actions go through the bridge’s CLIP v2 API using the core integration’s existing connection. Hue bulbs paired directly to Zigbee2MQTT, ZHA or deCONZ (no bridge) are not supported.

:rocket: Installation

Download from HACS or GitHub.

Open the Philips Hue Smooth Dimmer HACS repository in your Home Assistant instance.

:level_slider: Smooth Dimming

Use the raise, lower and stop actions to add the visual polish of native Hue dimming to your “press to dim, release to stop" automations.

Example:

on_hold:
  - action: hue_dimmer.raise

on_release:
  - action: hue_dimmer.stop

:crescent_moon: Set Color, Color Temp & Brightness While Off

Use set_attributes to pre-stage a light’s color, CT and brightness before turning it on. This enables you to:

  • Eliminate color flashes and brightness extremes when lights turn on
  • Create consistent turn-on behavior across your home and automations

Example:

- action: hue_dimmer.set_attributes
  data:
    min_brightness: 30
    max_brightness: 80
    color_temp_kelvin: 2700
- action: light.turn_on

You can also check color/CT/brightness while lights are off with get_attributes.


Feedback and questions welcome. If you use it in interesting blueprints or automations, feel free to share your examples below.

And please star the repo.

6 Likes

Update: Set Brightness While Lights Are Off

I just released a new version that lets you adjust a Hue light’s brightness and color temperature while it’s turned off.

I also refreshed the first post to better explain what the integration does and how to install/use it.

As always, feedback is welcome. If you’re using it in interesting automations, I’d love to hear how.

Color control is here

v0.3.0 released today. You can now set a Hue bulb’s color while it’s off, so that it turns on without flashing its previous color.

Thank you for this! I'm using it in a blueprint for some of my switches: Inovelli LZW30-SN ZwaveJS Dimmable Blueprint (https://github.com/jasonmx/philips-hue-smooth-dimmer) · GitHub

This requires the hue hub and integration?

If not, how are you communicating with the lights?

I am very interested in disambiguating prestaging of hue lights, with no hub, and am currently doing it with direct publishing through zigbee2mqtt.

Thanks!

Thank you! This has resolved a key issue I've had using Hue in Home Assistant. Start / Stop dimming looks like it work perfectly when initiated through Switch Manager presses. However, I notice that the light brightness level indicator on my Inovelli switches immediately jumps to either 100 or 0 while dimming up / down. It stays there for about 10 seconds before eventually correcting itself to the actual light brightness. Any workaround for this behavior, or some action I can send to force an update from the bridge?

Sorry for my slow reply. I’d accidentally turned off notifications.

@ataraxia, thanks for asking. Yes, it needs a Hue Bridge (V2 or Pro) and the core Philips Hue integration. Everything goes through the bridge’s CLIP v2 API. It doesn’t support bulbs paired directly to Zigbee2MQTT or ZHA.

I’ve clarified the hub requirement in the first post above, for other readers.

@Modem-Tones, that’s a limitation in the Hue bridge.

When you tell the Hue API to "raise brightness to 100% over N seconds,” the bridge reports 100% immediately and waits 10s before checking the light’s actual brightness. Hence the behavior you’re seeing.

Some ideas to improve your experience, which I’d be happy to explore (unless you can think of better ones):

  1. Publish the actual brightness to a helper, which feeds your dimmer’s indicator (if Inovelli supports that).
  2. Update HA with the actual brightness when dimming stops. Your Inovelli indicator would still misread during dimming, but would correct itself as soon as you release the button.
  3. Instead of sending a single start-dimming API request, I could try streaming a series of smaller API dimming messages ~1 second apart. That way, HA and the bridge would track the actual brightness in 1-second steps. This may prove too complex or fragile to implement - I’d need to test it.

Before I investigate any of these paths, how much of a pain point is this for you? E.g. is it just visual annoyance that you may have got used to, or do you have something downstream (e.g. an automation) that breaks with the wrong brightness value?

A workaround you can try today: after hue_dimmer.stop, call hue_dimmer.get_attributes on the same light (it returns the true brightness from the integration’s internal tracking), then pass that brightness to hue_dimmer.set_attributes. That should snap HA and the bridge to the true brightness value straight away. If you try this, please report back whether it works.

@victorlin, glad it’s useful. Your gist link is returning 404 for me. If you still have the blueprint, can you post it to the Blueprints Exchange category and resend me the link, so I can link to it from my integration’s README?