TL;DR: I need a cheap and simple way to run script on PC whenever there is a power cut.
I have a high power desktop, and APC UPS (BR1500VA). I live in a city with about 1 power outage every day, for about 1 hour. The UPS makes huge noise when that happens, and by default it puts PC to hibernate if I am away. I have 32GB RAM, and windows installed on SSD, and I think hibernation is a bad (and very slow) idea. Also, when I come back and turn PC on, the UPS makes fan noise for very long time, because it is charging, because of the power it lost during the slow hibernation. Shutting PC down is not good because my work sessions take long to open after boot. I usually put my PC to sleep when I am away. So I am thinking to plug my UPS into my house battery backup. PC will get power form UPS, which will get power from house backup. The house backup cannot take the load of my running PC, it will dim all the lights in the house or maybe shut down for a minute. All I need is a way to send an automatic signal to the PC about power outage, and then my PC will go into sleep mode. It will use about 10 Watts while it sleeps, and the UPS might ask for 11 watts. At this point the house backup will become happy and it will give 11 watts to the UPS as long as it can. Offcourse when the house backup runs out of battery, it will shut down, and UPS will hibernate the PC, that is too rare to occur.
I just need a cheap and reliable way to send the signal to my PC. On receiving the signal, I want to run a script that will put my PC into sleep if I am away. Or put it into low power mode so that I can continue working.