Take a look at these two links. The first is to the entire thread. The second is to my finished project.
It works great. I can control it with the switch, the app, and via Alexa.