SmartThings Community

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


(Sidney) #2

Alexa will not discover the SmartThings Button.

There is no way for Alexa to ‘push’ a button. It is only meant to be a physical button.


(Eric) #3

I was thinking about the Alexa/Echo buttons, but apparently those are Bluetooth.


(Daniel Siegel) #4

I see. I was actually trying to use Alexa as a “middleman” so that the SmartThings Button would trigger non-SmartThings devices that are known to Alexa (eg, Kasa switches). Rather than implement the Kasa integration that I have seen online, I was hoping for a simpler solution – ie, trigger Alexa (upon recognizing the Button press via SmarThings) to control a Kasa device known to Alexa.

I created a SmartThings Routine which Alexa could discover (even though the Routine did nothing).
But I cant find a way for Alexa to perform an Alexa Routine based triggered by the SmartThings Routine.
Alexa has a “device” trigger, but it just says I dont have any supported devices (even though Alexa knows about my Kasa devices as well as my SmartThings devices).

Is there a way to accomplish this (without greater hassle than a custom Kasa integration – which would only solve the problem for Kasa devices, not other devices that SmartThings doesnt yet support)?


(sidjohn1) #5

You can use the Virtual Device Creator (Add a Smartapp -> +More ) and create a virtual switch.
Button push turns on virtual switch wich should trigger the Alexa routine.


#6

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


(Daniel Siegel) #7

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?


#8

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.


(Daniel Siegel) #9

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.


(Daniel Siegel) #10

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


#11

Good catch!

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


(Cristian Valencia) #12

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


(Daniel Siegel) #13

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.


(Cristian Valencia) #14

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.


(Daniel Siegel) #15

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.


(Cristian Valencia) #16

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!


(Daniel Siegel) #17

Happy to “pass it forward”
Glad it worked.


(Andrew Burnham) #18

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.


(Andrew Burnham) #19

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.


(Andrew Burnham) #20

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.


(Daniel Siegel) #21

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.