Mini switch (directly on socket plug) - cable shema validation

Hello,

I’m wondering if I can do this on a mini switch in order to make “zigbeeiable” my socket :

It will not serve me for light, on device…

The final purpose is to have this but w/o smartplug :

Many thanks for your help!