UPDATED 12/13/2019: Please read the comments section. For some currently unknown reason this tutorial seems to work for some people but not for others. If you have any insight into why, we’d love to hear from you.
Many smart home products are compatible with Alexa, but far fewer are directly compatible with Samsung SmartThings hub. The SmartThings’ automations are more powerful so wouldn’t it be great if we could link these two universes together?
This tutorial will teach you a method to make any device that can be controlled by Alexa also be controllable by Samsung SmartThings.
Recently, Alexa added an option that allows certain types of sensors to trigger Alexa routines (this only works for people in the US and UK…don’t ask me why that is).
The method in this tutorial takes advantage of that option. It let’s you trigger an Alexa routine with basically any SmartThings action instead of just the sensor trigger. It may seem like it’s a bit of a hack (because it is), but it works well. And, in my experience it’s quite reliable.
Here’s the method in a nutshell:
- Create a virtual switch/sensor in SmartThings
- Create an Alexa routine that is triggered by the virtual sensor. The Alexa routine will send a command to the device you’re trying to control.
- Create two SmartThings automations that turn the virtual switch we just created on or off.
The SmartThings automation triggers the virtual sensor, which in turn triggers the Alexa routine which sends the command to the device. Simple, right?
You will need:
- Samsung SmartThings Hub
- an Alexa speaker with Alexa app
- a SmartThings connected “trigger” device
- and an “action” device that can be controlled by Alexa.
If you follow this tutorial, you should be able to have your first routine up and running in about 20 minutes. After that, creating more only requires a couple minutes each.
1. Create the Virtual Switch/Sensor
Go to the following page:
Select all text (ctrl-a) and copy (ctrl-c). Then paste (ctrl-v) to your New Device Handler
Go to https://graph.api.smartthings.com/ Click on Login in the upper right hand corner.
Then, sign into your Samsung account. If you already have your SmartThings set up, you should already have a Samsung account. If not, you’ll need one.
If this is your first time, you’ll have to agree to some terms and conditions by checking a box. Then, click Next.
Eventually, you should end up on a screen that looks like the screenshot below. Click on My Device Handlers.
This will take you to your list of device handlers. We want to Add one now.
Next, you should see the Create New Device Handler screen. We are going to use some code someone has already written so we want to create From Code.
The code we are using will create a device that will be a virtual switch and contact sensor in one. When you turn the virtual switch on or off, the virtual contact sensor gets automatically turned on or off by the switch.
Luckily, there’s all kinds of generous people in the SmartThings community that create custom code and share it with us for free.
To get the code, go to the following page: https://raw.githubusercontent.com/bjpierron/SmartThings-Alexa/master/devicetypes/bjpierron/simulated-alexa-switch.src/simulated-alexa-switch.groovy
Select all text (ctrl-a) and copy (ctrl-c). Then paste (ctrl-v) to your Create New Device Handler page.
Scroll to the bottom of the Create New Device Handler page and click Create.
This will create a SmartDevice named “Simulated Alexa Switch”. You should see the green “Created SmartDevice” message. Before you can use it, you’ll have to publish it, so click Publish.
If everything goes as expected, you should see the green “Device type published successfully” message.
Next, we need to create the device that will use the device handler we just added. Click on My Devices in the top menu bar. Then, click New Device in the upper right corner.
Then, you’ll have to fill in the required blanks. I named my device “virtual switch” but you can name yours whatever you want.
When you select “Type”, you want to select “Simulated Alexa Switch”. It will be all the way at the end of the pulldown list. This tells SmartThings to use the code we just published for this device.
Once the appropriate blanks are filled in, click the blue Create button to create your device.
Now, check to make sure it worked. If you click on My Devices, you should see a list of your devices which should include your new device.
Great, the device is created. That’s all you need to do here.
2. Create The Alexa Routine
Next, we are going to use the Alexa app to create a routine that is triggered by the new virtual device you created.
First, Enable SmartThings Skill
If you don’t already have the SmartThings skill enabled in your Alexa app, you should do that now. This will allow your Alexa app to see the virtual device you just created.
To enable the SmartThings skill:
- Open your Alexa app and select devices from the bottom menu.
- Then, select “YOUR SMART HOME SKILLS”.
- Press “ENABLE SMART HOME SKILLS”.
- Next, search for and select the SmartThings skill.
- Finally, press “ENABLE TO USE”.
Create New Routine
For this routine, you will use the virtual switch closing as your trigger and any action you want for the action. Here’s how I did mine:
- Go to the main menu in the Alexa app and select Routines.
- Press + to create a new routine.
- Press + next to When this happens.
- Select Device.
- You should see the name of the device you just created. Mine is virtual switch. Select it.
- You can choose to activate the routine when the switch either closes or opens. I am going to choose Close. Then press SAVE.
- Now select Add action.
- Select Smart Home.
- Select Control device.
- Select the device you want to control. I have an Amazon plug that controls some LED strip lights in my living room. It’s called Up lights.
- I’m going to use this routine to turn those lights on. Press Next.
- Press Save.
That’s all you need for now with the Alexa app.
3. Create SmartThings Automations
We are going to create two automations in the SmartThings app to make this work properly.
The first automation will be the automation you use to trigger the Alexa routine you just made.
It will close the virtual sensor (which triggers the Alexa routine) when my living room motion sensor senses motion. You can choose anything you want in place of my living room motion sensor, but the rest should stay the same.
The second automation will reset the virtual sensor. Without this second automation, the first automation will only work once. The virtual sensor would basically be stuck closed and it would never trigger the Alexa routine again.
First SmartThings Automation
Our virtual switch/sensor that we created works like this: when the switch is turned on, the sensor is open. when the switch is turned off, the sensor is closed.
Now, remember that we set our Alexa routine to trigger when the virtual sensor “closes”. That means our SmartThings automation should turn the switch off (which closes the virtual sensor) to activate the Alexa routine.
Don’t think too hard about it. Just follow these steps and it will work.
To create the first SmartThings automation, open the SmartThings app,
- Select Automations from the main menu.
- Then, Add automation.
- Then select Custom automation.
- This brings you to the custom automation screen. Select + under the If section.
- Choose Based on a device status.
- Scroll down to find the device you want to trigger this action. For me its my living room motion sensor which is just named Living Room.
- Then, I select the trigger conditions for my device, which are detect motion and detected. Yours may be different depending on the type of device you choose. When you’re done, press Next.
- Now let’s add the “Then” part of the automation. Press +.
- Select Control a device.
- Find and select the virtual switch in your list of devices. Press Next.
- Select the virtual switch which should now be displayed under the Then label to change the options.
- Select off so that the virtual switch turns off when motion is detected. Push Next.
- Click Save. Automation 1 is done.
Second SmartThings Automation
This automation will reset the virtual sensor back to the open position so it’s ready to be triggered again by the first automation.
- Press + to start a new automation.
- Select Custom automation, which bring us to a clean custom automation screen.
- First add the If condition.
- Again we want Based on device status.
- This time we choose virtual switch.
- Select the Contact sensor, closed condition. Then press Next.
- Now add the “Then” action. Press + under the Then label.
- Select Control a device.
- This time select the virtual switch again and press Next.
- Select the virtual switch to adjust the settings.
- Make sure the action is set to On. Then turn on the option to “Select how soon to start the action after the conditions are met”.
- Choose 10 Seconds. Press Done.
- Then, press Save and the second automation is done.
Final Thoughts
Now all that’s left is to test it out.
I know that was a lot of steps, but I try to be really thorough in case anyone who is completely new to this is reading. I promise once you do it a couple times, it only takes a couple minutes.
You should be able to repeat this process as many times as you want for any device that can be controlled by Alexa.
Anyway, I hope this was helpful and thanks for reading! If you have any questions, feel free to drop a comment below.
Nice guide but how do I turn off a device with this process? Do I need a separate virtual switch dedicated for turning it off?
Great guide. Is this still only available in the US and UK? I’m in Canada and the virtual device is not showing up in Alexa. Also can we just use the Create Virtual Device feature on the ST Classic app?
Nice instructions. Worked first time. The step I was missing was the Device Handler and that did the trick. Thanks for allow most of my devices to now work through Smartthings.
For some reason, it will not allow me to create the routine. It just gives me the error “There was a problem creating this routine”. Could Amazon shutdown this work around?
I believe there is a problem with Amazon’s latest update. See this forum thread: https://www.amazonforum.com/forums/devices/echo-alexa/520760-there-was-problem-updating-or-creating-this
Hi. Have been following this guide for months had no trouble with any of the steps but now it’s not allowing me to create the right automation in smartthings…the Alexa routine works when I play it in the Alexa app but when I create an automation in smartthings I select control a device, select my newly created virtual switch and choose when set to on, go next, and then the device wont appear in the list.
To be sure I wasnt doing anything wrong i referred to this guide again and i am following the correct steps.
So I went back into my automation that I created beforehand that do still work and it wont let me edit them, the ‘if’ automation works, but the ‘then’ automation doesn’t recognise it as a simulated Alexa switch so I cannot assign it. Is there an update to the DTH? I’ve checked my IDE account and all the devices and the DTH are still there so just wondering why this is no longer working? Is there a known issue or a workaround? Many thanks in advance.
Eric,
This is a really cool automation! Thanks for all your work on this. I do a lot of automations as well. I have a website and Youtube channel that explains some of my routines.
Recently I purchased a 4k Fire Stick because I discovered that having a 4K TV does not enable one to steam Amazon Prime content in Ultra HD. I discovered that one needs a 4k Fire Stick to stream available content in Ultra HD.
When installing the 4K Fire Stick I found that I had the option to pair my Onkyo receiver, to be enable it to be controlled, (on/off & volume) via the Fire Stick. This is really cool because now I no longer need multiple remotes to turn on and off my LG TV and Onkyo receiver in order to stream content. I simply hit the “on/off” button on the Firestick and the TV & receiver turn “on” or “off” simultaneously. Additionally, the TV input is automatically set to HDMI1 and the audio output is set to optical in order to feed audio to my Onkyo receiver
Then I noticed that my Onkyo receiver was showing in the list of smart devices on my alexa app. This caused me to speculate whether I might be able to control the receiver with SmartThings. I then began searching for a way that I could get my SmartThings hub to recognize the Onkyo receiver. Thus I found your article.
I still am not sure that your setup will help me. I got stuck at the SmartThings setup as I am still using the Classic App. I set the ‘virtual switch’ that you help me create as a Virtual Device in the Classic App and brought it into the Alexa App as a skill called “Basement Group” I figured I could just tell Alexa to turn on Basement Group and all the devices, (including the Onkyo receiver) would turn on. However it appears my logic appears flawed. Do you think that a dumb device like my Onkyo Receiver can be automated? If so, perhaps my setup in the SmartThings Classic App need to be altered. Can you provide setup instructions for the SmartThings Classic App?
If you can create a routine in the Alexa app to control your device, this procedure is basically a way to access that routine in SmartThings. I have not used the Classic app in awhile.
Thanks for the guide, I am wondering will this work for the Samsung buttons? I can get the “Open” to work just fine, but I cant get it to work when I want it to “Close”
Thanks!
This guide works great for one-way automation. when my wife uses Alexa to turn on the plug, how do I get the updated device status to show in Smartthings?
Hi Ken;
I have created a light group in Alexa for each wifi device/light that includes both the device and the virtual device. Now when I ask Alexa to turn on Kitchen, it turns on kitchen light and also turns the virtual device for kitchen in Alexa and ST. Is not an elegant solution, but it does work.
Unfortunately, you are correct. It is only a one-way automation.
I am more than a little confused. It seems the intent of this article was to show how to control non-Smartthings compatible devices with Smartthings via Alexa as the man-in-the-middle. But you go on to show how to control a light that is in your ST app. I cannot seem to make this work for a simple Insteon lightswitch using your method. What am I missing?
I agree with Blaine P, this works for things you already have in ST. I also thought this article was related to connect devices from Alexa that are not in ST.
The example shows how to control a light that is only in alexa with a motion sensor in SmartThings. With this tutorial I was able to use the arming/disarming of Smartthings Home Monitor to have my echos tell me armed or disarmed. I was also able to run a Smartthings automation to have my echos tell me “the siren will sound in 30 seconds, 29 seconds…” when I open a door when the smartthings home monitor is armed.
James, would you share a little more. This is exactly what I am trying to accomplish. I installed a Konnected alarm system to convert my old alarm system. It uses STHM to arm and disarm, etc though I added a third party app called Intruder Alert With Actions. I finally I think I have that set up. I have Fire Tablet with Action Tiles as my control pads wall mounted. Now I am trying to use Alexa just as you have described.
Erik, I too have Konnected panel – I’m using Sharptools but setup should be essentially the same in Action Tiles; If you already have A Tiles set up to work with STHM, you must have already created Simulated Switches – if these were set up in your ST IDE as Alexa Simulated Switches, then they should appear directly in Alexa. So just ensure you have Alexa Simulated Switch selected in ST. What I also discovered was that there is no way to pin protect the ‘disarmed’ command in Alexa (so anyone can say disarm even from outside if an Alexa device is within earshot); a way around that is that make your disarmed ‘switch’ a simulated LOCK – then you can add a voice pin to that command to disarm
Thanks for the information. With your Alexa does it work to count down time to arm or time to alarm sound after intrusion? I am learning how far behind I am now in being tech savy. I just went through installing Echo Speaks only to learn it no longer is supported with SmartThings.
Every time I try to create the device I get the error
“Access Denied
We’re sorry, but you are not authorized to perform the requested operation.”
Any Ideas?
It may be a browser caching issue. If you’re using Chrome, try it using an incognito window.
Hey this is an amazing article, but i am having a little problem please. I created the Device Handler, and published it (to me) all green and ok. But then the “Simulated Alexa Switch” does not appear in my TYPE drop down? What have i done wrong please, thanks 🙂
found it, it was right of the bottom of the long drop down list, not in alphabetical order . All working now, AMAZING, just what i have been looking for. thank you
Second SmartThings Automation step is not valid anymore. Poster Grant states the problem.
The dth no longer is treated as a dual device in the Automation wizard. It only sees “on” and “off” not both open/closed and on/off. Therefore you can’t close the virtual sensor in smarthings automation.
So barring someone figuring out a workaround this is now a defunct guide 🙁
Maybe it’s possible with webcore. But I prefer not to add that complexity.
This is a strange problem. It appears to still work for some people, but not for others.
My original virtual switch/contact sensor and their associated automations which I made months ago are still working just fine.
However, I just tried to create a virtual switch/contact sensor using this method and ran into the same problem you are describing.
Were you able to solve this problem? This is where I am stuck and cannot figure out what to do next.
Thanks
The workaround is to recreate the 1st automation as the 2nd automation and put a delay on the “off” command.
1. Create 1st ST Automation (as described in this howto guide) which turns the virtual switch off, i.e. closes the virtual sensor
2. Create 2nd ST automation:
2A. If condition: Device status same as 1st automation. In the example, this was “living room motion sensor: detect motion and detected”
2B: Then: select “Virtual switch”. Select “on” (instead of “off”). Turn on the option to “Select how soon to start the action after the conditions are met”. Choose 10 Seconds. Press Done.
So basically, since the virtual switch can no longer be selected for the 2nd automation, we use the same trigger (motion sensor) to start both automations. So the howto guide is still good to go.
Hope that helps.
This still doesn’t seem to work. The challenge is not the virtual switch side, but rather the virtual sensor side. It doesn’t seem to be recognizing the virtual sensor properly. Mine is created, but permanently stuck in the “open” status.
Thanks for the guide. Would be great to get it working. However I already get an error when trying to create the smart app with the custom code for thr virtual switch. Thw error I get is:
No signature of method: script_app_metadata_2e20a7e4_4cb2_4f36_ac31_3304bf296966.metadata() is applicable for argument types: (script_app_metadata_2e20a7e4_4cb2_4f36_ac31_3304bf296966$_run_closure1) values: [script_app_metadata_2e20a7e4_4cb2_4f36_ac31_3304bf296966$_run_closure1@654201e8] Possible solutions: getMetadata(), getState(), setState(java.lang.Object), metaClass(groovy.lang.Closure)
Anyone any ideas? Thanks for your help!
I’ve been able to make this method work, but also have the problem of reporting status back to SmartThings. While I understand the method of using a group in Alexa that sets/resets the ST simulated switch, that doesn’t work if the device is controlled by a third party app. What I’m looking for is the ability to report back to ST when a device is on (e.g. a pool light) when it was turned on by its own native app, rather than by Alexa or by ST. Can this be done? If so, how?
Thank you Eric for the excellent tutorial!!!
Is there a way to do the same for “dimmer switch”? Please!
Thanks
I did this today and everything worked. Couple notes:
1.) I did not need a hub– everything was virtual.
2.) I didn’t do anything with SmartThings automation.
3.) At first the Alexa app gave me an error when trying to use the virtual device. I logged out of the app and then logged back in and everything worked fine.
These switches are amazing! It lets me use IFTTT automation with my Amazon Smart Plugs.
Walter
In response to your question: ” What I’m looking for is the ability to report back to ST when a device is on (e.g. a pool light) when it was turned on by its own native app, rather than by Alexa or by ST. Can this be done? If so, how?” The answer is YES if the “native app” supports integration with any one of the following: Alexa, ST or IFTT.
I’ve been working on the following use cases and have got them working.
Use cases
1. A ST device which needs to be controlled by Alexa or Action tiles . I.E. Voice or graphics push button controls
2. Devices which don’t have ST support which needs to be controlled by Alexa or ST and/or Action Tiles
3. Both ST and non ST devices need to be controlled together as a group I.E. Lights, plugs contact sensors or fans from different vendors
4. Non ST supported devices which needs to control ST devices
5. The device doesn’t have IFTT support or is taking too much time in IFTT. Which can be controlled and responds faster in Alexa
6. ST Automation or Alexa Routines are needed and the product doesn’t support it natively
7. Non ST devices need to report status to ST or Action Tiles
8. Any device can report or announce status changes (or state) via Alexa Echo’s
This is now finally available due to the new Smartthings “automation” and/or the Alexa Echo “routines” functionality which have been released in the last few months.
So, if your “pool light native app” has an Alexa skill, an IFTT integration or a ST IDE Smartapp, then it’s definitely possible. What’s your “pool app”?
So far, I’ve been able to get Wyze (Contacts, Plugs, Lights, Cameras, Motion Sensors), Bond (Ceiling Fans and Lights), MyQ Garage Door Controls, X10 Devices, VeSync Plugs, Harmony, Honeywell Thermostats, Magic Home/Magic Light (LED and Color Light bulbs) and Honeywell Security all working for the Use Cases above. The key is there has to be support from the native app for at least one of the following apps (ST, Alexa Echo, IFTT).
As for the “how”, that I’ve been writing up and expect to be done in the next week or two. But if you let me know your specific use case and what the “native app” is, I may be able to provide a suggestion sooner.
Hi Vernon … Thanks for this. Did you ever get your write-up done and posted? If so, where?
My use case: I have a ST Button and a ST Hub (v3) with the latest apps for ST & Alexa. I would like the Button to trigger an Alexa routine. Sounds simple, but seems not to be. Any help is greatly appreciated. Thank you!
I can’t stress enough how many different things I tried to make this work. I was one of those that followed the steps exactly and had no luck. The solution was to disable my Smartthings Alexa skill and re-enable it within Alexa. I was worried this may delete all routines but there were zero negative affects whatsoever. I’m now using this to control sonos playlists (with automatic shuffle which is ONLY available in Alexa) and Sharptools tiles to trigger the actions.
In the event anyone is wondering how to automatically turn on the shuffle mode you type the following in the Alexa music routines Play command:
“Shuffle playlist playlist name in the group name group” So in other words “Shuffle playlist rock in the living room group”
Fantastic Guide! Too bad I can’t get it to work, lol. I’m trying to get a Z-Wave switch to control my Haiku ceiling fan and light.
I have all of the pieces working. The virtual switch in ST is fine. I flip my Z-Wave switch and watch the virtual switch turning on/off in the Alexa app. That means I’m getting from my wall, to ST, to Alexa just fine.
I can manually “play” the routines and my light turns on and off, but for some reason Alexa won’t fire the routines from the virtual switch triggers. Argh!
I am really confused. If something already works with Alexa, what will be the benefit to me of changing it to work with SmartThings? Why should/would I make this switch? The old adage of “If it ain’t broke don’t fix it!” keeps ringing in my head. Maybe I don’t fully understand and that’s why I am asking this question – not to be argumentative but to expand my understanding of where/why SmartThings would benefit me.
Using SmartThings allows you to create more complex automation.
This is exactly what I was looking for a long time! Location based control of my devices that are already working with Alexa. Smart Things has location based routines that will trigger Alexa to do things with this virtual switch. (In Germany Alexa doesn’t have location based triggers like in US unfortunately)
Attempting in March 2020; at the create routine step where you are supposed to set “When this happens”, it is not possible to select the virtual switch since it says “Error this device is not currently supported”. Is this method dead now?
Confirmed that this is also a problem for me ^^^^^^
Hi guys,
It’s a great guide but although I live in Uk and I can create the virtual switch on amazon, when I’m going to create the routine it returns an error ” this device is not currently supported”, so unfortunately I can’t do that.
Any suggestion updates ?
Thanks Eric, it works perfect, I add one routine to turn on and other to turn off as I am creating a switch in smartthings, it works on Mexico. now I am looking to get the information back to smartthings whe alexa (or phisically) turn on/off the device so I can see on smartthing if is turned on/off. but anyway works perfect!
Good to hear!
Hi Eric. Love what you done here.
I want to take this one step further.
It’s a bit involved. I want a door to trigger a flashing LED trigger. (I’ve done that with IFTTT) The trick is those LEDs are off until sunset. And they are set with different daily Routines in Alexa for each day of the week to a specific color and they are only on from Sunset to 11:30 PM. That door trigger sets the LEDs to red/flashing. But I want them to go back to their previous state. Depending on the time of day, that could be off or on to the daily routine with that specific color.
Where I’m stuck is the close door action. Trying to get the routine(s) to either turn the lights off or go back to the color routine for the specific day. Not sure if the condition criteria lies in one or the other or both Alexa and Smartthings. Thoughts?
Wow, that’s getting pretty complex for only using the standard apps. I would look towards using a custom coded solution with webcore and SmartThings.
I’ve been wondering how to control some wifi lights that aren’t compatible with SmartThings. This worked the first time, and now I can control the wifi lights with a SmartThings remote button switch. Sometimes you don’t want voice control only.
Thanks a ton!
Is there a way to create a new sensor in the ST app. I don’t like having to use the IDE everytime I have to create a new VD.
Thanks
This was super useful. It allowed me to get a smart outlet by Teckin to be controlled from my Brilliant light switch. There’s no native integration between the two but this worked great.
Awesome. Glad it helped!
Whenever I attempt to add a new device I am required to provide a location and hub but the drop downs are blocked.
Any suggestions?
I remember having this problem, but for the life of me I don’t remember how I solved it.
If you didn’t figure this out yet, you have to select your location in the My Locations tab, then it should show up as an option in the New Device section.
Samsung responded to my mails and provided a different URL than in the blog.
Used it with no issues and had success.
This is what they provided to me:
https://graph-na04-useast2.api.smartthings.com/
Just want to say thank you for this! I’m new to all of this and without your guide, I would not have been able to control these lights in the way that I need to
. Thank you!!
You’re welcome. Glad I could help!
When I try to create virtual switch in SmartThings, it says I need to list a hub or location, but it won’t let me enter anything in those fields.
The virtual switch / button I created with your code seems to be permanently stuck in the open position. I’m using a brand enw SmartThings Hub v3 with the newest app and the new Alexa skill. Any ideas regarding where I can look for the problem?
Works great, thanks for the information. Used WebCore once the Alexa Routine was created.
I fall on the doesn’t work for me side. Alexa knows the status of my virtual contact when quizzed verbally but has no response to a change when I use the virtual device in a routine. The real puzzle (to me) is that IFTTT does respond to a change in the device.
???
Excellent tutorial. However, when my ST automation triggers the virtual switch (or even if I trigger it manually) it is not recognized in the Alexa routine. The switch shows triggered in the device list in the Alexa app (and ST) but it doesn’t trigger the Alexa routine. I can trigger the routine manually in the Alexa app and it completes the task just fine. It seems there is some disconnect between Alexa recognizing the virtual switch has been triggered and that enabling the Alexa routine. I’m stuck, any thoughts?
Hello,I followed your instructions carefully, and when I run a test, in smarthings, it seems to be functioning well. (I press my smartthings button, and I can see virtual switch close, and then open after 10 seconds)
In alexa, I can also see the switch turning off when I push the smartthings button (this is what triggers the virtual switch), and then turn back on again.
However the routine doesn’t trigger. Ive tried reversing the closed/open trigger just to test, but still nothing. If I run the routine manually, it operates.
Not sure what I am missing.
SmartThing Motion Sensor (to) controll Sonoff Switch Relay –
1. Followed your steps & was able to turn on the VD “Sonoff relay”
2. In the ST app, I can see the “ST Motion Sensor” trigger and the VD turn off (which turns on the light).
3. After 30 seconds, the VD resets as described above (but) it doesn’t (Turn Off the Light/Sonoff relay)?
Fix: The only way I could turn off the light/sonoff relay was to go into:
* Alexa App
* Routines
* Add Action (Listed Above): Sonoff Light Switch (Power On)
* Add Action (Not Listed Above): Wait 5 Minutes
* Add Action (Not Listed Above): Sonoff Ligtht Switch (Power OFF).
I hit a wall. On the 1st Smartthings automation, Smartthings is not listing my device. Where did I go sideways?
The same person who wrote the Device Handler for the switch also wrote a momentary button code. So it will trigger on and then reset to off by itself. Just use the code at the link below instead of the link to code in the article.
https://github.com/bjpierron/SmartThings-Alexa/blob/master/devicetypes/bjpierron/simulated-alexa-button.src/simulated-alexa-button.groovy
I have everything set up using an Aeotec button to open and close the simulated device. In Alexa, I do see the switch going from on to off when hitting the button, but apparently it is not firing the open and close events because the open and close routines are not firing. I can test run the routines fine. This article is a year old, has Amazon updated their software to take only one event?
Can a SmartThings Hub alternative be used like the aotec?
https://www.amazon.com/dp/B08TWDNQ5Q/ref=cm_sw_r_cp_apa_glt_fabc_2VD2RTSNQYPGA8BMPCBY
Everything seems to be working but I can not create an automation in SmartThings for the virtual switch, it is not listed as a Control Device option. I do not have a SmartThings Hub, it that a requirement?
If trigger don’t fire, disconnect and reconnect SmartThings account on Alexa. It works for me.
Hi,
I was looking for a way to have a device report its current status back to ST. This device is an air conditioner with a WiFi module and which native app (NetHome Plus) supports Alexa, but not ST. Looking at a post by Vernon, back in January 3, 2020, it seems it is possible.
I currently have a Simulated Alexa Switch configured in ST and an Alexa routine using this switch as trigger. This allows me to power on, off and even change the temperature of the A/C.
The issue I am having is when the A/C is turned on or off using the IR remote controller, the status of the A/C is not been reflected in ST.
The A/C appears as a thermostat in Alexa and the current status is reported as I can see it changing from off to on and vise versa even when using the IR controller. I tried creating a routine to toggle the switch back in ST when the status of the thermostat changes, but the thermostat is not showing up in the “When this happens” section of the new routine.
Is there a way to make this work? I hope anyone here can help me.
Thank you,
Israel
Thanks for the detail guide! It works great! Although steps/pics of steps in Alexa App is slightly different after 2 years. It still works!!!!
There is an option in SmartThings app to create a Virtual Switch, I created one and added it to Alexa, but I can’t find it in “When this happens” section while creating a routine. Do I still need to create a Simulated Alexa Switch to act as a trigger for a routine ?
This worked great, but will this still work with the new Smartthings platform starting January 2023? Thanks
On the “My Device Handlers” page, there is no option anymore to add one.
These were great instructions! I had set up a SmartThings (ST) virtual switch (via in the now old IDE Groovy) to trigger when my mailbox was open and closed (I added a small NC switch to the mailbox door and wired it to a re-purposed water sensor that I had). I was able to then create an opened and closed Alexa routine and select the Virtual ST switches from the list of Alexa devices. So, when the mailbox was opened I received a ST text message that turned on an Alexa Glow and also a Feit color smart bulb (Smartlife connected) couch light turned on for for 5 seconds… life was good for a time.. Then Smartthings recently sunset IDE Groovy and the Alexa routines stopped working. Once I figured out what happened, I was able to create a new virtual switch for opening and closing the mailbox in SmartThings Labs in their application. The challenge I am currently facing: when I go to update the existing Routines (or even create new ones), Alexa asks me to select a device from the routine’s smarthome device list, but I do not see the new SmartThings virtual device listed. it seems that Alexa now only shows me a subset of all my Alexa connected devices which seem to be only my Alex devices. I’ll keep playing and hopefully will figure it out, but for now, I’ll have to settle for having a ST automation turn on some zwave connected light switches.