Trigger an automation when power is applied to an outlet?

Nice solution! Wanted to throw this out there as well, you can hardware your contact sensor as well so you don’t have to feed it expensive batteries: