Hass.io Add-on: Xbox One

As mentioned in the release notes and the comments just above yours.

If you want some form of launching apps/games from this you need to use the xbox feedback to tell microsoft directly as the dev has no control over this anymore. It used to work a very well but MS removed it in the console itself.

xbox request is where feedback is given, enough people make a request for this and MS may build it.

1 Like

heres my suggestion this week

Add to it, upvote it, make your own, just more visibility the better for all.

Thanks! What sort of stuff do you use this integration for at the moment then would be nice to see anyones config uses.

Personally I just have it as part of a universal media player that combines my Sky Q box, Xbox One X, Nvidia Shield TV and Sonos Beam into a single entity rather than having one for each, also gives a nice reason to have my harmony hub integrated.

Any code or tips for this? Not seen multiple media players in one before?

As all setups are unique I canā€™t really say how you would get yours setup but if you look at the integration its all detailed there.

Has there been any update this is quite unreliable now works ok two show Xbox on and can turn off but only 50 50 is it can turn it on.

Iā€™m seeing the following in my Xbox One log:

-----------------------------------------------------------
 Hass.io Add-on: Xbox One
 Control your Xbox One from your Home Assistant device
-----------------------------------------------------------
 Add-on version: 2.0.0
 There is an update available for this add-on!
 Latest add-on version: null
 Please consider upgrading as soon as possible.
parse error: Expected string key before ':' at line 1, column 4
[19:23:13] ERROR: Unknown HTTP error occured
 System:   (armv7 / raspberrypi4)
 Home Assistant version: 0.111.2
 Supervisor version: 227
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in e.g, GitHub, forums or the Discord chat.
-----------------------------------------------------------

However, I donā€™t see a way to update the add-on. Also - whatā€™s the correct format for the configuration settings? Iā€™ve tried several, and keep getting a parsing error.

Any idea why I constantly get the following error?

Logger: custom_components.xboxone.media_player
Source: custom_components/xboxone/media_player.py:613
Integration: xboxone (documentation)
First occurred: 24 June 2020, 16:15:35 (2902 occurrences)
Last logged: 13:48:06

  • Refreshing authentication tokens failed!
  • Failed to connect to FD#########

My setup is https:// behind duckdns and to authenticate my XBL profile I go direct to the IP.

http://10.0.0.20:5557/auth/oauth and sign in, it works again, then a few hours later/next day Iā€™ll get the error again.

Also worth mentioning my XBL account has MFA on.

I have a similar situation after a fresh install and restoring form backup.
it is not working at this moment :frowning:

I managed to run it by adding the repository https://github.com/OpenXbox/xboxone-home-assistant
after that you should see the addon that you can install. It works for me since yesterday.

Are there two components required to properly support XBox One integration? Iā€™m seeing ā€œXBox Oneā€ and ā€œXBox One Smartglass REST Serverā€ in Supervisor-> Add-ons.

I keep seeing errors in my log regarding XBox, and Iā€™m doing my best to get my install tweaked to as few issues as possible.

In my ā€œXBox Oneā€ add-on log:

127.0.0.1 - - [2020-07-09 07:43:31] "GET /auth/refresh HTTP/1.1" 500 251 0.004246
127.0.0.1 - - [2020-07-09 07:43:40] "GET /versions HTTP/1.1" 200 317 0.096225
127.0.0.1 - - [2020-07-09 07:43:40] "GET /auth HTTP/1.1" 200 5616 0.002187
[2020-07-09 07:43:40,134] WARNING in manager: Token Auth failed: No valid RefreshToken. Attempting auth via credentials
[2020-07-09 07:43:40,135] ERROR in app: {'success': False, 'message': 'AuthenticationManager was not able to authenticate with provided tokens or user credentials!'}

In the ā€œXBox One Smartglass REST Serverā€ log:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2020-07-08 19:44:34,500] INFO in rest_server: Starting Xbox Smartglass REST server started on 0.0.0.0:5557
[2020-07-08 19:44:34,501] DEBUG in rest_server: Setting tokenfile path to /root/.local/share/xbox/tokens.json
[2020-07-08 19:44:34,502] INFO in rest_server: Trying to load & refresh tokens
[2020-07-08 19:44:34,529] INFO in manager: Loaded token <class 'xbox.webapi.authentication.token.AccessToken'> from file
[2020-07-08 19:44:34,530] INFO in manager: Loaded token <class 'xbox.webapi.authentication.token.RefreshToken'> from file
[2020-07-08 19:44:34,532] INFO in manager: Loaded token <class 'xbox.webapi.authentication.token.UserToken'> from file
[2020-07-08 19:44:34,533] INFO in manager: Loaded token <class 'xbox.webapi.authentication.token.XSTSToken'> from file
[2020-07-08 19:44:34,534] WARNING in manager: Token Auth failed: No valid RefreshToken. Attempting auth via credentials
[2020-07-08 19:44:34,535] WARNING in rest_server: Failed to authenticate with tokenfile from /root/.local/share/xbox/tokens.json, error: AuthenticationManager was not able to authenticate with provided tokens or user credentials!
Traceback (most recent call last):
  File "/usr/bin/xbox-rest-server", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.8/site-packages/xbox/rest/scripts/rest_server.py", line 55, in main
    server.serve_forever()
  File "/usr/lib/python3.8/site-packages/gevent/baseserver.py", line 387, in serve_forever
    self.start()
  File "/usr/lib/python3.8/site-packages/gevent/baseserver.py", line 325, in start
    self.init_socket()
  File "/usr/lib/python3.8/site-packages/gevent/pywsgi.py", line 1482, in init_socket
    StreamServer.init_socket(self)
  File "/usr/lib/python3.8/site-packages/gevent/server.py", line 180, in init_socket
    self.socket = self.get_listener(self.address, self.backlog, self.family)
  File "/usr/lib/python3.8/site-packages/gevent/server.py", line 192, in get_listener
    return _tcp_listener(address, backlog=backlog, reuse_addr=cls.reuse_addr, family=family)
  File "/usr/lib/python3.8/site-packages/gevent/server.py", line 288, in _tcp_listener
    sock.bind(address)
OSError: [Errno 98] Address in use: ('0.0.0.0', 5557)
[cmd] /run.sh exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

Hey @djtommye
There is also HACS plugin that you have to install ā€œXbox One - smartglass media playerā€
image

hope that helps

Okay. I do have that installed as well. So itā€™s a total of three componentsā€¦ maybe Iā€™ll re-install them all. Is there a particular order they should be installed in?

Do you see any of the errors that I posted in your installation, or are they all resolved now?

Thank you!

So in the Xbox One Smartglass REST server no errors in my installation
Iā€™m not sure how to check logs for Xbox One - smartglass media player but seems to be working ok.
BTW I have intalled only
Xbox One Smartglass REST server
and
Xbox One - smartglass media player

I was able to get everything setup and can see the Xbox in my overview (with updates on itā€™s status). I can turn it off from the web interface and Alexa, but I am unable to turn it on from the web interface or Alexa. I confirmed instant on mode is enabled on the Xbox. What else can I try?

Nevermind it appears to be working now

1 Like

It doesnt work all the time for me, even with the official xbox apps from microsoft under win10.

Iā€™m getting {ā€œdevicesā€:{},ā€œsuccessā€:true} at the 5557/device any ideas?

Is your box switched on and in the same network?
If yes I think there is something wrong with the setup.