Use "Automate"
https://play.google.com/store/apps/details?id=com.llamalab.automate
Interact Power dialog