Virtual Switch + Simple Dimmer Smart App

All I want to be able to do is dim my bulbs below 10% when I change to my Goodnight Routine. The Routine wont allow to dim lower than 10%. So a virtual switch + smartapp seems like the best solution. Problem is I dont know how to create said smartapp. Can anyone point me in the right direction?

Just use Rule Machine, it allows dimmer levels as any value.

This works. Thanks!!!