Hass.io Add-on: Xbox One

Is there anyway to create a front end switch/script that will turn it on. I want to incorporate it into a room card rather than using the media player card.

Thanks

tuxuser, sorry for the delayed reply, only just found time to have a look at this again.
Thank you so much, that worked!
With your message I’ve managed to work out how to automatically run other things like Forza too :slight_smile:

Now just to suss how to create a switch in homeassistant that’ll turn on my xbox and then launch whatever app.

I don’t have anything appear for the /device/ my Xbox is turned on and logged into Xbox Live, any ideas?

Is your Xbox on a separate vlan/subnet? If so, you will need to specify the IP in the /device endpoint for initial discovery.

Installed this and it’s working great. Paired it with the mini-media-player for Lovelace and it’s working a treat.

The only issue I have is that I’ve turned off the console, but it’s still showing as on with a media title of Home. Would this be because I have my console set to instant on?

Template switch.

Is anyone else getting this error? Its happening constantly.

2018-10-24 21:05:55 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 246, in async_update_ha_state
    supported_features = self.supported_features
  File "/config/custom_components/media_player/xboxone.py", line 527, in supported_features
    if not self._xboxone.volume_controls:
  File "/config/custom_components/media_player/xboxone.py", line 119, in volume_controls
    'mute': controls['buttons']['btn.vol_mute']['url'],
KeyError: 'btn.vol_mute'

Love this one , but homeassistant discovery find my xbox , so i’ve got 2 now , i try to see the difference , your got the source selection , Ha get the actual playing media and you only the source , can you implement the actual media (Title, artist etc …)
Look at the picture :
xboxone

Little error this morning :

2018-10-27 10:07:15 ERROR (SyncWorker_14) [custom_components.media_player.xboxone] Failed to connect to console FD00EF1EA5F826C5: {‘message’: ‘Channel ID not found for ServiceChannel: ServiceChannel.SystemInputTVRemote’, ‘success’: False} 2018-10-27 10:07:15 ERROR (SyncWorker_14) [custom_components.media_player.xboxone] Failed to connect to FD00EF1EA5F826C5 2018-10-27 10:07:16 WARNING (MainThread) [homeassistant.helpers.entity] Updating state for media_player.xbox_one_salon (<class ‘custom_components.media_player.xboxone.XboxOneDevice’>) took 0.775 seconds. Please report platform to the developers at https://goo.gl/Nvioub

Edit: Error solved after restart HA , just the little one regarding state took 0.7 second not a big problem :slight_smile:

that doesn’t happen in my setup, do we have to enable anything for that, other than discovery: ?

I don’t know how this happen , seems that is not the case today …

Edit: i think that this second xbox was here by another way , it was here caused i have it by the plex component , but actually i desinstall it to had only the xbox one from the addon , look at the plex component , when you start plex on the xbox you get a new xbox , but the xbox component doesn’t exist , i think HA can implement if it find it when you start plex …but it’s not the concern of this post…

ok thanks, will test that, using plex also.

this is more of a concern of this thread:

