Looking for a DIY (or OTS) project for a Pi3+ that allows the Pi to detect when main power has been lost, do a controlled shutdown, and then automatically power up the Pi again once main power has been restored.
I'm assuming this would require a small battery to supply power to the Pi in the event of mains power loss so it has enough juice to do a controlled shutdown.
It would also need to have some electronics to tell the Pi that its running off battery, so it can know to shut down gracefully.
And them some sort of way for the Pi to be powered back on again once mains power has been restored.
Anyone know of such a project, DIY or OTS that does this?
I have no idea what to Google for.