The method 1 is relatively easy. In order to design a smart switch to retrofit the existing 2 wire installation its either method 1.

Apnt 23 Understanding 2 Wire And 3 Wire Lighting Systems
Two wire light switch. Twist a wire cap onto the end of the pigtail. Thinking out of the box to make mcu work with the 2 wire wiring system. At the light it connects to the neutral terminal. Connect the 2 ground wires with a fourth wire nut. Two wire cable runs from the combo to the light fixture and the switch output is connected to the black wire running to the fixture hot terminal. Connect it to the screw on the left side of the switch.
Step 4 connect switch box 2. The source neutral wire is spliced to the neutral on the receptacle half of the combo device and to the white cable wire running to the light. Putting a rechargeable battery inside the switch to supply the power to the mcu or method 2. Take the white wire leading to the second box and mark its end black too. In this case there will be. Connect the red wire leading to the second switch to the top brass screw on the right side.
Use the other 6 inch wire to connect to the top terminal of the second switch if it is mounted in the same electrical box. Enerlites 3 speed ceiling fan control and led dimmer light switch 25a single pole light fan switch 300w incandescent load no neutral wire required 17001 f3 w white 42 out of 5 stars 434 1999 19. Connect the black wire coming from the lightbox with the black wire leading to the second switch by twisting their ends together and fastening with a third wire nut.