Relative Brightness Light Group

Relative Brightness Light Group

Adjust the brightness of a group of lights while maintaining the relative brightness between individual lights! :tada:

When adjusting the brightness of a group using the built-in light group, all the lights within the group would end up getting the same level no matter their previous level. I took a stab trying to fix that once before, but using a template light made it hard to maintain and it hurt reusability.

Now with the power of a custom component that’s built on top of the core light group, it’s as easy as adding just a few lines to your configuration.yaml file :slight_smile:

Installation

HACS

In HACS, add a custom repository:

  • Repostiory: https://github.com/oscarb/relative-brightness-light-group
  • Category: Integration

Then search for Relative brightness light group to find and install it. Set up any lights you wish in your configuration file and restart Home Assistant if necessary.

Manually

  1. Head over to the repository at GitHub, click the Code button and download the files either as a ZIP-file or using git.
  2. From the downloaded files, move the folder that’s inside the custom_components folder into the custom_components folder in your HA config folder.
  3. Restart Home Assistant

Configuration

To use, simply add this to your configuration.yaml file:

light:
  - platform: relative_brightness_light_group
    name: The Office
    entities:
      - light.office_desk
      - light.office_spotlights

Enjoy! :bulb: And let me know how well it works for you or if you have any other thoughts or questions :slight_smile:

2 Likes

Note: Since I changed from using the IKEA Tradfri hub to the Philips Hue bridge, my brightness sliders started showing this “bouncy” behavior where it takes a second before all sliders are in the right place.

However, as far as I can tell this isn’t a problem introduced with my component ('ve seen the same happen with the core light group) so instead there’s something that needs fixing way beyond this component. Fingers crossed that it works better with your setup than in mine :crossed_fingers: :smile:

Nice! Actually I have been waiting for this for a very long time. I will test this as soon as possible. Before, I achieved this using scripts and helpers, which was getting annoying to mantain as soon as the number of lights grew.

I would love to use this, by I cannot find a way. I try
Dashboard → add card → manual (yaml) card
But i only get

„No card type configured“

What am I doing wrong?

Thank you
Juergen

Hi Juergen,

This is not a card for the dashboard but instead a way to create a new light entity.

Once you’ve gotten the files needed into your Home Assistant (either by downloading them or using HACS as mentioned in the first post), then you can add the code you quoted into your configuration.yaml file.

When that is done you can use any card for your dashboard that supports lights, for example the light card or tile, and then reference a new light.the_office that’s been created for you.

However, if you want the same look and feel as in the card I’ve done above, you’ll first need lovelace-slider-entity-row and then you can add a manual card with this YAML to your dashboard:

type: grid
columns: 1
square: false
cards:
  - type: entities
    state_color: true
    title: Office lights
    show_header_toggle: true
    entities:
      - entity: light.the_office
        type: custom:slider-entity-row
        step: 1
        full_row: true
      - entity: light.office_desk
        type: custom:slider-entity-row
        step: 1
        toggle: true
      - entity: light.office_spotlights
        type: custom:slider-entity-row
        step: 1
        toggle: true

Good luck!

Hi Oscar,
I found out, that the manual adding in HACS gives an error, it says: there is a shop entry (or similar) i than searched in HACS and added your system, than the small sample was there, but there was no difference to a groug (still saw this one round slider around a lightbulb). I‘ll just try your suggestion and givea notice, if it worled.
Many thanks
Juergen

Hi Oscar,
I added this to my configuration.yaml

light:
  - platform: relative_brightness_light_group
    name: Gartenlampen
    unique_id: gartenlampen
    entities:
      - light.shellydimmer2_4cebd6edf3a3
      - light.shellydimmer2_4cebd6edf72a

and this to the yaml card:

type: grid
columns: 1
square: false
cards:
  - type: entities
    state_color: true
    title: Gartenlampen
    show_header_toggle: true
    entities:
      - entity: light.shellydimmer2_4cebd6edf3a3
        name: lampe links
        type: custom:slider-entity-row
        step: 1
        full_row: true
      - entity: light.shellydimmer2_4cebd6edf72a
        name: lampe rechts
        type: custom:slider-entity-row
        step: 1
        toggle: true

But only get this:

which turn on both lights with the main switch and the “rechts” light with the correct one, the long slider without a name is the one for the “links”, the on/off on top makes both lamps on and off, the “links” has no on/off. So it works “somehow”, but not as expected. I have absolutely no idea, where to search. I did install “relativ-brightness-light-geoup” and “slider-entity-row” thru the HACS Shop today so I think it should be the newest version.

any ideas?

many thanks
Juergen

The difference from your current setup to mine is that in my card I have included three lights:

  • The first one, the one with the full width, is the group one, the light.the_office for the whole office
  • The second and third one, not full width, are the individual lights in my office, the desk lamp (light.office_desk) and spotlights (light.office_spotlights) respectively.

So then when I change the brightness on the the first one the other two on the card will change too but in a way so that their “relative brightness” to each other is somewhat maintained.

So make sure to add your light.gartenlampen to your card as the first one. If no light.gartenlampen shows up that you can control, you might have to restart HA.

Hi Oscar,
thanks a lot. Now it is working!
Thanks for your patience, I learned a lot.

Juergen

Hello

I have added the integration and added to the config file and restarted.

I assume this creates and entity light.the_office but i cant find it.

Have i missed a step somewhere?

Thanks

Jeremy