You could use 2 sonoff minis. Its small enough to fit behind a back box and relatively cheap.
You’ll have to create an automation to turn it off after so many seconds unless your window motor has a fully open/close sensor otherwise it would keep driving the motor which could result in a burnt out motor or stripped gears. Heres a link
1 Like