Xbox One / Smartglass Integration

Hi
The Error i am seeing in the Log after restarting the Add-On "ERROR in app: {‘success’: False, ‘message’: ‘Console info for FD0XXXXXXXXXX is not available’} , even though the console is powered on. When i check the Home page to see if the xbox card appears it does but nothing seems to be working " Power Button , Source Selection state changes to on or off but no action on the xbox happens.

Hi .
I have managed to get the Xbox paired successfully and it’s working when selecting apps etc.
I just wanted to know is there a way to get the controls working like the bottoms on the Xbox controller and the directional buttons.

Will there be an all-in-1 Docker image available too for us running HA on docker? Would love to be able to use HA with Xbox but I’m not running hassio.

Yesterday, I managed to get this all working through hassio addons. I got my device ID after a number of restarts and attempts, put it in my yaml, tested it and it all seemed to work as expected.

Excitedly went to play around with it tonight and nothing works. The addon seems to be running fine, the auth/oath still says i’m logged in, /device shows same device ID but the media_player.xbox_one shows off (it’s on) and wouldn’t power the device on when clicked. I’ve restarted a couple of times and no dice.

Hassio addon logs shows this : https://hastebin.com/xolugiwezo.css

Just a question, who decides where this becomes a component would love to see this over there?

I have just got back into homeassistant after completing media room renovations. I would like to implement a remote component that can send arbitrary controller inputs to the xbox, such as those found on the media remote (mostly just fast forward/rewind and menu) as well as those on the xbox one controller.

This is straightforward with the smartglass rest server, but I would like to avoid redundant code regarding the initial setup of the xbox. Would it make sense to put the xbox setup related stuff in a separate component called xboxone and then have media_player.xboxone and remote.xboxone components that depend on it? This is how the appletv component handles it, I believe.

EDIT: Just implemented this via a rest_command:

  xboxone_input:
    url: "http://192.168.1.10:5557/device/<your_live_id>/{{ type }}/{{ command }}"

where type can be media or input and command can be any of the commands corresponding to those.

seems unnecessary to implement a remote component when it’s this simple with the rest server. Perhaps a mention in the official documentation will help people looking to add this functionality.

Hi @tuxuser,

Have tthe exact same problem as @rebelelephant whit homeassistant

I have follow the manual instalation guide step by step.

  • Xbox rest server instaled without problem on my homeassistant venv virtual enviroment
  • the server start itlselft via systemd
  • i can authenticate whit my xbox account and my console id shows up
  • i created the -media_player entry whit my xbox id, name and platform xboxone on my configuration.yalm
  • i copied the xbox.py on my home assistsnt custom components folder -> /home/homeassistant/.homeassitant/custom components/media_player/xboxone.py

The media player dont show up on HA, and the only info in the dev panel is “Error loading custom_components.media_player.xboxone. Make sure all dependencies are installed
16:38 custom_components/media_player/xboxone.py (ERROR)”

  • i have other custom_components loaded without problems, one of the is another media player.
    Also i did a fresh start whit another SD installing raspian and homeassitant from the scratch and only trying to install this componnet, got the exact same result

Would really like to use the component and any help is apreciated

Rename media_player/xboxone.py to xboxone/media_player.py in your custom_components folder.

Thanks a lot @jimz011

Just did that and the component still dont show (have restarted HA) l now the dev panel error is “Unable to find component media_player.xboxone
19:02 loader.py (ERROR)”

Have tried removing the media_player folder and only having the xboxone folder whit media_player.py in /custom_components whit the same result.

Any other advice?

In the newer HA your components have to have an __init__.py. This file can just be empty

Thanks @Devqon, finally got it working after that.

Now the problem i have is the componet, the media player show up, but the only thing i can do is turn the xbox on, not turn it off of launch any apps. The apps that i got instaled are shown in the “source “ menu in the component, but when i execute every single one of them (or the on/off button) gives the error “error calling media_player/xxxx/. ‘btn.vol_mute‘

The detailed dev planed error is

File “/home/homeassistant/.homeassistant/custom_components/xboxone/media_player.py”, line 534, in supported_features
if not self._xboxone.volume_controls:
File “/home/homeassistant/.homeassistant/custom_components/xboxone/media_player.py”, line 122, in volume_controls
‘mute’: controls[‘buttons’][‘btn.vol_mute’][‘url’],
KeyError: ‘btn.vol_mute’

I would love to be able to add up down left right select commands. been waiting patiently for someone to figure that out :wink:

I have been trying to figure out how to send a source select command to my Xbox. For the life of me I just cant figure out the proper setup. All of the sources I am trying are pinned apps in my Xbox and are listed in my home assistant entities. I really appreciate any help you guys can offer. I have tried without quotes and with quotes ’ or ". This script format is what seems to be the correct way according to most of the documentation I have read but unfortunately doesn’t work.

xboxnetflix:
  sequence:
    - service: media_player.select_source
      data:
        entity_id: media_player.xbox_one
        source: 'Netflix'
xboxyoutube:
  sequence:
    - service: media_player.select_source
      data:
        entity_id: media_player.xbox_one
        source: 'YouTube'
xboxhulu:
  sequence:
    - service: media_player.select_source
      data:
        entity_id: media_player.xbox_one
        source: 'Hulu'

Idk why no one talk about it, but i doubt someone got launch apps/games working. Not for this component itselft but for the smartglass protocol. Try open your iOS/Android smartglass app and launch a game/app, for me (on diferent devices) does nothing on the xbox, just open the “controller” mode on the app (the thing that let you swipe and use a,b,x.y buttons)

My smart glass app pad works?

Fixed my typo on last comment. You can launch something on your xbox whit the oficial ios or android xbox smartglass apps?

It’s been a while, but with the smartglass rest server running, you should be able to do:

rest_command:
  xboxone_input:
    url: "http://192.168.1.10:5557/device/<live_id>/{{ type }}/{{ command }}"

Where type can be media or input and you replace the <live_id> with whatever yours is. The commands can be anything listed under:

http://HASS_IP:5557/device/<live_id>/input

or

http://HASS_IP:5557/device/<live_id>/media

see the RESTful Command documentation, for more info.

The {{ }} stuff defines a template, so you can call rest_command.xboxone_input from a button on your dashboard as a service with:

data:
  type: input
  command: dpad_up 

See the example at the bottom of the Entity Button Card documentation and the Service Calls documentation for more info on how to implement this on your lovelace dashboard, or as part of an automation, etc.

I’ve only just got back into this after a semester of uni, so haven’t had a chance to test all this, but considering it works via the browser, the homeassistant REST functionality should be adequate.

1 Like

I stand corrected! Lol

Hi

I’m running HA in a docker not Hassio. I’ve installed the component and smartglass via pip3:

pip3 install marshmallow
pip3 install xbox-smartglass-core

What do I do next please? I’ve tried going to my-domain.com:5557 but nothing is loading.

Thanks in advance.

Execute the server first

Change parameters to your liking

$ xbox-rest-server -b 127.0.0.1 -p 5557
1 Like