Special Switch Template in Dashboard to mimic Modes

Looking back at my discussion with @william2 about this

and at your code above, I think your ON is trumping the OFF override, and changing them around would simply result in the off color being set all the time. I think if you want both colors overridden you need to be more specific and search for the exact color like is linked in my post above

utilizing the colors from the template in both searches, potentially for both on and off.