Combining RGB with CWW light

I’m a bit stuck,

I have a light with warm white and RGB,
but as of now those are 2 separate entities.
but I want to use only 1.

So my thought was to create a 3th light and then sync the colors.
but when I do this. none of the colors work.

I have this now

bk72xx:
  board: generic-bk7231n-qfn32-tuya

globals:
  - id: sync_r
    type: float
    restore_value: no
    initial_value: "0.0"

  - id: sync_g
    type: float
    restore_value: no
    initial_value: "0.0"

  - id: sync_b
    type: float
    restore_value: no
    initial_value: "0.0"

  - id: sync_lock
    type: bool
    restore_value: no
    initial_value: "false"


output:
  - platform: libretiny_pwm
    id: output_cold
    pin: P26
  - platform: libretiny_pwm
    id: output_warm
    pin: P24

  - platform: template
    id: output_red
    type: float
    write_action:
      # no-op
      - lambda: |-

  - platform: template
    id: output_green
    type: float
    write_action:
      # no-op
      - lambda: |-

  - platform: template
    id: output_blue
    type: float
    write_action:
      # no-op
      - lambda: |-


light:
  # - platform: cwww
  #   id: light_cwww
  #   name: Light
  #   cold_white_color_temperature: 6500 K
  #   warm_white_color_temperature: 2700 K
  #   cold_white: output_cold
  #   warm_white: output_warm

  - platform: beken_spi_led_strip
    id: rgb_raw
    name: "rgb raw"
    pin: P16
    chipset: sm16703
    num_leds: 12
    rgb_order: RGB
    on_state:
      then:
        - lambda: |-
            if (id(sync_lock)) return;
            id(sync_lock) = true;

            id(sync_r) = id(rgb_raw).current_values.get_red();
            id(sync_g) = id(rgb_raw).current_values.get_green();
            id(sync_b) = id(rgb_raw).current_values.get_blue();

            auto call = id(light_rgbww).make_call();
            call.set_red(id(sync_r));
            call.set_green(id(sync_g));
            call.set_blue(id(sync_b));
            call.perform();

            id(sync_lock) = false;

  - platform: rgbww
    id: light_rgbww
    name: Light
    color_interlock: true
    cold_white_color_temperature: 6500 K
    warm_white_color_temperature: 2700 K
    red: output_red
    green: output_green
    blue: output_blue
    cold_white: output_cold
    warm_white: output_warm
    restore_mode: ALWAYS_ON
    on_state:
      then:
        - lambda: |-
            if (id(sync_lock)) return;
            id(sync_lock) = true;

            id(sync_r) = id(light_rgbww).current_values.get_red();
            id(sync_g) = id(light_rgbww).current_values.get_green();
            id(sync_b) = id(light_rgbww).current_values.get_blue();

            auto call = id(rgb_raw).make_call();
            call.set_rgb(id(sync_r), id(sync_g), id(sync_b));
            call.perform();

            id(sync_lock) = false;

the global sync_r etc I probably can set local,
but that won’t fix my issue.

anyone any suggestions?
I think I either read or write the colors wrong

Before you go off and do a whole bunch of over thinking and making a minor problem into a massive one, you need to do the most important step and thats to go check through the Esphome documentation for solutions that may already exist for this or any problem because it would have saved you all this extra unnecessary code you made…

Also, what specific type of device/hardware are you using?

Sorry for replying this late,
I went with openBeken and forgot about this post.
but openbeken doesn’t seem to be stable enough so I am here again.

I know about the RGBWW light,
but that needs a spit RGB, and the ledstrip is not providing this.

    red: output_component1
    green: output_component2
    blue: output_component3

so that’s why I can’t be used this way.
using it this way would be awesome.

My current setup is like this

light:
  - platform: beken_spi_led_strip
    id: rgb_strip
    name: "RGB"
    icon: mdi:palette
    pin: P16
    chipset: sm16703
    num_leds: 12
    rgb_order: RGB
    restore_mode: ALWAYS_OFF
    effects:
      - addressable_rainbow:
          name: "Rainbow"
      - addressable_color_wipe:
          name: "Color Wipe"
      - addressable_scan:
          name: "Scan"
      - addressable_twinkle:
          name: "Twinkle"
      - addressable_random_twinkle:
          name: "Random Twinkle"
      - addressable_fireworks:
          name: "Fireworks"
      - addressable_flicker:
          name: "Fancy Flicker"
      - random:
          name: "Random"
      - pulse:
          name: "Pulse"
          transition_length: 1s
          update_interval: 1s
      - strobe:
          name: "Strobe"
      - flicker:
          name: "Flicker"
    on_turn_on:
      - light.turn_off: white_light
      - if:
          condition:
            switch.is_on: enable_timer
          then:
            - script.execute: turn_off_timer
    on_turn_off:
      - if:
          condition:
            light.is_off: white_light
          then:
            - script.stop: turn_off_timer

  - platform: cwww
    id: white_light
    name: "White"
    icon: mdi:wall-sconce-flat-outline 
    cold_white: output_cold
    warm_white: output_warm
    cold_white_color_temperature: 6500 K
    warm_white_color_temperature: 2700 K
    restore_mode: ALWAYS_ON
    on_turn_on:
      - light.turn_off: rgb_strip
      - if:
          condition:
            switch.is_on: enable_timer
          then:
            - script.execute: turn_off_timer
    on_turn_off:
      - if:
          condition:
            light.is_off: rgb_strip
          then:
            - script.stop: turn_off_timer

but that means still 2 lights.

1 would be awesome.

the light I have actually is this one

https://www.elektroda.com/rtvforum/topic4095226.html