Dimmer control

After setting up HA and hooking up a bunch of stuff, mostly lights, there was one piece that was hard to achieve. That was proper dimming of lights, through HA. Making a Hue dimmer remote dim Hue lights through the Hue bridge wasn’t a problem. But a dimmer remote connected through deconz could not easily dim a bunch of lights from another domain.

Doing dimming using raw Home Assistant automation and scripts is a really horrible experience, and I could not stomach creating all those littble bits and pieces to make it fit together. And then do it all again when adding a new dimmer.

I’m a programmer, so I prefer writing actual code. But I also really like how HA makes it easy connect things together using configuration and a UI. So I started thinking about how I would want it to work and created a prototype using AppDaemon. I’m pretty happy with the result and would like to share it here. I know there are many other dimmer projects, and I did not go through all of them. But I think many of them are more concerned with other aspects of dimming, such as optimal light control, so this is complementary.

The core idea is that dimming should be a state in the state machine. A “dimmer contoller”, or just “dimmer” for short, has a state that can be inactive, or dimming up, or dimming down. Then you tell it what lights it should control. And then you add automations to connect your dimmer buttons to the dimmer controller.

For the prototype, I had to fake the state using an input number, but that works fine.

The prototype can be found at

Now, I’d really like this to be a feature in HA itself, so if I find the time I’ll see if I an make it a custom component that has its own state instead. But then I would need some Lovelace work to make it really useful.

Please have a look at the README on the github page and let me know what you think.

1 Like

Interesting approach that I haven’t seen before.

Did you take a look at this app, which supports multiple remotes and connection types (zigbee2mqtt, deconz) and also looping through colors and more.
I also created an app, but only for deconz, which uses a little trick with deconz services and allows really smooth dimming

1 Like

Guys, slightly off topic but I use dimming and I’m not sure I know how it works.
My lights and dimmers go through a calibration cycle and it sets minimum and maximum outputs for the 1 to 100 (or is that 99 ?) if using percent. Any way I have a 180 second transition to 1% from 70% and I can see each step but I think there’s about 70 steps (have not sat and counted) but should there not be 178 steps (or whatever, of the 255) to achieve a higher resolution ramp ? Or have I lost some of that resolution in the calibration phase ?
Just curious is all.
TiA

But a dimmer remote connected through deconz could not easily dim a bunch of lights from another domain.

Hi @dkagedal,

As @Burningstone says, I would suggest you to take a look to this app. Its main purpose was to give the functionality that controller lose when replacing the original hub by another that aggregates several devices. For example, Home Assistant + zigbee2mqtt/deCONZ is a great approach, but it only lets you integrate devices and not the logic between controllers and entities (such as lights and media players). This is why I created this app that gives support to deCONZ and zigbee2mqtt by calling the Home Assistant API, so it does not matter which light (or lights) are behind a controller (or controllers) as long as they work with the attribute “brightness”, “color_temp” or “color_xy”.

However, I think it is a really good idea to integrate the dim up/down in HA to then just call a service to start/stop dimming. Then it would make the life easier to create automations.

Thanks for sharing this with us and keep us updated if you make any progress on integrating this to HA :slight_smile:

1 Like

I would also like to mention that if this gets integrated to HA, I would take a more generic approach (which I think you take with the parameter “attribute”). It would be interesting as well to di the same with other attributes than not just “brigthness”, such as “color_temp” or “volume_level”. This way we could use it for any attribute that can be dimmed and even outside the light domain.

When generalized, the “dimmer controller” becomes a more general “gradual mutation controller” that can change values over time in a controllable way.