and here a more complete version:
https://www.dropbox.com/s/82aeddlijy9msvh/osx-temp-fan.zip?dl=1- Code: Select all
./osx-temp-fan
temp_AMBIENT_AIR_0:27.1
temp_AMBIENT_AIR_1:-99.0
temp_CPU_0_DIE:-99.0
temp_CPU_0_DIODE:46.9
temp_CPU_0_HEATSINK:-99.0
temp_CPU_0_PROXIMITY:43.6
temp_ENCLOSURE_BASE_0:-99.0
temp_ENCLOSURE_BASE_1:-99.0
temp_ENCLOSURE_BASE_2:-99.0
temp_ENCLOSURE_BASE_3:-99.0
temp_GPU_0_DIODE:-99.0
temp_GPU_0_HEATSINK:-99.0
temp_GPU_0_PROXIMITY:-99.0
temp_HDD_PROXIMITY:31.6
temp_HEATSINK_0:-99.0
temp_HEATSINK_1:-99.0
temp_HEATSINK_2:-99.0
temp_LCD_PROXIMITY:-99.0
temp_MEM_SLOT_0:64.0
temp_MEM_SLOTS_PROXIMITY:49.0
temp_MISC_PROXIMITY:-99.0
temp_NORTHBRIDGE:48.0
temp_NORTHBRIDGE_DIODE:63.5
temp_NORTHBRIDGE_PROXIMITY:-99.0
temp_ODD_PROXIMITY:-99.0
temp_PALM_REST:-99.0
temp_PWR_SUPPLY_PROXIMITY:-99.0
temp_THUNDERBOLT_0:-99.0
temp_THUNDERBOLT_1:-99.0
fan0Speed:856.5
fan1Speed:799.8
fan2Speed:956.5
fan3Speed:689.2
and the indigo code to import into variables:
- Code: Select all
import subprocess
### change the path to the path where the executable is located
data = (subprocess.Popen("/users/karlwachs/indigo//osx-temp-fan",shell=True,stdout=subprocess.PIPE).communicate()[0].strip("\n")).split("\n")
tUnit ="C"
t_format = "%.1f"
for line in data:
ll = line.split(":")
if len(ll) < 2: continue
if ll[0].find("temp") > -1:
t = float(ll[1])
if t < 0: continue
if tUnit == "F":
t = t*9./5/+32
try: indigo.variables[ll[0]]
except: indigo.variable.create(ll[0])
indigo.variable.updateValue(ll[0], t_format%t)
else:
try: indigo.variables[ll[0]]
except: indigo.variable.create(ll[0])
indigo.variable.updateValue(ll[0], ll[1])
It will automatically create the temp and fan variables. values of -99 mean: no info, no variable will be created.
This code assumes the executable is in ~/indigo/
It was tested under El Capitan and High Sierra
if the executable "osx-temp-fan" is not "executable", right click on file info and add "execute" to the rights.
Karl