smcDiagnose: Dump all the sensors on a Mac

From Wikistix

There's an apparently hidden and undocumented tool on Mac OS X that will dump the current values for all the various system sensors: thermal (temperature), fan speed, voltage, etc. Each has a 4 character tag, the first character appears to map to the class: 'T' is thermal, 'F' is fan, 'V' is voltage, 'B' is battery, etc.

I found a fairly comprehensive description of the tags on github, in the acidanthera/VirtualSMC project, in the file SMCKeys.txt. There is also reasonable code found in modern MenuMeters code.

Some of these were documented in AccumulatorPlatformStructLookupArray inside /usr/lib/libSMC.dylib which doesn't appear to be present on my 11.5.2 machine.

Example output for thermal sensors, with output apparently in Celsius:

$ /usr/libexec/smcDiagnose | grep '^T... '
TA0V , 25.214844
TB0T , 36.199219
TB1T , 32.699219
TB2T , 36.199219
TC0E , 57.832031
TC0F , 59.179688
TC0P , 49.312500
TC1C , 57.000000
TC2C , 57.000000
TC3C , 57.500000
TC4C , 53.500000
TCBC , 57.484375
TCGC , 55.000000
TCIC , 0x00 00 00 39
TCSA , 57.000000
TCXC , 57.484375
TDFR , 41.105469
TF0S , 3.535156
TH0F , 35.933594
TH0X , 35.949219
TH0a , 35.949219
TH0b , 35.507812
TM0P , 47.187500
TPCD , 52.000000
TTRD , 43.812500
TTTD , 44.250000
TTWD , 37.187500
TTXD , 38.500000
TW0P , 49.625000
TaLC , 38.000000
TaRC , 34.000000
Th1H , 46.625000
Th2H , 48.500000
Ts0P , 30.500000
Ts0S , 38.839844
Ts1P , 28.625000
Ts1S , 41.105469
Ts2S , 38.5625