The earth wires have been omitted for clarity and would need being linked in the slightest degree switches and ceiling roses. The wires would also be protected from the protecting outer sheath (cable). Wiring a plug is a relatively walk in the park which can be carried out by following https://smartswitchesforhome74184.techionblog.com/34828438/smart-light-switches-fundamentals-explained