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.
@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.
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.