Hass.io Add-on: Xbox One

I use the Hass.io add-on @jimz011. From the logs, it looks like the server is properly running

[2019-01-15 21:53:45,869] INFO in rest_server: Starting Xbox Smartglass REST server started on 0.0.0.0:5557

but it fails to get info from my console

[2019-01-15 21:56:14,264] ERROR in app: {'success': False, 'message': 'Console info for XXXXXXXXX is not available'}

that’s the odd stuff, sometimes it works and most of the time it doesn’t. Cannot seem to find any logic behind that.

Hm it starts on 0.0.0.0:5557, this is different from my setup where it starts on localhost (192.168.0.x:5557) it might be the problem. But I am not at home now so I can not check it atm.

I can’t seem to get this authorize with my xbox this is the error I keep getting.

127.0.0.1 - - [2019-01-16 09:56:27] "GET /auth/refresh HTTP/1.1" 500 251 0.005867
127.0.0.1 - - [2019-01-16 09:56:29] "GET /device HTTP/1.1" 200 138 2.546474
[2019-01-16 09:56:29,836] ERROR in app: {'success': False, 'message': 'Console info for FD00FB7AE0EC4211 is not available'}
127.0.0.1 - - [2019-01-16 09:56:29] "GET /device/FD00FB7AE0EC4211 HTTP/1.1" 403 196 0.007225
192.168.163.199 - - [2019-01-16 09:56:32] "POST /auth/oauth HTTP/1.1" 200 575 0.030911
127.0.0.1 - - [2019-01-16 09:56:38] "GET /versions HTTP/1.1" 200 317 0.185382
127.0.0.1 - - [2019-01-16 09:56:38] "GET /auth HTTP/1.1" 200 252 0.003367
[2019-01-16 09:56:38,263] WARNING in manager: Token Auth failed: No valid RefreshToken. Attempting auth via credentials
[2019-01-16 09:56:38,265] ERROR in app: {'success': False, 'message': 'AuthenticationManager was not able to authenticate with provided tokens or user credentials!'}

I am getting a similar error but not exactly the same.

[2019-01-16 13:39:10,666] ERROR in app: {'success': False, 'message': 'Console info for fd729a829d507bf3 is not available'}
127.0.0.1 - - [2019-01-16 13:39:10] "GET /device/fd729a829d507bf3 HTTP/1.1" 403 196 0.002914
127.0.0.1 - - [2019-01-16 13:39:19] "GET /versions HTTP/1.1" 200 317 0.161883
127.0.0.1 - - [2019-01-16 13:39:19] "GET /auth HTTP/1.1" 200 5725 0.002007
127.0.0.1 - - [2019-01-16 13:39:21] "GET /device HTTP/1.1" 200 499 2.515818
[2019-01-16 13:39:21,743] ERROR in app: {'success': False, 'message': 'Console info for fd729a829d507bf3 is not available'}

However I do NOT get the AuthenticationManager error at the bottom

Thanks for this addon, it’s just what I needed.
I’ve set it up with my Google Assistant and it works well, although there’s one annoying issue.
After I give the command (‘Turn on xbox’, for instance), the xbox will switch on, but the assistant will say that ‘Sorry, there was an error with xbox’. Is there a way to workaround this? It’s pretty annoying :]

Can you provide exactly how you did this? I am very new to home assistant and would like to try and recreate it

My config on the add-on will not save, not sure why. I get this error every time

19-02-05 03:32:20 WARNING (MainThread) [hassio.addons.validate] Unknown options email
19-02-05 03:32:20 WARNING (MainThread) [hassio.addons.validate] Unknown options password

I’ve tried rebooting, reinstalling, saving without add-on started, saving with it started.

Any advice?

Recently I ran into a challenge with this add-one, which worked perfect before.

I constantly receive this error in my error log:

Sensor seems to work fine, but if I want to run an automation task based on the state of the XBOX (value is on), it does not work.

This is what the log shows at the add-on.

ERROR in app: {'success': False, 'message': 'Connecting failed! Result: ConnectionResult.Pending'}

What I also noticed is that when I want to put my live credentials in the config of the add-on, I can add values, but if I save it, the config is empty again

image

What I also noticed is that when I want to authenticate (and enter my credentials) here:

image

This error is shown:

Have you checked if the xbox live service is up? It had some problems recently with many users unable to log in to xbox. Check on your xbox if you can log in.

I also found in my case that it wouldn’t connect due to a version mismatch (hassio addon looks for an older version of the xbox-rest-server, I believe it was 0.9.6) you could change this line in the xboxone.py to the current version number (0.9.8). This had fixed the problem for me, but yours seem like you don’t have access to the live servers.

Thanks for your quick reply. I am able to logon to live service without a problem.

It is something in the authentication, which is not working properly (internal server error)

Now I am having this error in my log:

image

Np, was just browsing the forums anyways. Maybe a reinstall could help. But tbh I wouldn’t really know. Only thing I can think of is that there went something wrong either at the install or maybe the version number which I mentioned.

What you should see after logging in via the addon is a blank page with a long url in the address bar. You will need that url to connect.

I am signed in now

image

Log at the add-one show me this:

[2019-02-05 20:51:29,501] ERROR in app: {'success': False, 'message': 'Connecting failed! Result: ConnectionResult.Pending'}

Yeah, I had that error too. My question is, does it work? Try turning the xbox off via Hass. And then try turning it back on again (btw it could take a minute before the xbox-rest-server finds your newly connected xbox) don’t forget to add the things that should be added in your configuration.

If you have the same problem as I had, then it will only work once or twice before becoming unresponsive again.

That is working. Now the strange part is that I have a automation task which should notify slack when XBOX is on or off. That doesn’t seem to work at all anymore and I do not know why that is.

image

image

It did worked and the states are configured fine and also do work at other components

Well in my case it only worked once or twice (because the version numbers mismatched). After changing that line it worked fine for me. However I use the TV app most of the times on my xbox and will update the state to Unknown when in that state. So I made my automations trigger on unknown instead of being ON. Maybe that helps.

mmm that’s worth a try. Can you share your automation script?

The odd thing is that if I create an entry on a card which checks the state before viewed, it works. it validates the ‘on’ state:

card:
  show_header_toggle: false
  title: Media
entities:
  - entity: media_player.xbox_one
show_empty: false
state_filter:
  - 'on'
title: Media
type: entity-filter

If i use the same state check in an automation task, it does not work. That would point to the direction of the automation trigger which is not picked up properly

I’m not at home atm, though I’m not a 100% sure I still use that automation. I know for sure that I used the Unknown state for my button card for example. Or it will keep the icon color as if it were off.

Maybe you could find something on my git page, though I’m not sure if it is in there :stuck_out_tongue:

https://github.com/jimz011/HA

Little side step, how did you created a backup of your local hassio install to GitHub?