I would like to make some adjustments so that when I call the script from an automation I can specify the name of the color I want, and the script will convert it to a number. Something like this?
You may also want to look through some of the existing scripts and see if they already do what you’re trying to accomplish. It could save you some time unless it’s more about figuring it out for yourself, which I can understand. If nothing else, you can reference these for differences in their dimmers, switches, and fan / light combo devices, which use different values for the same effects.
I will look into those links, but you are right, a big part of this is figuring out how everything works under the hood so I can solve more complex problems down the road.