A Shelly smart relay can be used to upgrade an existing light without sacrificing the original toggle switch. This is a great feature, which lets me add lights into my smart home system, and still be able to use the traditional controls. I think it is important for the smart integration to be invisible, so for example my young daughter doesn't have to understand or be aware of my smart home setup. This project is about achieving the same thing with a lamp. A lamp with a typical physical switch control, and hidden remote capabilities.
In the above video it appears that the lamp has an in-line torpedo style switch which controls the power to the bulb, but this can't be true, as we can still turn it back on remotely using a Shelly button! The secret here is that there is a Shelly relay hidden in the lamp's base, and that the switch isn't really wired up to be in-line.
The left diagram above show the typical wiring scheme for a single pole in-line switch using three core cable. In this case the switch housing can accomodate a ground wire, but this isn't always needed, as many lamps are fully insulated. On the right hand diagram I have discarded the ground wire, and used used a 4 core cable into the top of the switch. This makes it possible for the live and neutral wires to pass straight through the switch housing, while leaving another two wires to connect the switch into a circuit which loops back into the lamp's base. A Shelly relay can then be wired up in the lamp's base in the standard way.
This design is simple to put together, but requires careful selection of components: