Xbox One control via OH

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:

5 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
1 Like

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.

1 Like

Why would start routine be checked. we’ve never linked something to it. After following steps, i see it but it’s not checked…what am i missing here?
image

Can’t get this working; routines work from alexa; in openhab the log states Routine Turn on Living Room Xbox One not found

Show us your config

Sure thing!

1st - when i did the first part; “start a routine was not immediately checked”
I had to put an item in an items file; not sure why that would immediately be checked.

2nd - i assume, when you say “chose simulated device” you mean the item on that page that is labeled “This device”…this is where i took the serial number.

image

image

This is what i added to an items file:
String Echo_Simulated_StartAlexaRoutine “Start Routine” (Alexa_Bedroom) {channel=“amazonechocontrol:echo:f214b540:Amazon Echo:startRoutine”}

I even linked a real echo to this and it still won’t work.

I finally got it working; however now the rules won’t work:

Configuration model ‘Test.rules’ has errors, therefore ignoring it: [14,18]: mismatched input ‘:’ expecting ‘end’

I’ve tried this:
amazonechocontrol:echo:8fcfadee:Richards_Echo:startRoutine.sendCommand(“turn on the living room xbox”)

And this:
sendCommand(amazonechocontrol:echo:8fcfadee:Richards_Echo:startRoutine, “turn on the living room xbox”)

Both have that log error above. What am i doing wrong now?

I use the Node-RED implementation of OH3. Works like a breeze for me.
There are two dedicated nodes I am using:

  1. node-red-contrib-xbox-on to turn it on
  2. node-red-contrib-xbox-smartglass to turn it off and do all other shenanigans

You should also be able to change apps on the Xbox with the smartglass node.

1 Like

Can you maybe share your exact setup, I am trying to control my xbox via openhab and be able to start games/apps aswell.

Is that possible with the setup you created ?


where should i click, to start a routine at a thing in openHAB 4?