2018-10-27 15:47:27 ERROR (SyncWorker_0) [custom_components.media_player.xboxone] Refreshing authentication tokens failed!
2018-10-27 15:47:38 ERROR (SyncWorker_7) [custom_components.media_player.xboxone] Refreshing authentication tokens failed!
2018-10-27 15:47:48 ERROR (SyncWorker_12) [custom_components.media_player.xboxone] Refreshing authentication tokens failed!
2018-10-27 15:47:59 ERROR (SyncWorker_11) [custom_components.media_player.xboxone] Refreshing authentication tokens failed!
2018-10-27 15:48:09 ERROR (SyncWorker_11) [custom_components.media_player.xboxone] Refreshing authentication tokens failed!
2018-10-27 15:48:20 ERROR (SyncWorker_11) [custom_components.media_player.xboxone] Refreshing authentication tokens failed!
2018-10-27 15:48:31 ERROR (SyncWorker_11) [custom_components.media_player.xboxone] Refreshing authentication tokens failed!
2018-10-27 15:48:41 ERROR (SyncWorker_0) [custom_components.media_player.xboxone] Refreshing authentication tokens failed!
2018-10-27 15:48:52 ERROR (SyncWorker_8) [custom_components.media_player.xboxone] Refreshing authentication tokens failed!
2018-10-27 15:49:03 ERROR (SyncWorker_14) [custom_components.media_player.xboxone] Refreshing authentication tokens failed!
2018-10-27 15:49:14 ERROR (SyncWorker_18) [custom_components.media_player.xboxone] Refreshing authentication tokens failed!
2018-10-27 15:49:25 ERROR (SyncWorker_19) [custom_components.media_player.xboxone] Refreshing authentication tokens failed!
2018-10-27 15:49:36 ERROR (SyncWorker_5) [custom_components.media_player.xboxone] Refreshing authentication tokens failed!
2018-10-27 15:49:47 ERROR (SyncWorker_4) [custom_components.media_player.xboxone] Refreshing authentication tokens failed!
2018-10-27 15:49:58 ERROR (SyncWorker_0) [custom_components.media_player.xboxone] Refreshing authentication tokens failed!
2018-10-27 15:50:09 ERROR (SyncWorker_14) [custom_components.media_player.xboxone] Refreshing authentication tokens failed!
2018-10-27 15:50:20 ERROR (SyncWorker_3) [custom_components.media_player.xboxone] Refreshing authentication tokens failed!
2018-10-27 15:50:30 ERROR (SyncWorker_11) [custom_components.media_player.xboxone] Refreshing authentication tokens failed!
2018-10-27 15:50:41 ERROR (SyncWorker_3) [custom_components.media_player.xboxone] Refreshing authentication tokens failed!
2018-10-27 15:50:51 ERROR (SyncWorker_5) [custom_components.media_player.xboxone] Refreshing authentication tokens failed!
2018-10-27 15:51:02 ERROR (SyncWorker_6) [custom_components.media_player.xboxone] Refreshing authentication tokens failed!

With the regular xboxlive sensor, I always refresh when needed, but now this is loaded at every boot of HA, this seems to be undesired… how can we prevent that. If at all? If I click the oauth link nothing happens (not using windows but mac btw)

hi everyone nice addon but I´m having some difficulties don´t know if I missed something, here´s my logs:

[2018-12-09 14:46:47,146] WARNING in manager: Token Auth failed: No valid RefreshToken. Attempting auth via credentials
[2018-12-09 14:46:47,148] ERROR in app: {'success': False, 'message': 'AuthenticationManager was not able to authenticate with provided tokens or user credentials!'}

tks

goodmorning guys,

i’ve setup the add-on and it’s connected, i can turn on my xbox
but the entity shows that is off.

i also have a error in the logs
has somebody a solution? or even i overlooked something

        2019-01-04 09:06:23 ERROR (MainThread) [homeassistant.core] Error doing job: Task 
        exception 
        was never retrieved
        Traceback (most recent call last):
        File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 268, in 
        async_update_ha_state
        supported_features = self.supported_features
        File "/config/custom_components/media_player/xboxone.py", line 527, in supported_features
        if not self._xboxone.volume_controls:
        File "/config/custom_components/media_player/xboxone.py", line 119, in volume_controls
        'mute': controls['buttons']['btn.vol_mute']['url'],
        KeyError: 'btn.vol_mute'

Hi, it works very well but after time that xbox was off (not in energy save mode), the on comma d won’t work because xbox not found in devices

How i can do? I’m using it to power on and off xbox

I’m having the same problem as @ramseys1990 but it occurs intermittently :frowning:

@hunterjm, how can I specify the IP in the /device endpoint?

Thanks!

I had this problem too, it would only work once and then I’d have to restart home assistant to make it work again.

In the log I found a version mismatch, as the xbox-rest-server is 0.9.8 and the custom_component is version 0.9.6 this lead to my xbox not responding to a second command after the first was given. I fixed it by changing the version number in the custom_component. Now it works flawlessly and I do not have any problems with it since I changed it. Works in automations etc. Only thing is, when the xbox is “ON” the sensor will give “Unknown” as its current state. But otherwise it works perfectly.

So edit the xboxone.py and change the version number (see screenshot) to 0.9.8

I hope this helps.

Thanks @jimz011 for the hint but it doesn’t work for me. Actually, I cannot even either get the state or start the xbox from HA. I’ll give it another try and report.

Stupid question maybe, but did you start the xbox-rest-server? As this needs to be running to be able to work at all. I have to mention that I use it in a virtual env with ubuntu and that I don’t use hass.io.

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.