I suggest you try using the Light integration’s transition option.
transition
If your light is unable to support this feature natively, then I suggest you use this script: