Complex flash pattern for light.turn_on service

Instead of the current selection of short and long allow open text for complex flashing patterns. For example we could use the following syntax:

Ts(R,G,B,W), Ps,...
such that writing 5s(255,0,0,0), 1s, 1s(0,0,0,0), 5s(0,255,0,0)
would Turn the light to red for 5 seconds, wait 1 second (no action), turn light off for 1 second, then turn it green for 5 seconds.

Of course this can be achieve with multiple calls of light.turn_on service but I think scripts would be significantly simplified and hopefully become more intuitively.

This could also be replaced with a HA-defined profiles or effects. But I think currently it only supports vendor specific names, right?

I just wrote this script that works pretty well. I concepted it for a buzzer, but it also works with any light or switch entity. It will also restore the initial state of the passed entity. This would just flash the light on and off with whatever color is was set to, but this could be modified to do colors, you’d have to parse the string to get the color settings.