FAQ: Samsung SmartThings Button Works but Wont be Discovered by Alexa

Alexa routines don’t currently respond to a switch. I suspect that will be coming pretty soon, but it’s not here yet. ( The only physical button/switch that works to trigger them is the Amazon echo button. )

However, they can be triggered by a virtual sensor. See the article in the community – created wiki for the exact steps. :sunglasses:

http://thingsthataresmart.wiki/index.php?title=How_to_use_SmartThings_to_have_Alexa_do_something_without_speaking_to_it

1 Like

I did that, and followed the instructions in the Wiki (except for the code part, since I used the Virtual Device Creator).
Alexa now shows my Virtual Switch as a Device of type “Switch”

But, when I create an Alexa Routine and select “Devices” as a Trigger, I still get the same message:
“We were unable to find any supported devices.”

I even tried the disable SmartThings skill, log out/in Alexa account, then Rediscover Devices. Same result.

Am I missing something?

Yes. :sunglasses:

At the present time an Alexa routine can only be triggered by a sensor.

So as the wiki article explains in somewhat excruciating detail you have to create a virtual device which is both an open/close sensor and a switch. It will literally show up as two different devices in your things list, but it’s actually only one—a sensor that you can turn on and off like a switch.

The virtual device creator only creates virtual switches. Those won’t work.

The wiki article links to a post which has the code which you need to use. It’s in the subsection titled Code for a Virtual Device which will Show Up as Both a Contact Sensor and a Switch.

So just go back to the wiki article and follow the instructions as written. :wink:

You’ll end up with a switch which you can turn on and off in smartthings and a sensor which you can use to trigger an echo routine.

1 Like

I see.
I’m fairly new to using the IDE.

Am I creating a “device” or a “device handler” or both?
I see how to create a “simulated contact sensor” but not how to integrate that code.
Just need a little direction on the order of steps to create this device from the supplied code.

Surprisingly, I figured it out. Works like a charm.
Thanks very much.

1 Like

Good catch!

We have added the link to the “how to use custom code” FAQ to the wiki article. :sunglasses:

How did you figure this out? I added the Device Handler and published it, but I don’t know how to connect that to my SmartThings button

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.

3 Likes

Your explanation was really good. I guess on my end, the Alexa app isn’t working properly? It shows the Virtual Device and it’s description is Samsung Contact Sensor, but Alexa is classifying it as a plug/light.

My virtual device also has a description of Samsung Contact Sensor in the Alexa app.
As for the Type, you can edit this. I have a choice of Light or Switch. Not sure if it matters, but I selected Switch.

If you create a new Alexa Routine, select the trigger (“When this happens”), and then click on the Device icon, does your virtual device show up (or do you get the No Supported Devices message)? If it shows up, it should give you “open” and “close” options. If you get the No Supported Devices message, then you may have made a mistake in following the instructions on the wiki.

I tried that at least three times at first and it didn’t work. But I just tried it again now and it works. So weird but thanks for the help!

Happy to “pass it forward”
Glad it worked.

hi guys… first off thank you so much as this has really helped me get 99% there. It has been an adventure with 30+ different threads and wiki articles but I am sooooo close now…lol.

Here is my issue. I have my virtual device set up with the alexa switch handler. I have linked it to my samsung button and I can see them both in my smartthings app and I can see the virtual button in my alexa app. I haven’t seen my issue listed yet so please forgive me if this has already been explained…when creating the triggering in the smart lighting app I set it up to control the virtual button/alexa switch, action is to turn on, when my physical button is pressed, toggle action etc. When I hit the switch though it doesn’t toggle it. every other press of the button I can see on the app where it will trigger the switch off but immediately turn it back on. I can turn it off on the app and then turn the virtual switch back on with the physical button, but cannot get the virtual button to actually turn off via the physical button. Can one of you smartthings/alexa guru’s please help me out on this? thank you so much in advance.

I figured it out…LMAO… after having to sign in and out so many times and redo everything it turns out that smartthings removed my handler and reverted my virtual switch to a smart tv. Once I recreated the handler and assigned it again now it is working. Much thanks to everyone here and all their hard work on this. Truly awesome.

ok, so I have the single tap working no problems… Now correct me if I am wrong here but don’t you have to make 3 virtual switches for every real switch? one for single tap, one for double tap and a third for hold? I believe that is how it is supposed to work, and in the smart things app I have all 3 of the virtual switches turning off and on per each condition. they all show in in the alexa app as well. I am having an issue with having the double tap or the hold to actually trigger though. However I can hit the automation play in alexa and everything works, but they wont trigger from the condition of the virtual switches… can someone help me out on this please? thank you…

Edit after many circles run around on this… solution below.

Last post on this subject but thought that this may help others. So after setting up the single tap switch I set up the 2 other virtual switches. After setting them up alexa discovered them and was even able to use them as a trigger in the app but nothing would happen. All the posts that I read said that if your alexa app didn’t see them that you needed to log out disable the skill and re-login etc… but my app say them so I was going in circles because they were showing switching in the smartthings app and my automations were playing but they wouldn’t trigger… this was with 4 smart things buttons. turns out it doesn’t matter if the alexa app sees them or not, you have to log out and and do the disable re-enable skill for them to actually work. After looking at all the ones that worked on single tap and the other 2 virtual switches for each one I noticed on the switch details in the IDE they showed being used by the smart lighting app but not by amazon alexa. so if you are running in circles go back to the standard Comcast and AT&T advice of powercycle…lol… Do the disable, logout, login, and re-enable and you should be able to trigger with these. Thank you everyone.

Assuming you want each of the 3 different press types of the physical button (single, double, hold) to trigger distinct actions of physical Alexa devices (ie, devices that cant be controlled directly from SmartThings), then you are correct. You will need to create 3 separate virtual “Alexa” (door contact sensor) switches.

I used Alexa ROUTINES to trigger Alexa actions (eg, turning a Kasa outlet on or off) from my virtual switch – though I have yet to create multiple virtual switches.
I selected “Add action” to choose the desired resulting action.
I was able to select my virtual switch as a trigger for the desired action by pressing “When this happens” and then pressing the “Device” icon.

I couldnt find a toggle function in the Alexa app, so I needed 2 routines (one for ON and another for OFF).
But the desired action occurs not only when I press the physical button, but also when I toggle the virtual switch directly from the Alexa app.

I would assume this would work for multiple virtual switches, but I have yet to create more than one.
Hope this helps.

Hi, I followed these steps to the letter and created two device handlers. I removed the SmartThings skill, logged out of Alexa, then logged back in and re-added the skill. Still no luck! How did you get this to work on your end? Any help would be much appreciated! (Photo attached). Untitleddvfb%3Bdfmbfd|690x121

I’m not able to see your attached photo. Nothing happens when I click on the link (not sure why).
So, I cant tell exactly what part is not working on your end.

If you create a new Alexa Routine, and then select “Add action,” “When this happens” and “Device,” do you see anything listed (eg, the virtual switch you created)?

This is the key milestone.

If this doesnt happen, then you need to look back at the IDE and see if your virtual switch (eg, “Alexa Switch”) shows up as one of the Device Types (in the pop-up menu) whenever you create a new device.

If you give me a little more detail as to each step (sorry if this was in your attached photo), I might be able to provide more help.

Once you responded with that, it clicked for me why it wasn’t working! I had not gone it and edited the virtual device type to reflect the new Device Handler codes. I added it and now it shows up in my Alexa devices. Works beautifully! Thank you for giving me the aha! moment!

Glad it’s all working.