XBOX ONE integration with Raspberry PI


(ilker Aktuna) #1

Hi,

I am trying to continue the work which started here:

It works with a Raspberry PI as a middleware.
So the HUB sends calls a http request and the middleware sends the required package to power on the Xbox.

I want to add Power_Off feature to this. But I could not figure out the correct package format for power_off.

Here , I found a complete python library for various control of Xbox:

But I really don’t understand python, specially the way the IP package is formatted.

Can anyone help me figure out which package should be sent for power off ?

Here are what I have found out in the code to turn off :

def power_off(self, liveid):
    """
    Power off console
    Args:
        liveid (str): Live ID of console
    Returns: None
    """
    msg = factory.power_off(liveid)
    self.send_message(msg)


factory:
CHANNEL_CORE=0

def power_off(liveid, **kwargs):
"""
Assemble PowerOff message.
Args:
    liveid (str): Live ID of console.
Returns:
    :class:`XStructObj`: Instance of :class:`:class:`XStructObj``.
"""
return message.struct(
    header=_message_header(
        MessageType.PowerOff, CHANNEL_CORE, **kwargs
    ),
    protected_payload=message.power_off(
        liveid=liveid
    )
)

message:
power_off = XStruct(
'liveid' / SGString()
)

XSrtuct is found under xbox/sg/utils/

I’d really appreciate if someone can help me to form the correct packet for power off.

Thanks.


(ilker Aktuna) #2

I understand that very few are interested in Xbox device handler. But some good developer could help me understand what packet I should send to xbox for powering off.
Nobody ?


(ilker Aktuna) #3

really ? nobody to help ?
I just need some developer to advise me how to start with this code.


(Ron Talley) #4

I have a solution for Xbox on/off and monitoring the on/off status.

  1. Harmony Hub to send commands
  2. KuKu Harmony running on Pi to send individual commands independently
  3. Host Pinger running on PI to monitor if the Xbox is actually on/off
  4. WebCore and Virtual Switch to keep physical device and Virtual Switch in sync

Works Great!


(ilker Aktuna) #5

thanks. But that’s not relevant for me. I have Harmony hub and my Xbox is currently being controlled through Harmony hub. But I want to free a slot from my Harmony hub by removing Xbox. Because I am not able to add any more entertainment devices to my hub. (reached limit)
That’s why I want to directly (well not directly but through PI) control my Xbox from ST.

That’s why I still need help for development of the XBOX DTH (just “turn on” command)

Btw, if you already have Harmony hub, why do you need KuKu Harmony and Host pinger to control your Xbox ? Use Harmony activity instead ?


(Ron Talley) #6

Say you want to check on the game score but don’t want to turn off the Xbox…

With Activities, typically, if something comes on (Activity), Harmony switches off the current Activity. With KuKu, an Activity can be on but the commands are not tied to an Activity. Much more flexible.

Another example is I have a Dolby Atmos setup and the 4 overhead speakers are amped. I can tell Alexa to turn on Atmos, which KuKu sends an IR blast to and it willl not turn off my current Activity.

As far as Host Pinger, this is a monitoring app. If someone turns on the Xbox manually, SmartThings nor Harmony has any idea that it is on. By monitoring the ping, Host Pinger tells SmartThings that the ping is active. That turns on the Xbox Virtual Switch, which is tied to a webCoRE rule to turn on the Xbox Activity.

This is the case with most of my networked devices that are incorporated into SmartThings. With Host Pinger, it doesn’t matter if someone breaks the rules and turns something on manually. By monitoring the ping of my devices, I can keep everything in sync.

The WAF and Guest Acceptance Factor is through the roof.

YMMV


(ilker Aktuna) #7

ok. I’ll try KuKu for using single command actions on Harmony. I wish that was a feature of direct ST to Harmony integration.

BUT, I still need to develop XBox DTH for the reasons I wrote…


(ilker Aktuna) #8

can any developer help me ?
I’d even pay for this feature…