beltex / SMCKit

Apple SMC library & tool
https://beltex.github.io/SMCKit
MIT License
475 stars 55 forks source link

Get power information #32

Closed larryqiann closed 7 years ago

larryqiann commented 7 years ago

in iStat Menus 6, it is possible to view the CPU, DC-In, and other powers (in watts, volts, and amps).

Is there support for these features in SMCKIt? I had a look through the code and it doesn't appear to have them.

Thanks!

beltex commented 7 years ago

Hello @chendragon2099!

There is some power info via the SMC, but not CPU and such, thus these wouldn't be a part of SMCKit. Sounds like what your looking for is something like dshb, which has more of what you listed but not all, yet :)

Hope that helps!

perfaram commented 7 years ago

@beltex : Actually, all the data requested by @chendragon2099 is available through the SMC (current, voltage and power, including regarding the CPU). So we could expand SMCKit to support the keys matching data requested by @chendragon2099. I used to have a fairly complete list of the SMC keys and their meaning, but I can't find it anymore... will report if I find it.

perfaram commented 7 years ago

@chendragon2099 It might be worth noting that SMCKit only supports temperature keys so far, so that's why you can't seem to find what you're looking for.

However I remember that the keys 4-char identifiers kind of made sense... like, the voltage ("DC-In") of the CPU's first core is VC0C ; for the second core it is VC1C ; etc... (SMC's 4CC identifiers use 0-based indexing).

perfaram commented 7 years ago

Okay, I found the list (lists, actually) I was talking about.

This one has quite a bunch of keys but is redundant (i.e. it has VC0C, VC1C, VC2C, etc... while only VC0C could've been enough, given that the keys follow a pattern). https://gist.github.com/perfaram/f886465e65b7851d17c1ba596ba742eb

A list with longer descriptions : https://gist.github.com/perfaram/f886465e65b7851d17c1ba596ba742eb

Finally, here's a list of keys and their types : https://gist.github.com/perfaram/7e96785609164cf238c6a4414d7b1edd

The first one is credit @jrw01, but he deleted all his account and can't be found anywhere. The second and third ones are (I think) credit parhelia.ch, but their website has been replaced by a placeholder Wordpress site.

DISCLAIMER : Please note that although I parsed the data from these sources and created the plist files, copyright should be given to the aforementioned authors. It's also likely I corrected, added, removed, or in any other way modified informations contained in these files. I cannot be held accountable for any kind of damage, prejudice, or harm (or whatever) that may arise from the use of the provided information.

EDIT : It appears I also had a backup of parhelia.ch's "k3_keys" page. Here's a link https://gist.github.com/perfaram/98c4aa99b614ec7728711b1d26485fd0