• Become a Premium Member for $25/year with no ads to improve your community experience.

GUIDE How to Patch DSDT for a working Battery Meter

EliteMacx86

Administrator
Staff member
Joined
Jul 22, 2018
Messages
8,263
Motherboard
Supermicro X11SPA-T
CPU
Intel Xeon W-3275 28 Core
Graphics
2xAMD RX 580 8GB
OS X/macOS
13.x
Bootloader
  1. OpenCore (UEFI)
Mac
  1. Mac mini
  2. MacBook Pro
Mobile Phone
  1. Android
  2. iOS
How to Patch DSDT for a working Battery Meter

An EliteMacx86 Exclusive Guide - This guide covers the implementation of the Battery meter on macOS using Clover and OpenCore. This will also enable Trackpad Preferences under System Preferences>Trackpad.

Overview


For a laptop, a working battery meter is a must. Enabling the Battery meter will help you to monitor your Battery so that you do not overcharge your Laptop or you don’t get out of your Battery. In macOS, the battery meter doesn't work out of the box. This is because the laptop battery hardware is not compatible with the AppleSMbus hardware. You need to use ACPI to access the battery state when running macOS on the laptop.

Many patches are available in the RehabMan repository and can be used for making a battery meter work for almost any laptop.

Before you start the patching, get to know about your hardware.

To start the patching for the battery meter, follow the DSDT and SSDTs patching guide below.

After applying the necessary patches, it's time to apply the patches for a working battery matter.


Dual Battery


On Apple computers, no Mac has multiple batteries and due to this macOS does not have proper support for Laptops with Dual Batteries and bugs can occur in macOS itself when presented with multiple power sources. For Dual Batteries Laptops, the idea is to implement the ACPI patches such that the two "real" battery objects are disabled and a new battery object is created that consolidates the two real battery objects, such that the systems sees only one power source. In short, you need to merge the two batteries as one in ACPI. Refer to the Dual Battery Guide for more information.

Cycle Count


RehabMan's ACPIBatteryManager had zprood's _BIF extension technique for providing cycle count. This technique is not supported by the new SMCBatteryManger. Refer to Cycle Count Guide for more information

Supplemental Battery Information


A majority of Laptops provide supplemental battery information such as the manufactured date and battery temperature in the EC fields. However, the traditional _BIF, _BIX and _BST methods do not support supplemental battery information. Luckily, SMCBatteryManager supports two additional methods CBIS and CBSS respectively to provide the supplementation battery information on macOS. Refer to Supplemental Battery Information Guide for more information.

Enabling Battery Status

STEP 1: Remove Outdated Kexts



The first step is to remove the depreciated kexts which can interfere with the Battery Status implementation. To remove such, follow the steps below.

Kext Removal
If you're using NullCPUPowerManagement, it is recommended to remove it. See notes below.

1. Mount your ESP
2. Remove VoodooBattery.kext

NOTES:
  • If you're using OpenCore, you'll also need to remove the kext entries from your kernel section in your config.plist
  • For Catalina and prior, make sure these kexts don't exist in Library/Extensions or System/Library/Extensions.

STEP 2: Enable Battery Status


Method #1: Kext Only

Using this method, ACPI patching is not required for a working battery meter.

STEP 1: Add Required Kexts

1. Download VirtualSMC.kext and ECEnabler.kext from the downloads section of this forum.
2. Mount ESP

For Clover:
If you're using Clover, copy the SMCBatteryManager.kext from the VirtualSMC>Kexts folder to EFI/Clover/kexts/Other
Copy ECEnabler.kext to EFI/Clover/kexts/Other

For OpenCore:
If you're using OpenCore, copy the SMCBatteryManager.kext from the VirtualSMC>Kexts folder and ECEnaber.kext to EFI/OC/Kexts.
Copy ECEnabler.kext to EFI/OC/Kexts

You'll also need to add the kexts entry in the Kernel section of your config.plist

STEP 2: Restart your Laptop

After performing all the above steps, restart your system for the applied changes to take effect.
You should see a Battery Meter in the menu bar.

NOTE:
If you want to have any additional functionality beyond the battery meter such as cycle count, temperature, and other supplemental data, you'll need to patch the ACPI. The same applies if you have a Dual Battery Laptop.

Method #2: Using ACPI Patch
Using this method, you need to patch the ACPI.

STEP 1: Applying the Patches

To apply the patch, follow the steps below.

