You should consider a UPS to avoid such inconveniences
Secondid. Although this didn’t save me from the house/dog sitter from turning mine off with the power button on day 2 of a 10 day trip 😭