I actually have a HA VM on the Proxmox node that has a NUT client that reads the Status data
of the UPS (provided by the NUT server) & when the status goes to OB
(on battery) for a period of time, shuts down the Proxmox node. I do it via API. You could also do it via SSH.