Skip to main content
Solved

Battery Health Attribute

  • January 29, 2025
  • 4 replies
  • 151 views

Forum|alt.badge.img+14

In 11.11 a new attribute for macOS was released - Battery Health.  However the only value I see reported for any of my computers over 14.4 is Unknown.  Is anyone seeing this work?  There is a note stating that this will work for iOS but not iPadOS - but nothing about it not working for macOS.

Best answer by bfrench

This appears to be a Known Issue

 

PI122901 Eligible computers and mobile devices may incorrectly display "Unknown" as a Battery Health status.

4 replies

Shyamsundar
Forum|alt.badge.img+13
  • Jamf Heroes
  • January 29, 2025

i'm experiencing the same issue; all our Mac Devices are displaying as unknown in the results.


Forum|alt.badge.img+14
  • Author
  • Valued Contributor
  • Answer
  • January 29, 2025

This appears to be a Known Issue

 

PI122901 Eligible computers and mobile devices may incorrectly display "Unknown" as a Battery Health status.

snowfox
Forum|alt.badge.img+9
  • Contributor
  • January 29, 2025

Try this extension attribute as a work around:

Battery Health Status

#!/bin/sh result=`ioreg -r -c "AppleSmartBattery" | grep "PermanentFailureStatus" | awk '{print $3}' | sed s/\\"//g` if [ "$result" == "1" ]; then result="Failure" elif [ "$result" == "0" ]; then result="OK" fi echo "<result>$result</result>"

 


Forum|alt.badge.img+9
  • Valued Contributor
  • January 30, 2025

this is another script that you could use as well:

#!/bin/sh #Determine model arch=$(/usr/bin/arch) model=`system_profiler SPHardwareDataType | grep "Model Name:" | cut -d ' ' -f 9` if [[ ! "$model" =~ "Book" ]]; then echo "<result>Not A Laptop</result>" return 0 fi if [ "$arch" == "arm64" ]; then capacity=$(system_profiler SPPowerDataType | grep "Maximum Capacity:" | sed 's/.*Maximum Capacity: //') echo "<result>$(system_profiler SPPowerDataType | grep "Condition:" | sed 's/.*Condition: //') with $capacity capacity</result>" elif [ "$arch" == "i386" ]; then echo "<result>$(system_profiler SPPowerDataType | grep "Condition:" | sed 's/.*Condition: //')</result>" else echo "<result>Unknown Architecture</result>" fi