Power bank Monitoring

Good morning

I am trying to solve a problem for an idea that I have come up with in my head and want to know if it is possible.

I want to Run a Raspberry Pi off of a power bank, ( Pocket sized ) Only for basic automation so I plant to use a Raspberry Pi Zero (Pi W0). However, this is the set up I want to try.

  1. Mains power plug with smart plug – This will then be connected to the Anker Power Bank for example. Then from the power bank it will then connect to say a Shelly relay with with power monitoring. From the Shelly it will then go into PI.

Basically, that this is what I want it to do.

The power bank will run the pi, the relay in between bank and the pi will monitor the power of the battery back and when it gets to say 15% it will then trigger the smart plug to turn on mains power to the power bank to re-charge it. Then once charged mains power will turn off.

The pie WO will only be monitoring devices that are plugged into a Meross smart power lead. x6