@HollyM11, Welcome to the HP Support Community!
Thank you for visiting the HP Forums! A great place where you can find solutions for your issues with help from the community! I understand you are having an issue with your HP laptop it charges only when it is either shut down or in sleep mode. Don't worry we'll work together to find a solution for you.
To provide you with an accurate solution, I'll need a few more details:
Did this happen after a recent update or upgrade to Windows 10?
Have you made any changes on the PC before the issue started?
Have you tried to update the drivers either from Windows update/HP Support Assistant?
In the meantime, let's try these steps here:
Unplug the charge and use the laptop until the battery drains to 15%.
Turn off the laptop and turn it back on after 30mins.
Reinstalled Microsoft ACPI-Compliant Control Method Battery under device manager,
Restart the computer and the issue should be fixed.
Also, Go through them all and let me know what you have determined is causing the issue. The first document has the most relevant troubleshooting if your battery appears to be not charging.
I would suggest please update the BIOS on your PC and check if it helps.
Also, download and install HP support assistant on your PC. It should automatically download and install the latest updates and drivers for your PC.
Refer to this link to know how to use HP support assistant.
Battery Does not Power Notebook or Hold a Charge
HP Notebook PCs - Testing and Calibrating the Battery (Windows 10)
Hope this helps! Keep me posted.
Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
Click the “Kudos, Thumbs Up" on the bottom right to say “Thanks” for helping!
Have a great day!