CPU temperature using sysctl I'm trying to get CPU temperature from the terminal using sysctl.

Command:

sysctl machdep.xcpm.cpu_thermal_level


Output:

machdep.xcpm.cpu_thermal_level: 0


But the given temperature is not correct(Original temperature is: 51c).

How does the temperature is calculated by sysctl? Sometimes the temperature is 0.

Why the temperature is wrong?

Thank you.
I think that's the CPU throttling, not temp - see here: -
What does machdep.xcpm.cpu_thermal_level mean?
This shows your temps:-
sudo powermetrics --samplers smc