Yes i am doing that but you need a way to detect the power outage. Two ways I know that you can do it.

1) 2 relay boxes (1 on backup 1 not)When power is lost relay expansion is not detected and we trigger life support function.

2) Input detection. With an available float switch port or io module port you can connect to a relay that is powered by a 5v or 12v power supply. You plug that in to no a non-ups port and then you monitor that port to trigger your function