Edit: I’ll probably use the wifi connection as an indication of power outage:)
I got a UPS that apparenlty doesnt send a shutdown signal when power goes off from the mains. What could I do to let the server know ac power is off and gracefully shut down?
My ups: Powertech UPS 1150VA Line Interactive PT-1150LI https://www.skroutz.gr/s/23613693/Powertech-UPS-Line-Interactive-1150VA-690W-me-2-Schuko-Prizes.html
I’m thinking of somehow having a device sending an “on” signal when connected to the mains that when it is interrupted (like, gone for X amount of time) the server shuts down. Then also set my server to attempt to boot up automatically every half an hour.

Yeah I guess its for non-computer loads indeed:/
The wake on lan is a good idea, but I have a feeling it may not work well over wifi (yeah Im using wifi for internet💀), but I could use a wifi extender with ethernet output.
Either way, for powering on I saw that asrock (and many other motherboards) has an option to turn on the pc after ac outage so I might use it
For turning off I’ll have it periodically ping my isp’s dns or something and if theres no connection for some time it’ll shut down or at least go into sleep mode.
(I’ll include my build specs in the post)
If you have the machine turn on when AC is restored the UPS battery will still not have recharged, and if you have a second power cut or another glitch (not unlikely if it’s an intermittent fault upstream of you) the UPS will not be able to supply power, so your server will suddenly lose power.
UPSs for computers usually delay restoring power to their load until their battery is recharged at least a certain amount. It doesn’t look like yours has a control for that, but if it does you might be OK, otherwise you’ll want to make the delay happen some other way. You could connect a Pi directly into your server’s ethernet port with a cross over cable and do WoL through that.
A pi and a wifi extender with ethernet output (I think I have the latter) would probably complete this setup, but hmm Im already over budget and too bored to buy and set up a pi right now. Maybe I’ll do it that way in the future.
At least where the server is rarely ever there power outages, let alone concurent power outages.