I just found out this little guy:
Is a infra red (IR) controlled socket who learn your IR signals for 4€. Is that the best idea ever for controling mains from raspberry or am I missing something?
My plan is simple, to plug a IR led to a gpio, generate a sequence, make the outlet learn it and from there no use it from the raspi. Sounds good to you ?