The following article seems like a good walk through on the whole process:
https://thesmartcave.com/smartthings-with-any-alexa-device/
Here’s a few more links for reference, if you’re interested:
-
RELEASE: Virtual Alexa Switch/Button
- The original release thread for the code James linked
-
RELEASE: Alexa Virtual Device Creator

- This seems like a neat alternative that lets you create Alexa Virtual Devices straight from your phone (once the SmartApp and DTHs are installed) and has some nice features like the Momentary Button that you don’t have to remember to turn back off.

- This seems like a neat alternative that lets you create Alexa Virtual Devices straight from your phone (once the SmartApp and DTHs are installed) and has some nice features like the Momentary Button that you don’t have to remember to turn back off.
It looks like you might have tried to add the code to the SmartApp section of the SmartThings IDE. You’ll want to make sure you’ve added the device handler code to the Device Handlers part of the IDE:
