I’m trying to embellish the Xbox sensor a bit. Below is the code I use for exposing its value and an icon reflecting the state.
The thing is, XBOXonline often doesnt kick-in automatically and the sensor.gamertag isn’t created and not displayed .
Hence, below template sensor isn’t created nicely, and the value and icon template do nothing.
Can I add a check for the existence of sensor.gamertag before it runs the rest if the templates below? Preferably i would like it to show sensor.gamertag with ‘login’ or something like that as state and have the
template sensors display Offline.
It would be great if something could be made. I’ve found the xboxapi to be very unreliable. It has never worked for me. It always tells me I have to log in again by going to the website, logging in and getting a new key or something.
Something like what is available for the PS4 would be great. There is a tool that’s used called PS4waker, and it’s great!! Shame there is no official xbox api, or some way to monitor over local network.
been some experimenting, but finally made it to something workable…
next up, differnetiate between icon and text templates…
Issue at hand is that the sensor template gets its value from whats playing, so the icon and value template will have to take that into account, which makes is less straight forward than simply on/off or home/not_home…
Not even sure which states are to be expeted yet, as Sims4, Starwars, Tomb-raider etc have yet to be implemented…
But I don’t use that right now so you can skip that if you like. It used it in an attempt to automatically fill in my real gamertag by and substituting {{ gamertag}} everywhere .