Configuring APCUPSD to shutdown Raspberry PI

I had a few SD card failures due to power loss so I installed apcupsd under openhabian and configured it to connect to my UPS master (server).

as described here: https://www.pontikis.net/blog/apc-ups-master-slave-setup-apcupsd

I can see the status of the UPS in the logfile and using apcaccess.

How do I configure it to shutdown the rasberry pi once a power failure has occured?

I setup the mintime and other APCUPSD parameters but one I had a power failure (today) it didn’t shutdown the PI and I once again have an SD corruption :frowning:

Do I need to do anything else to have it shutdown the RPI once a power failure occurs?

That’s very strange. I got a number of power outages in the last half year, but I never got a single SD corruption. I do have a reminder to back up the SD card just for this scenario, but I have been lucky so far.

As vzorglub mentions, you can detect when power is out, and create a rule to execute a shell command to shutdown the PI.