homebridge-xbox-one icon indicating copy to clipboard operation
homebridge-xbox-one copied to clipboard

Reset Xbox One power state back to off after turning it on

Open edgariscoding opened this issue 8 years ago • 37 comments

Siri is able to successfully turn on my Xbox One, at which point HomeKit shows the Xbox One as "On".

I'm aware that Siri is not able to turn off the Xbox One, which is understandable.

The problem is that next time that I want to turn on the Xbox using Siri, she's not able to do it if the Xbox is still set to "On" within HomeKit.

Is there a way to configure the plugin so that when the Xbox is turned on, HomeKit is reset back to "Off" so that it can be successfully be turned on next time?

edgariscoding avatar Jul 07 '16 04:07 edgariscoding

I can look into that... I think when I originally tried to do this integration I tried to use a momentary switch so there was no saved state, but was unable to do so for some reason or other. I'll take a look again and see if maybe i can add proper state checking and even turn off support, if there's any update on that. Smart glass (or "Xbox", now) has turn off support now, so maybe we'll have more luck his time around.

arcreative avatar Jul 07 '16 04:07 arcreative

That would be amazing!

edgariscoding avatar Jul 07 '16 04:07 edgariscoding

Same here. Can not power off xbox via siri. It will be great if you figure it out how to do it!

tomaj avatar Feb 06 '17 18:02 tomaj

@tomaj As far as I can tell, only Microsoft can turn it off remotely, as they have a proprietary API to do it.

@edgar-sanchez-is are you still having this issue? I can turn my xbox on repeatedly without issue. Does this need another look or can I close it?

arcreative avatar Mar 04 '17 20:03 arcreative

@arcreative - I think he's asking about returning the state on the Home app to off after turning the Xbox on? Rather than having troubles turning on his Xbox?

ashman247 avatar Dec 10 '17 05:12 ashman247

@ashman247 I’m a little hazy on the history at the moment, but I think this should be fixed as a result of using a ping to determine the on/off state of the device. If it’s still a problem, let me know and I can take a look at it in the near future.

arcreative avatar Dec 10 '17 05:12 arcreative

Having the same issue. I turn on the Xbox via Siri, then I turn the console off, but Home says it is still on. I toggle it off in the app and it turns the Xbox back on again

MaxHasADHD avatar Feb 04 '18 01:02 MaxHasADHD

Okay, will try to check it out. Haven't turned my Xbox on in about a year, but I'll see what I can do :-)

arcreative avatar Feb 10 '18 07:02 arcreative

I'm having an issue where my homekit app shows the xbox as 'on' but it's not turing on the xbox.

can you help? I'd like to get the 'off' functionality to reflect on the homekit app as well if all goes well with the above issue.

thanks in advance!

mreassassin avatar Mar 12 '18 00:03 mreassassin

Hi all, this was the reason I was originally ambivalent to merge #4, since I don't believe it will issue the "turn on" command if the device is (or is perceived to be) on already. Since we don't have the ability to turn it back off, I had originally set it up so you could just issue turn on commands all day, regardless of state. Thoughts?

arcreative avatar Mar 23 '18 15:03 arcreative

I'm still not having any luck to get my xbox to turn on... the command is being received by homebridge and ip and live ID are correct. I'm trying to get it to work on my xbox one x. also tried on my other 2 xbox ones with no luck tho... any advice?

mreassassin avatar Jun 26 '18 05:06 mreassassin

Is it hard wired into the network?

JayShallcrass avatar Jun 26 '18 07:06 JayShallcrass

yes.

I'm wondering if I have pplugins in different directories. if i run 'homebridge' vs. 'sudo homebridge' i get different accessories recognized. Also, running 'homebridge' homekit doesn't connect. Maybe my network is jacked?

I'm now trying multiple xbox's. not sure if that's allowed, but really just need it on the first xbox one x.

{
	"bridge": {
		"name": "Homebridge1",
		"username": "CC:22:3D:E3:CE:30",
		"port": 51826,
		"pin": "131-45-154"
	},
	"description": "This is Marios Homebridge.",
	"platforms": [{
		"platform": "Wink",
		"name": "Wink",
		"client_id": "<redacted>",
		"client_secret": "<redacted>",
		"access_token": "<redacted>",
		"refresh_token": "<redacted>"
	}],
	"accessories": [{
		"accessory": "Xbox",
		"name": "Xbox One X",
		"ipAddress": "<192.168.1.36>",
		"liveId": "<MYLIVEIDHERE>",
		"tries": 10,
		"tryInterval": 1000,
		"waitForLastTry": false
	}, {
		"accessory": "Xbox",
		"name": "TF Xbox One",
		"ipAddress": "<192.168.1.35>",
		"liveId": "<MYLIVEIDHERE>",
		"tries": 10,
		"tryInterval": 1000,
		"waitForLastTry": false
	}, {
		"accessory": "Xbox",
		"name": "Xbox One",
		"ipAddress": "<192.168.1.41>",
		"liveId": "<MYLIVEIDHERE>",
		"tries": 10,
		"tryInterval": 1000,
		"waitForLastTry": false
	}]
}

any help appreciated!

thanks!

mreassassin avatar Jun 27 '18 17:06 mreassassin

