I used the instructions in the first post and it worked for me.
Look for the section that begins "To create more automated routines within the script just copy and paste this code snippet (with the corresponding modifications)."
Try this (untested, may need tweaking)...
T1: Power Disconnected / constraint: connected to home Wi-Fi
T2: Wifi State Change (disconnected from home network) / constraint: power connected
A: Wait Before Next Action (1 second - ?)
A: send SMS or e-mail / constraint: Power Disconnected AND...
If I wanted to trigger on that specific event, and not on power being disconnected generally, and given that at home I am always connected to my home's Wi-Fi, I would check for both power and home Wi-Fi disconnecting in very quick succession.
I was using MacroDroid + MailTask to permanently delete messages from spam folder that were starred (I used normal Gmail filters to do the starring).
Any suggestions on how to do that without MailTask?