Unfortunately it wouldn't work for my particular usage, which was keeping it plugged into an old but expensive smart speaker as a music player via its lightning port. A smart plug would turn off the speaker along with the phone... But I appreciate the suggestion, as complicated as it is!