Template: light to "(...) | random" color? // rgb_color to xy_color?

https://community.home-assistant.io/t/portable-rain-drop-sensor-made-with-xiaomi-door-sensor/74090

i use this for over 1 year and have no problems with it