Xbox Power State Trigger?

Hello, I’m new to HA, that said, I’m getting started with Automations and I want to create a trigger to respond when I turn on/off my Xbox One. I have the integration configured, including a card on my dashboard. So, I have the configuration in good shape, I think. I’m just not sure how to get HA to respond to power state change.

Thank you!

Jeff

The Xbox integration has a media player entity and a remote entity that you can trigger on. So for example if you wanted to do something when your Xbox was turned on, your triggers would be:

trigger:
  - platform: state
    entity_id: media_player.xboxone
    from: 'off'
    to: 'on'
  - platform: state
    entity_id: remote.xboxone_remote
    from: 'off'
    to: 'on'

If you are using the Automation editor (at Configuration -> Automations) your Xbox will show up under Device triggers. That is the easiest / most beginner friendly way of accomplishing this:

Thank you very much, Sean! That did the trick!

I ended up using a ping tracker. The xbox integration would trigger when I was logged in on the xbox windows app.

@Bollux, can you tell me more about how you set up the ping tracker? I’m finding the event driven solution to be unreliable and/or slow.

I have my xbox a fixed IP address from my router and added the following code in configuration.yaml:

binary_sensor:
  - platform: ping
    host: 192.168.2.105
    name: "XboxOne"
    count: 2
    scan_interval: 30

This creates a binary sensor with the state on or off you can use in a automation.

Thanks, @Bollux! I’m going to file this one away for now. Since I posted, I implemented a UPNP solution. See this thread, this works really well (so far). UPnP Availability integration

1 Like