Low/Mid/High 230V Fan Control with RaspberryPI
simulate this circuit &ndash; Schematic created using CircuitLab

The capacitors should be the type used for fans speed controllers (X2 rating) and of appropriate capacitance, the numbers I used are guesses. if you have a four position 
knob type speed controller you probably already have theses capacitors.

Turing on relay 1 puts C1 in series with the mains for slow speed, turning on relay 2 puts C2 in series for medium speed, turning on both connects L1 directly for full speed. 

for the top realy you could use the relay module you have for the bottom relay you need a relay with two switches, (or you could use two more of the same module both connected to the same raspberry pi output)