How to extend dimming lights to a whole group?

Hello,

sorry, newbie question incoming, so I’ll be equally happy if you just redirect me to a good point in the documentation - my own research and googling ended only in things that are far too advanced for me right now.

I bought a Philips Hue Dimmer Switch today to use it with a few Philips Hue bulbs that I use with zigbee2mqtt. I was able to easily add the switch and can now toggle a light group on and off with the corresponding button. I read the forum and found the recommendation to do this with “Call service” and then “toggle light” for which I chose my light group as entity.

Now I wanted to add the two dimming buttons in the same way, but “Call service” and then entering “light” only allows to toggle, turn on and turn off, not to change brightness. I managed to do this for a single Philips Hue bulb with the UI, which results in this yaml code:

description: "test"
mode: single
trigger:
  - platform: device
    domain: mqtt
    device_id: d84ae2d5a4d629fc1f1effddd9d0f02e
    type: action
    subtype: up_press
condition: []
action:
  - device_id: 02e088d91b05fbebeb7e43d104575d1e
    domain: light
    entity_id: aaf89b897b227166e3c693d19e1d1983
    type: brightness_increase

Can I change this to my light group somehow? Isn’t it better to use entities instead of device ids? I can’t find any option in the UI editor to address an entity or light group.

Any hints or pointers at the proper part of the documentation are much appreciated. Thanks!

i’m not sure exactly what you’re asking. if you’re just asking how to turn the lights up or down incrementally, you could do something like this:

service: light.turn_on
target:
  entity_id: light.your_light_group
data:
  brightness_step_pct: 10

to turn a light group named light.your_light_group all up or down (use negative numbers to turn it down… in this case i increased it by 10%.

you can do all those lights by putting them into a group (look at helpers)

or you could list them individually if you don’t want to use a group:

service: light.turn_on
target:
  entity_id:
    - light.light_1
    - light.light_2
data:
  brightness_step_pct: -10

for convenience you might also take a look at this philips hue dimmer switch blueprint:

is that answering your question?

First, thanks for your answert!

If you didn’t get my question, that might be because I am still lacking a decent understanding of a lot of Home Assistant concepts and I have not found documentation yet that could provide me a comprehensive introduction (only reference if I already know that a certain concept exists). For example you pasted code for a service. What is a service? When do I use it? Where do I add it. Googling for it does only yield this link: Home Assistant Services | Home Assistant Data Science Portal
But this does not help me in understanding how, when and where I should use this concept. I’ll just fool around in the settings and maybe I’ll find where to add it.

Thanks for that blueprint. I’ll read up on what a blueprint is and how I install and use one. I hope the documentation is more comprehensive on blueprints than it is on services. :slight_smile:

Edit: I managed to add blueprints, but neither the original one nor the one you linked will discover my dimmer switch. I’ll check out the model numbers and see if I can find documentation on this. It’s all a bit puzzling. :slight_smile:

ah, ok, i may have assumed too much knowledge. but happy to adjust.

in the original code you had, it looks like you have code that triggers when you press a zigbee button (the phillip hue dimmer switch i presume) and that calls “brightness_increase” on one light.

you can use my code instead of the action you had to turn on the light.

this means that your code changes to this:

description: test
mode: single
trigger:
  - device_id: ""
    domain: ""
    entity_id: ""
    platform: device
condition: []
action:
  - service: light.turn_on
    target:
      entity_id: light.your_light_group
    data:
      brightness_step_pct: 10

or

description: test
mode: single
trigger:
  - device_id: ""
    domain: ""
    entity_id: ""
    platform: device
condition: []
action:
  - service: light.turn_on
    target:
      entity_id:
        - light.light_1
        - light.light_2
    data:
      brightness_step_pct: 10

if you do the first case, you need to create a light group (go to “helpers” in the ui and create a group for lights). in the second case, you don’t need to create a light group, but you do need to specify each light you want that one button press to increase the brightness for.

does that help?

hit me w qeustions if it doesn’t fully make sense, or if there’s something different you were wanting it to do.

Thanks a lot, now I got it. My main mistake was not understanding that dimming is “turning on with a new relative value change”. I was looking for an action just changing the brightness value. Works well now and from this point I can add all the other stuff. And I understood a few more concepts along the way. Thank you very much!

1 Like

great! don’t hesitate to ask if you hit more headscratchers. folks here are particularly helpful when people are genuinely interested in learning the concepts beyond just “getting it done” :slight_smile:

1 Like