Optional alternative in case you are interested…
You may want to look at a community developed Edge driver for Hue. You can import scenes from the Hue app… so create a scene in Hue to dim your lights and import the scene into ST.
I don’t use Hue scenes so you may want to inquire in the linked thread.