Xbox and Sharptools (via Alexa)

Hi all.

I’m slowly getting use to setting up my dashboard :slight_smile:

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.


1 Like

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.

1 Like

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

Alexa Routine:

Rule example:

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.:yum:

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.

1 Like

How do I use GitHub? I’ve never see this before, where would I cut and paste the code to?

I tried to enter the code into
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)

The following article seems like a good walk through on the whole process:

Here’s a few more links for reference, if you’re interested:

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.

i’m sorry guys, I still cant find the new switch in alexa

Have you linked your SmartThings account to Alexa? And did you try telling Alexa to discover devices?

yeah its linked do I need to take off the snartthings skill and load it back on?

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…

  • Samsung SmartThings: Settings → Connected Services → Amazon Alexa
  • SmartThings Classic: Automation → SmartApps → Amazon Echo

Failing that, then yeah, just removing the SmartThings Skill and readding it might be the easiest approach. :smiley:

I’m lost lol,

I’ve un-skilled the smartthings skill and re-enabled it still no joy,
I’ve asked alexa to discover my devices, skill no luck.

when I try to make a new routine under when nothing comes up under the smart home tab only Hue motion senor, motion senor, multipurpose senor.

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. :smiley:

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. :sunglasses:

I have the switch there now, but I cant find the xbox on alexa when I make a routine under the add action part

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.

my app don’t show all devices :frowning:

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.

You may also want to check your Alexa app version, and here is mine.

thank you
I have the routine working in Alexa now I can get sharptools to find the command to turn on the Xbox :frowning: