Issues with Shelly RGBW2 since 2021.5

Most of my light bulbs / LED strips are smart lights (mainly Hue, Ikea, ShellyRGBW2) and they are all behind Shelly switches (Shelly2.5) that are controlled by the wall switch. So I can make sure that I always can at least turn on/off the lights, even there is any problem with HA or the network.

In order to have all lights (or group of lights) available as single entities, and that they are always available, I am using all my lights via Template Lights. Here I can for instance check the status of the Shelly switch when I turn on the light.

      turn_on:
        - choose:
            - conditions:
                - condition: template
                  value_template: "{{ is_state('switch.shelly25_mb1_2', 'off') }}"
              sequence:
                - service: switch.turn_on
                  target:
                    entity_id: switch.shelly25_mb1_2
          default:
            - service: light.turn_on
              target:
                entity_id: light.shellyrgbw_mb1

Everything worked perfectly until in HA2021.5 the light modes were changed. Especially for the ShellyRGBW2, I haven’t found any solution to control them via Template Lights anymore, as there only “hs” is supported, but the ShellyRGBW2 now only supports “rgbw” ( < 2021.5 “hs” and “rgbw” was supported.

2021.5:

2021.4:

I still can push the colours via hs_color to the Shelly, but it looks like this is automatically translated to rgbw…but unfortunately totally wrong. For testing, I sent some hs values via the Developer Tools, here can see that something is not working

brightness: 128, hs_color: 0, 0, rgb_color: 255, 255, 255 → rgbw_color: 0, 0, 0, 255
brightness: 128, hs_color: 0, 25, rgb_color: 255, 191, 191 → rgbw_color: 85, 0, 0, 255
brightness: 128, hs_color: 0, 50, rgb_color: 255, 127, 127 → rgbw_color: 255, 0, 0, 253
brightness: 128, hs_color: 0, 75, rgb_color: 255, 63, 63 → rgbw_color: 255, 0, 0, 84
brightness: 128, hs_color: 0, 100, rgb_color: 255, 0, 0 → rgbw_color: 255, 0, 0, 0

Especially the ‘W’ part in RGBW should not be affected at all by the change of hs values.

Has anyone any idea how to fix this? Is it somehow possible to calculate the rgbw values directly in the Template Light to send these values directly? Or is there any better way to combine smart lights and smart switches for this use case?

Or is this just a bug and I should go back to 2021.4 and wait until this is fixed?