Most of my confusion stemmed from the fact that the IDE uses the term “Device Handler” and “Device Type” interchangeably. When a Device Handler is created and published (by you, the manufacturer of a physical device or someone else), it is automatically added to the Device Type popup that you use to add or change the Device Handler of a device in the IDE.
For physical devices, you can change their Device Handlers by editing the device and selecting a different Device Type. The only difference in this case is you have to create a “virtual” device in the IDE.
So, once you create and publish the Device Handler (using the included code), your Device Handler (called “Alexa Switch”) is now available as a Device Type.
You then create a New Device in the IDE (ie, a virtual device) and select the Device Type “Alexa Switch.”
At this point, your virtual device will show up in the SmartThings App. You can create as many of these “virtual switches” as you want.
Now, you have a physical device (your SmartThings button) and a virtual device (of type “Alexa Switch”), both of which show up in the SmartThings App. You then “connect them” by causing the physical button device to trigger the changing of the state (On or Off) of the virtual device.
In my case, I used an Automation via the “Smart Lighting” Smart App (because it allows triggering of actions). This allowed me to select an action of my physical button device (eg, double push) to trigger the changing of the virtual device state. I used the Toggle feature so I only needed to create a single Automation. In other words, a double-push of the Button will toggle the physical device between On and Off (and vice versa).
At this point, I followed the instructions (in the Wiki page above) to cause the Alexa App to recognize the virtual switch in the “Device” button when creating an Alexa App ROUTINE. In my case, I created two Alexa Routines for two different actions – one that is triggered when the virtual switch is “OPEN” and another that is triggered when the virtual switch is “CLOSED” (since Alexa thinks this is a door contact sensor).
So, when I “double push” my SmartThings button, this toggles the state of my virtual switch, which triggers the relevant one of my two Alexa Routines (eg, toggling a device On and Off). I did this to toggle a device (Kasa outlet) that Alexa recognizes, but is not compatible with SmartThings (though I am now looking at someone who created a Smart App to integrate Kasa devices with SmartThings).
Hope all of this isnt too confusing.