This link and a few that follow shows a version of a Useless Box project.
The schematic below might give you some hints on what’s necessary.
The RTC and BubbleLicious are not fitted.
The relay was used rather than the P channel MOSFET.