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?