1. Download MaciASL from the downloads section of this forum.
2. Open your DSDT using MaciASL
3. The battery patches start with "[bat]".
4. Depending on your laptop model, select the patch from the left pane in MaciASL.
5. Click on Apply
6. Click on Close

NOTES:
  • The laptop model no. needs to be exact for the proper functioning of the battery meter.
  • Some laptop models may not be listed. In this case, you'll need to select a patch that is nearest to your laptop model.

For example, a typical laptop from ASUS:
Laptop: ASUS VivoBook X510UA
Battery Patch: [bat] ASUS N55SL/VivoBook

Compiling

After patching the DSDT and SSDTs, you need to compile the files.
Simply click on compile and look for errors. If there's any error, fix it and again click on Compile.
If there's no error, the files will be compiled successfully.

Saving the ACPI file

After compiling, the next step is to save the file for installation.

1. Go to File
2. Select Save as
3. A dialogue box will appear asking the location and the file extension to save the file.
4. Select ACPI(ACPI Machine Language)
5. Click on Save

STEP 2: Add Required Kext

After patching the DSDT, the next step is to install the Battery kext to serve the purpose.

1. Download VirtualSMC from the downloads section of this forum.
2. Mount ESP

For Clover:
If you're using Clover, copy the SMCBatteryManager.kext from the VirtualSMC>Kexts folder to EFI/Clover/kexts/Other

For OpenCore:
If you're using OpenCore, copy the SMCBatteryManager kext from the VirtualSMC>Kexts folder to EFI/OC/Kexts. You'll also need to add the kexts entry in the Kernel section of your config.plist


NOTES:
  • VirtualSMC and SMCBatteryManager must be the same version.

STEP 3: Restart your Laptop
After performing all the above steps, restart your system for the applied changes to take effect.
You should see a Battery Meter in the menu bar.

Credits :
RehabMan
 
Last edited:
Hello
I am having small doubt. I have patched the DSDT & SSDTs. Now as I want to enable Battery Meter I am following this above guide. So which DSDT & SSDTs should I take for patching Battery Meter. Also do I need dsl files of DSDT & SSDTs for this patching (if yes then should I have to create these dsl files form the EFI/CLOVER/ACPI/patched folder and then apply the above patches; because DSDT & SSDTs stored here are latest patched). Or should I directly open the DSDT & SSDTs aml files using MaciASL from EFI/CLOVER/ACPI/patched and apply the above patches then save the file (whether this is allowed or not?).
Also I need to apply above patched in DSDT & All SSDTs????

Sorry for making so much confusion despite of above well explained guide.
Thanking you.
 
Last edited by a moderator:
Hello
I am having small doubt. I have patched the DSDT & SSDTs. Now as I want to enable Battery Meter I am following this above guide. So which DSDT & SSDTs should I take for patching Battery Meter. Also do I need dsl files of DSDT & SSDTs for this patching (if yes then should I have to create these dsl files form the EFI/CLOVER/ACPI/patched folder and then apply the above patches; because DSDT & SSDTs stored here are latest patched). Or should I directly open the DSDT & SSDTs aml files using MaciASL from EFI/CLOVER/ACPI/patched and apply the above patches then save the file (whether this is allowed or not?).
Also I need to apply above patched in DSDT & All SSDTs????

Sorry for making so much confusion despite of above well explained guide.
Thanking you.
The guide says to apply the patches in the DSDT not any other SSDTs. If you're starting from scratch, and the DSDT is not patched, you can use the .dsl file and apply all the patches. If already patched, just apply the battery patch to the .aml file of your DSDT, the patched one.
 
Thanks. Now the thing is clear for me. (y)(y)(y).
Will do the patch and reply.


Hey its working. The Battery meter is shown in menu bar.
Thanks.(y)
 
Last edited:
What can i do to find out wich notbook model is closest to mine? The one i have is not listened there: CCE N325 i3. Thanks for ur atention.
 
What can i do to find out wich notbook model is closest to mine? The one i have is not listened there: CCE N325 i3. Thanks for ur atention.
What's your Laptop model no.?
 
What's your Laptop model no.?
CCE model N325 - HM75 - 7 Series/216 (intel core i3 Ivy bridge) graphics Intel HD 4000.
or is it something else then this?
 
CCE model N325 - HM75 - 7 Series/216 (intel core i3 Ivy bridge) graphics Intel HD 4000.
or is it something else then this?
Can you provide link to your Laptop model?
 

Forum statistics

Threads
1,903
Messages
17,669
Members
27,447
Latest member
rifkhanjf