Hass.io Add-on: Xbox One

For some reason the rest-server loses connection every time my xbox gets turned off. Restarting the rest server fixes it, but I need to do that every single time I turn the xbox off. Sometimes it does work but most of the time it doesn’t and will throw messages like:
Send connect request: failed.

Crazy thing is, when I turn it on via the rest server it will turn on, however state will remain at “on” even when it is “off” until I restart the xbox-rest-server

1 Like

Freshly updated to HA 0.92. Checking config gives the following message:

Integration xboxone not found when trying to verify its media_player platform.

No error pops in the log when I check config…

Same situation in my setup.
I wonder if it just miss the manifest.json file. But I have no idea how that should look like in this case. I had same issue with the hue sensors and manifest file soled it.

I’ve written up the manifest.json, and it seems to load, still looking at trying to get the media_player entity to load though.

{
  "domain": "xboxone",
  "name": "XboxOne",
  "documentation": "https://github.com/hunterjm/hassio-addons/tree/master/xboxone",
  "requirements": [
    ""
  ],
  "dependencies": [],
  "codeowners": []
}
1 Like

Right, I’ve not had this working at all, and I’ve rolled back to 0.91.4 and now the media_player component has showed up. I’m sure they’ve changed the way media_player components are loaded.

I’ve noticed another issue, is that in the python script you’ve set the default host for the smartglass service to ‘localhost’, which resolves to ::1 on my server, and that caused any attempts to contact endpoints to fail. I’ve changed this to 127.0.0.1 and everything now works well!

Thats a bummer but thanks for letting me know. I can stop getting frustrated thinking it was me hahaha

same problem here. thankfully I mostly just use the alexa skill but my HADashboard is going to have some broken buttons until its patched. :sob:

same problem with no install running 0.92 hassio anyone could find out?

here´s my error:

19-04-27 14:10:06 ERROR (SyncWorker_16) [hassio.docker.interface] Can’t install hunterjm/hassio-armv7-xboxone:2.0.0 -> 404 Client Error: Not Found (“pull access denied for hunterjm/hassio-armv7-xboxone, repository does not exist or may require ‘docker login’”).

I have it working under HA 0.92.1. Had to create the manifest.json and __init__.py files and place in the custom_components\xboxone folder. Mine are the same as @martydingo

My manifest.json:

{
  "domain": "xboxone",
  "name": "Xbox One",
  "documentation": "https://github.com/hunterjm/hassio-addons/tree/master/xboxone",
  "dependencies": [],
  "requirements": [], 
  "codeowners": ["@hunterjm"]
}

__init__.py file is just a commented file.

""" test init file """

Also had to re-authenticate with Xbox Live again, then it started working.

Edit: I forgot that Markdown uses double underscores as bold, so the __init__.py file wasn’t displayed in the post correctly. Remember to name the file as __init__.py – it must have the double underscore before and after the ‘init’ word.

1 Like

Strange, I did the same thing but HASS never recognised the media_player entity. It must need to exist pre-update.

That’s possible. But I don’t want to remove my Xbox One and re-add it to find out :slight_smile:

did this but can´t install yet

afbeelding

Also the same error here :worried:

I just got this working finally in 0.92.1.

THE INSTRUCTIONS ON THIS PAGE ARE OUT OF DATE.

To actually install it you will need to read and follow the instructions here with 3 changes.
https://github.com/hunterjm/hassio-addons/tree/master/xboxone

  1. For some reason @hunterjm 's repository isn’t allowing pull requests. So, you either need to make your own fork and use that github url in the add-on store, or (if you aren’t familiar enough with github) you can just use the one I already made here: https://github.com/jmhill1287/hassio-addons

NOTE: if you make your own fork there is an additional step of editing the config.json file by removing line 10 which reads “image”… which throws an error cause it is trying to find an image from the original repository.

  1. The way custom component are handled has changed in a recent update so I implemented @dwinnn 's suggestions of creating a manifest.json file and placing it in the custom_components\xboxone folder. You should just copy and paste his code into the .json file. The only reason to change it is if you don’t want your component to be called xboxone.

  2. Also from @dwinnn you need to creat a init.py file in the same folder as step 2. Again, just copy and paste his code into the .py file.

Once I did that (again, in addition to the set of instructions at the first repository) I have it up and running smoothly. Even got it loaded into homekit so I can do some rudimentary controls in iOS with siri.

3 Likes

@jmhill1287 Thank you! This worked for me perfectly. I was able to get it up and running but can’t edit the config with my Xbox login info but this is better than nothing.

I have control of the Xbox and can power it on and off but can’t get the Media Player to display any information from what the Xbox is doing.

I´m getting this error:

19-05-04 18:28:08 ERROR (SyncWorker_4) [hassio.docker] Can’t create container from addon_835de24f_xboxone: 404 Client Error: Not Found (“No such image: 835de24f/armv7-addon-xboxone:latest”)

After installing en starting your add-on it shows me this log:

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] 00-banner.sh: executing... 
-----------------------------------------------------------
 Hass.io Add-on: Xbox One
 Control your Xbox One from your Home Assistant device
