We've got a Fideltronik UPS and a Windows-based server to be kept up by the UPS and shut down on prolonged power failure. The problem is the server should restart on power return... and if power returns before the batteries run out, it won't restart.
Thing is, the server can be driven to shut down (through RS232 and a monitoring application) when desired. Setting it to power on on external power return will work if the UPS was powered down after running empty, and then power returns. But if the computer shuts down before the UPS runs off and then power returns, only a signal over RS232 will be sent (to a computer that is switched off), and the power will not be cycled, thus the computer will not boot.
One idea was be to somehow force the UPS to cycle power upon recovering it - problem is cycling the power before it did shut down. Another might be detecting power return on the line and sending a power-up/power-cycle signal over a separate line to the computer - except if we use the "power on" pins, we don't want the event to be sent while Windows is running. One more - sending "power off" signal out to the UPS right before the computer finishes shutdown (or somehow shortly after??).
This is an electronics workshop, so developing a simple circuit to help is a viable solution, and we can find power return state in the RS232 line - it isn't really used for RS232 protocol, just as 4 GPIO pins, CTS high = power is on.