Without taking the washing machine apart, I reckon you can do this with a raspberry Pi Zero W, 1 Light Dependant Resistor, 1 resistor and 1 capacitor (and a few wires and soldering skills)
You'll...