Beware that electricity interruptions are liable to reset your BIOS settings to default, after which it will "forget" it was supposed to do things like boot without a keyboard, or turn on after power loss. Consumer grade routers are also liable to forget their settings and go stupid. Very irritating.
If you are not dealing with server-grade hardware, the best solution is a sturdy UPS which is regularly tested. (If you are dealing with server-grade hardware, the best solution is still a sturdy UPS which is regularly tested.)
Or, if your needs are small, there was a late-90's-era PC which had actual DIP switches for "resume after power loss". It'll never forget.