IKEA 5key Switch for controlling a RGBW-stripe

Hithere,

I have a difficult usecase and I need support for getting this to work.

The RGBW controller has two channels for the RGBW stripe. With channel 1 you can control the RGB-LEDs with channel two you control the white-LEDs.

If you press the left button, you can cylce through different RGB-Colour scenes, with the right button you can toggle the white LEDs (on/off)

Now I would like to control the brighnes with the DimUp and DimDown button. This works fine for a static channel, but I do not have a clue, how i can do this depending on the selected channels…

3 scenarios are possible:

1: RGB LEDs are on: (left button was pressed)
2. White LEDs arre on: (right button was pressed)
3. both LEDs are on.

I think, only the dimmer has to be modified and must determine the status of the LEDs, and then dim either only the RGB, the white or both LEDs.

This is the actual setup. (the code for the “dropdown scene-helper” is missing)

LightScenes:

- id: red
  name: red
  entities:
      light.gledopto_led_stripe_lena_rgb:
        state: on
        brightness_pct: 100
        xy_color: [ 0.7291,0.2783 ]
#      light.gledopto_led_stripe_lena_white:
#        state: on
#        brightness_pct: 1

- id: blue
  name: blue
  entities:
      light.gledopto_led_stripe_lena_rgb:
        state: on
        brightness_pct: 100
        xy_color: [ 0.136,0.04 ]
#      light.gledopto_led_stripe_lena_white:
#        state: on
#        brightness_pct: 1

- id: orange
  name: orange
  entities:
      light.gledopto_led_stripe_lena_rgb:
        state: on
        brightness_pct: 100
        xy_color: [ 0.5841,0.4269 ]
#      light.gledopto_led_stripe_lena_white:
#        state: on
#        brightness_pct: 1

- id: green
  name: green
  entities:
      light.gledopto_led_stripe_lena_rgb:
        state: on
        brightness_pct: 100
        xy_color: [ 0.3154,0.5952 ]
#      light.gledopto_led_stripe_lena_white:
#        state: on
#        brightness_pct: 1

- id: 'off'
  name: 'off'
  entities:
      light.gledopto_led_stripe_lena_rgb:
        state: off

select Scenes:

id: 'selectScene'
alias: Scene Selector
description: 'durchschalten der Szenen über die linke Taste der Fernbedienung'
mode: single
trigger:
  - platform: device
    id: butten_left
    domain: mqtt
    device_id: 5cdd0b1d30a5ac6908810444adc15d39
    type: action
    subtype: arrow_left_click
    discovery_id: 0x14b457fffe431ad9 action_arrow_left_click
condition: []
action:
  - service: input_select.select_next
    data:
      cycle: true
    target:
      entity_id: input_select.scene_entities
  - service: scene.turn_on
    target:
      entity_id: "{{states('input_select.scene_entities')}}"
toggle white LEDs:
alias: ToggleWhite
description: ""
trigger:
  - platform: device
    domain: mqtt
    device_id: 5cdd0b1d30a5ac6908810444adc15d39
    type: action
    subtype: arrow_right_click
    discovery_id: 0x14b457fffe431ad9 action_arrow_right_click
condition: []
action:
  - type: toggle
    device_id: 14281426cea66207b03b10fa6a251b67
    entity_id: light.gledopto_led_stripe_lena_white
    domain: light
mode: single

Dimmer:

id: '1675861496788'
alias: Dim LED Stripe Lena
description: ''
mode: restart
trigger:
  - platform: device
    domain: mqtt
    device_id: 5cdd0b1d30a5ac6908810444adc15d39
    type: action
    subtype: brightness_down_hold
    discovery_id: 0x14b457fffe431ad9 action_brightness_down_hold
    id: dimDown
  - platform: device
    domain: mqtt
    device_id: 5cdd0b1d30a5ac6908810444adc15d39
    type: action
    subtype: brightness_up_hold
    discovery_id: 0x14b457fffe431ad9 action_brightness_up_hold
    id: dimUp
  - platform: device
    domain: mqtt
    device_id: 5cdd0b1d30a5ac6908810444adc15d39
    type: action
    subtype: brightness_down_release
    discovery_id: 0x14b457fffe431ad9 action_brightness_down_release
    id: dimDown-release
  - platform: device
    domain: mqtt
    device_id: 5cdd0b1d30a5ac6908810444adc15d39
    type: action
    subtype: brightness_up_release
    discovery_id: 0x14b457fffe431ad9 action_brightness_up_release
    id: dumUp-release
condition: []
action:
  - choose:
    - conditions:
      - condition: trigger
        id: dimUp
      sequence:
      - repeat:
          while:
          - condition: trigger
            id: dimUp
          sequence:
          - device_id: 14281426cea66207b03b10fa6a251b67
            domain: light
            entity_id: light.gledopto_led_stripe_lena_rgb
            type: brightness_increase
          - device_id: 14281426cea66207b03b10fa6a251b67
            domain: light
            entity_id: light.gledopto_led_stripe_lena_white
            type: brightness_increase
          - delay:
              hours: 0
              minutes: 0
              seconds: 0
              milliseconds: 500
    - conditions:
      - condition: trigger
        id: dimDown
      sequence:
      - repeat:
          while:
          - condition: trigger
            id: dimDown
          sequence:
          - device_id: 14281426cea66207b03b10fa6a251b67
            domain: light
            entity_id: light.gledopto_led_stripe_lena_rgb
            type: brightness_decrease
          - device_id: 14281426cea66207b03b10fa6a251b67
            domain: light
            entity_id: light.gledopto_led_stripe_lena_white
            type: brightness_decrease
          - delay:
              hours: 0
              minutes: 0
              seconds: 0
              milliseconds: 500