-----------------------------------------------------------
 Add-on version: 2.0.0
 You are running the latest version of this add-on.
parse error: Expected string key before ':' at line 1, column 4
[21:44:33] ERROR: Unknown HTTP error occured
 System:   (armv7 / raspberrypi3)
 Home Assistant version: 0.92.2
 Supervisor version: 162
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in e.g, GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2019-05-04 21:44:40,087] INFO in rest_server: Starting Xbox Smartglass REST server started on 0.0.0.0:5557
[2019-05-04 21:44:40,089] DEBUG in rest_server: Setting tokenfile path to /root/.local/share/xbox/tokens.json
[2019-05-04 21:44:40,091] INFO in rest_server: Trying to load & refresh tokens
[2019-05-04 21:44:40,117] INFO in manager: Loaded token <class 'xbox.webapi.authentication.token.AccessToken'> from file
[2019-05-04 21:44:40,119] INFO in manager: Loaded token <class 'xbox.webapi.authentication.token.RefreshToken'> from file
[2019-05-04 21:44:40,121] INFO in manager: Loaded token <class 'xbox.webapi.authentication.token.UserToken'> from file
[2019-05-04 21:44:40,123] INFO in manager: Loaded token <class 'xbox.webapi.authentication.token.XSTSToken'> from file
[2019-05-04 21:44:40,142] DEBUG in connectionpool: Starting new HTTPS connection (1): login.live.com:443
[2019-05-04 21:44:40,853] DEBUG in connectionpool: https://login.live.com:443 "GET /oauth20_token.srf?grant_type=refresh_token&client_id=0000000048093EE3&scope=service%3A%3Auser.auth.xboxlive.com%3A%3AMBI_SSL&refresh_token=MCXb5INr%2AAi9utovyBlb0LgoWRMUu6ITToWAKXrQ4r168AoFe%2AOHam8XWbgqHVUJ2dcZyMUL0HQdOFFxuiSZDTAMgz4pZOw7oVYx%2AANDHtG%2AvhnJmU6Nj19jc1t4ctHrC9zB5lvoItYZ9fwG59LEge3KIlZ%21HcrIJJHGRr1AZpWjZXIws4%21L2bq%2Ay%21h0onZ84D0IES%21B3bTxz6V5f1up93mUugnqyku8jSorhmsmrZ%2Ad8VB0CV4nLlGtn4VpzkMw5pjOHqLJSey2%21s6%21AN7%2APY6RzgyHr3g9mRSF%2A%2ACkBnN4BNwWQfDGINAofSFcWWWBXDQ%24%24 HTTP/1.1" 200 1520
192.168.25.119 - - [2019-05-04 21:45:15] "GET / HTTP/1.1" 200 1129 0.009570
192.168.25.119 - - [2019-05-04 21:45:15] "GET /favicon.ico HTTP/1.1" 404 341 0.012459
[2019-05-04 21:45:52,705] DEBUG in protocol: Received DiscoverResponse from 192.168.25.14
[2019-05-04 21:45:53,213] DEBUG in protocol: Received DiscoverResponse from 192.168.25.14
[2019-05-04 21:45:53,720] DEBUG in protocol: Received DiscoverResponse from 192.168.25.14
[2019-05-04 21:45:54,228] DEBUG in protocol: Received DiscoverResponse from 192.168.25.14
[2019-05-04 21:45:54,731] DEBUG in protocol: Received DiscoverResponse from 192.168.25.14
[2019-05-04 21:45:55,247] WARNING in consolewrap: Failed to import NanoManager (depends on xbox-smartglass-nano). /nano endpoint will not work!
192.168.25.119 - - [2019-05-04 21:45:55] "GET /device HTTP/1.1" 200 514 2.562613
192.168.25.119 - - [2019-05-04 21:45:55] "GET /favicon.ico HTTP/1.1" 404 341 0.005900
[2019-05-04 21:46:33,610] DEBUG in protocol: Received DiscoverResponse from 192.168.25.14
[2019-05-04 21:46:34,112] DEBUG in protocol: Received DiscoverResponse from 192.168.25.14
[2019-05-04 21:46:34,623] DEBUG in protocol: Received DiscoverResponse from 192.168.25.14
[2019-05-04 21:46:35,133] DEBUG in protocol: Received DiscoverResponse from 192.168.25.14
[2019-05-04 21:46:35,640] DEBUG in protocol: Received DiscoverResponse from 192.168.25.14

REFRESH

And I cannot find the media control for my XBOX.

I also see this message

Integration xboxone not found when trying to verify its media_player platform.

When verifying this code for the media_player:

media_player:
  - platform: xboxone
    device: !secret xbox_device
    name: Xbox One

In the log of the XBOX One Plugin:

[2019-05-04 21:53:48,028] WARNING in consolewrap: Failed to import NanoManager (depends on xbox-smartglass-nano). /nano endpoint will not work!

Which repository are you using? hunterhjm or jmhill1287?

I wasn’t able to edit that either and based on the new set of instructions I don’t think it is needed.

Did you follow this step?

  1. Authenticate with Xbox Live by going to /auth/oauth and following the directions.