

Some laptop battery firmware allows you to force discharge even when connected to AC, and if your laptop can use the tlp recalibrate
or tlp discharge
commands then yours is supported.
I use this to power my thinkpad servers off of their own batteries during a power outage, to reduce load on my UPS. Great feature.
The ups has data output to my firewall/router via usb, which the baremetal servers all connect to via apcupsd. When the ups loses or regains AC power, it broadcasts a message to all of them and they’re each scripted to act accordingly: laptops run on their own batteries, vms migrate over to laptops, non-vital hardware shuts down, etc.