Xbox One control via OH

Tags: #<Tag:0x00007fc2085db2a0> #<Tag:0x00007fc2085db048>

For the longest time I’ve used OH -> MQTT -> Eventghost on HTPC -> IR Blaster to control Xbox One from OH. This has always been a workaround as the Xbox didn’t have any network control.

Recently this has been more flakey, and I did some googling and found there is finally an Alexa skill for Xbox.

That page also lists a bunch of commands that can be used to control the Xbox via Alexa voice commands. This post is going to be about controlling it via sitemaps and Habpanel…

I am not aware of any other app or assistant technology that has access to the Xbox, other than Amazon Alexa, and to the best of my knowledge this has only been available since October 2018…

Now it’s possible to integrate my Xbox in OH using the Amazon Echo Control binding. @michi provides extensive examples of .things, .items and .sitemap files in his post. Here’s how to do it via PaperUI…

First, install the Alexa app on your phone (or open it up). Install the Xbox skill and authenticate with Microsoft account. It will appear in the Smart Home section in the app as well as ‘Your Skills’ under ‘Skills & Games’ once installed.

Second, create a routine to turn on and turn off the xbox using Alexa. I called mine ‘turn on the xbox’ and ‘turn off the xbox’, for obvious reasons :smile:

When creating the routine, choose Voice for the trigger and Smart Home then Xbox for the action.

Screenshot_20190816-083621

You should see them as below:

Screenshot_20190816-083455

Click the play icon and confirm that your Xbox acts as expected.

Third, install the Amazon Echo Control binding as per @michi’s instructions at this post.

Create an Amazon Account in PaperUI. You will need to follow @michi’s steps to authenticate at http://openhab:port/amazonechocontrol/ .

Once you have authenticated you should see an Amazon Account thing in your PaperUI things. Make sure it shows as ONLINE…

2

Next, create an Echo thing by going to PaperUI Inbox, click the + icon to add, select Amazon Echo Control binding, select ADD MANUALLY and then choose Amazon Echo.

You will need to select your Amazon Account in the dropdown Bridge Selection and then fill in the Serial Number from the http://openhab:port/amazonechocontrol/ page. I chose the simulated device created by this binding - this means you don’t even need a physical Echo to do this, just an Alexa account.

In PaperUI click on Configuration and Things. Find your new Echo device and click into it. Click on SHOW MORE at right.

Scroll down to ‘Start a Routine’ and make sure it’s checked.

3

You should now be able to find your device in the Control section and type your routine’s voice trigger. Click the checkmark icon and make sure it works…

4

Assuming all of these steps are followed you should now be able to power on and off your xbox. Obviously, you can also do so in rules, Habpanel etc… Will finish this post tonight to demonstrate.

Hope this helps someone else! :grinning:

Update:

items:

Switch xbone "Xbox One"

rules:

rule "Xbox Power On"
	when
		Item xbone received command ON
	then
		sendCommand(amazonechocontrol_echo_ddae4541_90F0071863150G7E_startRoutine, "turn on the xbox")
end

rule "Xbox Power Off"
	when
		Item xbone received command OFF
	then
sendCommand(amazonechocontrol_echo_ddae4541_90F0071863150G7E_startRoutine, "turn off the xbox")
end

habpanel:

4 Likes

So maybe an alternative that has its own complexities, but have you (or anyone else here) ever tried the Smartglass python scripts from the openxbox.org? This seems to do exactly what you are looking for, be it a bit complex…

From what I can tell, this may work:

  • using python, setup a REST server on a 3rd device
  • connect to xbox
  • connect OH to REST server

Hello,

i am new to Alexa and use it first time for the control of my xbox.

I connected my Xbox One X (Xbox Skill) successfully to Alexa an can control it with my voice without problems:

  • Switch it on
  • Switch it off
  • Start Netflix
  • Start Games

But in a rule with Openhab i can just start the routines to switch on or to switch off - because these are the only routines i could create in the Alexa-app. There i couldnt find any more commands than on/off.
Even separate routines for starting Netflix an so on are not avaible, i can start it with my voice and the app, but when i send the spoken command with openhab, i get the warning “routine … not found” in the logs an nothing happens.

This is the rule i use, any ideas how to fix this?

String Echo_Virtual_StartRoutine            "Start Routine"                         {channel="amazonechocontrol:echo:account1:echo1:startRoutine"}
rule "Xbox_Netflix"
when
	Item Scenes_Xbox received command "NETFLIX"
then
    Echo_Virtual_StartRoutine.sendCommand("sag Xbox netflix starten")
    createTimer(now.plusSeconds(1)) [ Echo_Virtual_StartRoutine.postUpdate(NULL) ]
end

Also the Echo thing i created at openhab (thing is online) is not shown as an device in the Alexa app:

Thanks, Alex

Hi Alex,
you must config these parameters from your OH Amazon Things.
You must configure your Amazon Account inside OH, after that, you can add your Echo as Thing.
At the configuration -> thing site, you can find your echo.
there is the line with your account ID and so on…
Or do you create a dummy? then you need this ThingsID and devicename.
account1 and echo1 are only samples…
Michael

Thanks for your reply. I dont have any real Echo devices, so i created a dummy thing that works fine for the on/off commands when i created the routines in the amazon account.

But the is no option to create a routine for starting an app or game or anything else. And when i use a voice command (with the iPhone App) the commands for starting an App are executed without Problems.

I understood, that the „startroutine“-channel simulates a Voice command, that is why i dont understand why it doesnt work with OpenHAB.