I’m looking to make a button for my Xbox. I have the Xbox connected with Alex so when I say Alexa turn on the Xbox she will. I’m looking to set up a rule so when I push the button on my dashboard it will, Turn on the Lamps in the front room to green, turn on the tv LED’s to green, and turn on the Xbox.
Are you able to control the lamp, TV led & Xbox through SmartThings or Habitat? If yes, then it’s a pretty easy to create in Rule Engine to automate with a single button press.
@Robert_Farley, you can first create a simulated Alexa switch in SmartThings/Hubitat using the this community developed DTH, add it to Alexa, and create a routine in Alexa app to turn Xbox on when this simulated switch is turn on. Then you can create a rule in SharpTools to turn the lights to green and turn this simulated switch on assuming the lights are connected via SmartThings/Hubitat. No need to use a trigger here if you plan to add this rule as a tile to the dashboard, since it will be triggered by tile tap.
Note: regular SmartThings virtual switch cannot be used to trigger Alexa routine, as it doesn’t support ‘switch on/off’ as trigger, but only sensor. So this Simulated Alexa switch` basically added a contact sensor capability and mapping the open to on and closed to off, so its open/closed status can be used as trigger in Alexa routine.
Or as @Robert_Bourne mentioned, if your xbox is connected to the hub through custom DTH, you may be able to skip the Alexa routine step, but I haven’t tried any Xbox DTH and don’t recall if there’s a popular one off top of my head.
Correction: Added the 5 seconds delay and turn the simulated Alexa swithc back to off in the rule flow, since it’s not a momentary switch and won’t turn itself back to off automatically. So it can be ready to be turned on again. Thanks for @josh reminding.
I tried to enter the code into https://graph-eu01-euwest1.api.smartthings.com
this is the error I get
×
No signature of method: script_app_metadata_b5e49dd4_fd1d_4684_a402_58cf182e3559.metadata() is applicable for argument types: (script_app_metadata_b5e49dd4_fd1d_4684_a402_58cf182e3559$_run_closure1) values: [script_app_metadata_b5e49dd4_fd1d_4684_a402_58cf182e3559$_run_closure1@57c9e649] Possible solutions: getMetadata(), getState(), setState(java.lang.Object), metaClass(groovy.lang.Closure)
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:
I’ve added the code, under my device handlers I see the new switch. but when I make a new routine in Alexa I can’t see the switch. under the when this happens I have voice, schedule, smart home, alarms, echo button.
If it’s a brand new device, you may either have to tell Alexa to discover new devices (or relink SmartThings to Alexa making sure to authorize the new device) before it will show up in your Alexa App.
It should show up under Smart Home with the other devices you’ve authorized from SmartThings.
FYI, I updated the rule flow in my post above to turn the switch back off automatically 5 seconds later so it can be re-turned on again like a momentary switch.
Sometimes you literally have to tell Alexa: “Alexa, discover devices”
Depending on how you first configured things when you setup the SmartThings Skill in Alexa, you may have either authorized ALL devices or authorized individual devices.
If you authorized the individual devices (rather than allowing it access to all devices), you may need to update those preferences. Depending on the app you use…
We’ve all been there! This stuff all feels a bit confusing at first, but it’s worth the effort! And it gets easier once you’ve done it a few times.
Just to make sure, after you installed the code in the My Device Handlers section of the SmartThings IDE, did you create a new virtual device under the My Devices section of the IDE?
Here’s a short (audioless) video of me walking through the process of creating the Device Handler and then creating a virtual switch:
PS. Maybe @Justin_Newbury from SimplySmart123 will make a video showing how to create and use Virtual Alexa Switches at some point - he does an amazing job making stuff like this easy to understand.
In add action, tap “Smart Home” → “All Devices” → scroll down and your Xbox should be near the bottom of the list. If you cannot find it in the Smart Home list, and the “Devices” tab at the bottom of the screen. you may need to re-link your xbox through the skill.
This is what I see when adding the device in “add action”, and I can see my xbox in the “Devices” tab page when tap the bottom right corner Devices button.