It is currently July 19th, 2019, 12:39 am

XBOX ONE Wireless Controller battery percentage

Help with creating, editing & fixing problems with skins
User avatar
StArL0rd84
Posts: 336
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

XBOX ONE Wireless Controller battery percentage

StArL0rd84 » November 7th, 2015, 6:45 pm

It's finally done.
After a long jurney of frustration and EUREKA moments, I am happy to present:

XONE 2.0 - Battery Level For Wireless Controller
Image

Skins Included:
1. Controller Button Visualizer + Battery.
2. Battery Only.
3. Settings.

Features:
1. Change colors.
2. Voice wanings/alerts.
3. Voice Volume / Speed.
4. Connected / Disconnected alert.
5. Low battery warning.
6. Battery check combo buttons.
7. Calibration.
8. Eight Battery Themes.

Most of these features can be turned off if needed, using the settings skin.

Please ask if you have any questions about my skin.
And suggestions for next update are appreciated.

Please download from my DeviantArt page.
That way i can track downloads.
And you'll get the latest update.
http://starl0rd84.deviantart.com/art/XONE-2-0-Battery-Level-For-Wireless-Controller-625843595

And i must not forget to thank you dgrace, jsmorley & Thurion for the huge help you have been.
Thanks for enabling the battery feature inside the xInput plugin.
You have made a lot of people happy.
Last edited by StArL0rd84 on August 15th, 2016, 8:49 pm, edited 7 times in total.
(#WorkTime# = 1 ? #Work# : ([mEnergyLoss:%] > 100 ? #SleepMode# : #Rainmeter#))
User avatar
dgrace
Developer
Posts: 265
Joined: June 28th, 2014, 8:32 am
Location: Tokyo, Japan

Re: XBOX ONE Wireless Controller battery percentage

dgrace » November 8th, 2015, 11:32 pm

I wrote a plugin to parse data from XInput a while back, so you can get the joystick and button states, but the API doesn't return any info about the battery power. Still, you might find it interesting.

https://forum.rainmeter.net/viewtopic.php?f=18&t=20108&hilit=xinput

dave
User avatar
dgrace
Developer
Posts: 265
Joined: June 28th, 2014, 8:32 am
Location: Tokyo, Japan

Re: XBOX ONE Wireless Controller battery percentage

dgrace » November 8th, 2015, 11:38 pm

Actually just checked, there is a way to get battery info. I'll add it to the plugin.

dave
User avatar
dgrace
Developer
Posts: 265
Joined: June 28th, 2014, 8:32 am
Location: Tokyo, Japan

Re: XBOX ONE Wireless Controller battery percentage

dgrace » November 9th, 2015, 12:08 am

Sorry, spoke too soon. It's in a new version of the API that requires Win8+ to build, and I'm not going to upgrade from Win7 for a while yet. But if you're interested in learning how to do it, here's where to start:

https://msdn.microsoft.com/en-us/library/windows/desktop/ee417001%28v=vs.85%29.aspx

dave
User avatar
StArL0rd84
Posts: 336
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: XBOX ONE Wireless Controller battery percentage

StArL0rd84 » November 26th, 2015, 9:23 pm

dgrace wrote:Sorry, spoke too soon. It's in a new version of the API that requires Win8+ to build, and I'm not going to upgrade from Win7 for a while yet. But if you're interested in learning how to do it, here's where to start:

https://msdn.microsoft.com/en-us/library/windows/desktop/ee417001%28v=vs.85%29.aspx

dave

Thanks Dave, i will check it out and repport back :thumbup:
(#WorkTime# = 1 ? #Work# : ([mEnergyLoss:%] > 100 ? #SleepMode# : #Rainmeter#))
User avatar
dgrace
Developer
Posts: 265
Joined: June 28th, 2014, 8:32 am
Location: Tokyo, Japan

Re: XBOX ONE Wireless Controller battery percentage

dgrace » November 26th, 2015, 11:31 pm

Actually, here's my code. If you build this under Win8+ and enable DO_BATTERY at the top it should work, hopefully. (I can't compile it on my end with that enabled until I upgrade to Win10, but give it a shot)

https://github.com/dcgrace/XInput

Note the low level API only returns empty/low/med/full, not a full percentage range.

dave
User avatar
StArL0rd84
Posts: 336
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: XBOX ONE Wireless Controller battery percentage

StArL0rd84 » November 27th, 2015, 3:56 pm

Thanks for all your help and sharing your work with me :D
The Rainmeter skin worked perfectly out of the box, and i can see the bars and stuff move when i use the controller.
I changed it a bit and tested the connected feature as well. (It works)
rain.jpg
But i find myself in a bit of a spot again, trying to compile the new dll's incorporating the new battery feature :(
I Downloaded Visual studio 2015 and changed DO_BATTERY to 1 at the top. But i am unsure how to create / compile .dll's.
I tried to click Build > Build solution but got 22 Errors.
I'm a Newbie, i know XD
visu.jpg
Maybe there is a easy fix for me, and you could point me in the right direction, but if not...
If you need Win10 to make the dll's, and don't want to upgrade right away, then maybe you could install it in a virtual box. (The technical preview should be free)
I know this would take some time for you, but i am a bit over my head here, so i would be willing to pay you if you would take the time to do it for me.

Michael
You do not have the required permissions to view the files attached to this post.
(#WorkTime# = 1 ? #Work# : ([mEnergyLoss:%] > 100 ? #SleepMode# : #Rainmeter#))
User avatar
dgrace
Developer
Posts: 265
Joined: June 28th, 2014, 8:32 am
Location: Tokyo, Japan

Re: XBOX ONE Wireless Controller battery percentage

dgrace » November 29th, 2015, 7:36 am

Probably easier if you can get jsmorley to grab the code and build it on his end. Should only take a few minutes and then he can post the plugin. Walking someone through "never compiled a line of C" to "functioning Rainmeter plugin" is a bit more than I can commit to.

dave
User avatar
StArL0rd84
Posts: 336
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: XBOX ONE Wireless Controller battery percentage

StArL0rd84 » November 29th, 2015, 12:39 pm

Ok i will try and do that. Tnx again for everything

Michael
(#WorkTime# = 1 ? #Work# : ([mEnergyLoss:%] > 100 ? #SleepMode# : #Rainmeter#))
User avatar
jsmorley
Developer
Posts: 19293
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: XBOX ONE Wireless Controller battery percentage

jsmorley » November 29th, 2015, 1:18 pm

I have no particular expertise in C++, don't have an XBox, and will not even attempt to debug any problems you might run into, but I certainly can simply create the 32bit and 64bit versions of the plugin using your code and the Rainmeter Plugin SDK:
XInput.zip
This is compiled and linked using VS2013, running under Windows10. I have no possible way to test the plugin, but If you make changes to the code and need me to re-compile it for you, I'm happy to do that.
You do not have the required permissions to view the files attached to this post.