Hi @mreassassin, I would definitely recommend using static IPs for starters to make sure your Xbox IPs aren't bouncing around. Something over 192.168.1.2xx should be good, since that's usually outside of the DHCP pool. It should also be fine to target multiple Xboxes, though admittedly I've never tried it with an Xbox One S. I think it's also imperative that all the devices are set in the hot sleep mode (can't remember what this is called), because if it's fully off, it won't respond to the broadcast packet. Can you verify and let us know?

arcreative avatar Jun 27 '18 19:06 arcreative

yes, all of these are true, other than assigned an IP in the 200 range. I did make them all static though. xbox is in 'rest mode' or whatever. the main one I'm looking to get working over homekit is the xbox one X (not S). so not sure if that's an issue.

mreassassin avatar Jun 27 '18 21:06 mreassassin

running 'sudo homebridge' does NOT get me any changes that I make to my config.json file. only running 'homebridge' does. which doesn't connect to homekit (maybe it's not the same accessory?). it's somehow referencing some older version of my config.json file. did I maybe update my node version at some point and that is now cached? should I uninstall homebridge and re-install? how can I be sure all plugins are installed in the proper directory. I see some ended here:

/usr/local/lib/node_modules

and some in:

/home/pi/node_modules

only one config.json file exists though.

mreassassin avatar Jun 28 '18 00:06 mreassassin

I would think that the ones in /home/pi are a result of running npm install <whatever> without using the -g command... Not sure if you have a package.json in that directory, but I would personally rimraf node_modules in your home folder to remove any doubt. If you know you're not going to be running node from other users, chowning the /usr/local/lib directory has been useful for me in the past as well. Not sure about your specific situation though, I still haven't been able to reproduce the "not working" issue!

arcreative avatar Jun 28 '18 00:06 arcreative

It's also worth mentioning that your config could reside in either /home/pi/.homebridge/config.json or /root/.homebridge/config.json, or somewhere entirely different. You might want to use locate to see if there are some extraneous ones. Ideally, I think you would want it running under the pi user, so would refrain from using sudo if at all possible.

arcreative avatar Jun 28 '18 00:06 arcreative

not sure what you mean by chown? chown /usr/local/lib ??

I emptied out all of the homebridge plugins and it's still somehow finding them with 'sudo homebridge', but not 'homebridge'.

hmm....

mreassassin avatar Jun 28 '18 00:06 mreassassin

Yes, chown pi:pi /usr/local/lib/node_modules if there are mixed directory permissions on it (which happens when you install global modules with sudo), so you don't have to run with sudo in the future. Again, make sure no other users need to use it if you're going to do that.

arcreative avatar Jun 28 '18 00:06 arcreative

Need to use sudo for that... you don't have permission to give yourself more permission :-)

arcreative avatar Jun 28 '18 01:06 arcreative

got cha!

quick update.

I can now run homebridge without sudo and it connects in homekit, AND recognizes the new updates! (I deleted the accessory in homekit and re added it with the QR code from the non sudo homebridge)

still no luck getting the xbox's to turn on though. triple checked all the numbers. the xbox app on iphone works fine so everything seems to be talking to each other on the network elsewhere.

mreassassin avatar Jun 28 '18 01:06 mreassassin

just found some more plugins living here: /home/pi/.nvm/versions/node

I'm pretty sure these are the ones it's actually using. is this bad? I'm trying to update to node version 10.x also. or at least 8.x. not sure if that's relevant.

mreassassin avatar Jun 28 '18 02:06 mreassassin

Hi, do I need to manually install dependencies to get this to work? Cheers!

PerthSteve avatar Jul 03 '18 07:07 PerthSteve

@PerthSteve nope, just the global plugin install.

arcreative avatar Jul 03 '18 18:07 arcreative

I still cannot, for the life of me, get this thing to work! 🤣 I completely reformatted my SD card for my pi. Reinstalled raspbian lite. Reinstalled homebridge and all plugins. Xbox sends signal but never once has it actually turned in the Xbox. Tried on 3 different xboxes triple checking all numbers were correct for each. Any ideas?? Also, Is the On/off plugin still in development?

mreassassin avatar Jul 05 '18 17:07 mreassassin

i not understand if this plugin work only with xbox one X or if it works on xbox one S and xbox one the 1st model.. And I not understand if the siri command to "turn on xbox" work only if the xbox is in the (I do not know how to translate it correctly) "fast resume state" or if it work even if the xbox is in the "energy saving" mode... EDIT: I'm pretty sure that works only with the power set to the "fast resume state". but asking don't cost anything... There is noone that can clarify this to me? thank you

alessandrocroci avatar Jul 23 '18 14:07 alessandrocroci

@alessandrocroci This plugin was developed for the original Xbox One--I don't have an S or X model to test it on for confirmation. It will only work in the "Instant-on" power mode, otherwise, I don't believe the device is listening to the network.

arcreative avatar Jul 25 '18 21:07 arcreative

@alessandrocroci This plugin definitely works on Xbox one s however can sometimes be intermittent.

TheHomekitWayFinder avatar Jan 26 '19 09:01 TheHomekitWayFinder

@arcreative can you please have a look at this as it may help advance this plugin further in order to allow people to turn off their Xbox One game consoles through homekit. https://openxbox.org/

TheHomekitWayFinder avatar Jan 26 '19 09:01 TheHomekitWayFinder