Small Wifi double switches/SSR's behind sockets ( Home automation - lights)
What you're proposing is to make using prefab electronic modules.  

That's fine to play with in the lab.  But if you want to actually install that in a real house in the EU, you're going to need to take your assembled, finished equipment over to TUV and have them certify it as safe for use in houses.  Which ain't gonna happen with components from a place called "banggood" lol...

If you do not have your equipment certified, any malfunction which causes fire or injury will create severe personal liability. 

Anyway, design questions go over to the Electronics Stack Exchange.  Our wheelhouse here is accomplishing your goals using pre-built technologies to homes. To that end... 

First, you should not need to add wires to your home. Using low-voltage wires to control loads throws back to the GE RR7 system, which used 24VAC to operate relays.  Technology is, if anything, reducing wire count. For instance, if you have a 3-way circuit where the spur switch only has switched-hot and 2 travelers, and you want a power receptacle there on the existing wires, Smart switches are how you get that done. 

Any reasonable solution will involve 


powerline signaling, which itself harkens back to 1975 and the X10 system, a reasonably "open" standard. And/or 
wireless communication, which no doubt started a week after WiFi chips were prototyped. 


For instance, Insteon uses both adaptively.  Powerline signaling is not 100% reliable in the US because every home is fed from 2 transformer phases (opposed, so we dall them poles), so half your circuits have a transformer winding between the other half. Less of an issue in Europe. 

You don't need to stick something behind the mechanical switch; not least, there isn't room.  The smart device should replace the switch and provide a reasonable human UI. 

Switch loops (power fed into lamp, hot and switched-hot only to the switch) are a special case.  In that case, a module could be fit at the lamp, the swich loop converted to always-hot and neutral that powers the smart switch, which communicates with the module. 

You won't have to design any of this. The marketplace is thick with appropriate products, and getting thicker.  

Keep in mind also that such alterations will affect the resale value of the home. Commercially rated smart switches will be appreciated, homebrew jobs will need to be torn out and restored to legal standard before sale.