Using AC current as a switch

Hello,

I am trying to use a sonoff WiFi switch to control 2 reversible motors. The sonoff switch controls wether AC current is on or off. I would like my motors to run clockwise for 2 seconds when the power is turned off and to turn counterclockwise for 2 seconds when the power is turned off.

If anyone knows of the components(resistors, transistors, capacitors, etc) and\or the code that would be required to make this project possible.

Thanks.

Are your motors able to turn both ways? May we ask for links to the used hardware?

More importantly how are the motors going to turn without power?

pylon:
Are your motors able to turn both ways? May we ask for links to the used hardware?

And if they can actually turn both ways, what so you have to do to make them turn the other direction? With AC motors, the field coil connections may have to be reversed. A DPDT relay might do this for you.

Paul