It sounds like you want Lutron Casetas.
- State A (on) - power the device and power the magnet so that the switch moves.
- State B (off) - power off the device and the magnet, a spring moves the switch.
https://residential.lutron.com/us/en/stand-alone-controls/su...