Wiring diagram
Correct wiring
Smart switch with neutral
The main option with wiring through back boxes: the neutral is already in the back box, and the switch is powered between L and N, not through the lamp, so even a low-wattage LED lamp does not glow when it is off. The cables are the usual ones: consumer unit → back box 3×1.5 and back box → light 3×1.5. Brown from the consumer unit to L, brown from output ↓ to the light, the blues of both cables joined with a lever connector with a short link from it to the switch’s N, and the green-and-yellows passing through on another lever connector. The electronics and the lever connectors take up room, so use a deep 60 mm back box.
What happens
Light: off
Live
Cables
| From → to | Cores × size |
|---|---|
| Panel → Door | 3×1.5 mm²green-and-yellow, blue, brown |
| Door → Light | 3×1.5 mm²green-and-yellow, blue, brown |
What to buy
- B10 MCB for the lighting circuitin the consumer unit, if there is no separate lighting circuit yet1 pcs
- Smart switch with neutral1 pcs
- Frame, 1-gang1 pcs
- Deep back box, 60 mm1 pcs
- Lever connector for 2 wires1 pcs
- Lever connector for 3 wires1 pcs
- 3×1.5 mm² cable — one run2 pcs
Why a smart switch needs a neutral
Inside a smart switch there are electronics: a radio module that talks to the app, and a relay or semiconductor switch that switches the lamp. They need power all the time, even when the light is off. A switch with neutral takes it between L and N, like any appliance, and does not depend on the lamp.
A no-neutral switch has nowhere to get power except through the lamp: when the light is off, a small supply current flows through it. That will not light an incandescent lamp, but a low-wattage LED lamp glows or blinks on it. That is why these models have a minimum load: a no-neutral Shelly needs a bypass below 20 W, other models have a minimum of about 3 W — check the instructions. If the lamps come to less than the minimum, a bypass is fitted at the light in parallel with the lamp; it is also called a compensator, and the supply current then flows through it rather than through the lamp. For some models the instructions forbid an external bypass, and then the only option is a higher-wattage lamp.
A smart relay is the same smart switch, only without a rocker: the module is hidden behind an ordinary switch or fitted at the light. The switch sends the relay a signal, and the relay itself switches the lamp. Almost all relays need a neutral. Only a few models work without one, and with LED lamps they need a bypass too.
Is there a neutral in the back box, and how to check
This is the key question before buying. Switch off the lighting MCB, take off the rocker and the frame and look at the cores. With wiring through back boxes, as in this series, two cables come into the back box, from the consumer unit and to the light, and the blue cores are joined to each other with a lever connector and not connected to the switch: there is a neutral, and a switch or relay that needs one will do.
In older wiring looped in at the light, a single 3×1.5 cable comes into the back box: the brown and blue are connected to the switch, the green-and-yellow is earth. There is no neutral here: the blue is the switched live to the lamp, and the neutral stays at the light. A back box often looks the same with wiring through junction boxes: the circuit is the same, only the place of the joints changes.
Checking for a neutral with a tester while the MCB is on is only for those trained to work live. If that is not you, rely on inspection. In old wiring the colours may not follow the standard, and then an electrician can identify the neutral reliably.
If there is no neutral, there are three options: a no-neutral smart switch with a bypass at the light; a smart relay at the light, where there is a neutral, with the switch staying an ordinary one; or a new cable with a neutral to the switch.
Do not take a neutral from another circuit — for example, from a nearby socket. The current would leave on the live of the lighting circuit and return on the neutral of the other circuit; the RCD would see a difference in currents and may trip. Take the neutral only from the same circuit as the live.
Smart relay: terminals, input modes, back box
On the Shelly 1PM Gen3 the terminals are labelled as follows: L and N are the supply, SW is the input from the switch, and O is the output to the lamp, powered internally, as in the diagram above. The live from the consumer unit arrives at the relay’s L and goes from there via a short link to the switch; the neutral comes via a link from the pass-through lever connector. On the Shelly 1 Gen3 and some other models there is a volt-free contact I and O instead of O, and the live is then fed to I with another link from L. The Sonoff ZBMINIR2 has terminals L In, L Out and N, and its input is the pair S1 and S2, which must not be connected to neutral or earth. So check the diagram for your model on the device or in the instructions.
The relay input is set up in the app. On Shelly, the switch mode comes in three kinds: Toggle — the switch position matches the state of the light; Edge — any flip of the switch changes the state, which is handy if the light is switched both from the switch and from the app; Detached — the input is decoupled from the relay, and the switch does not change the light by itself. For a retractive push-button there is Button mode: every press changes the light over. On Sonoff you choose between switch and push-button.
The module is about 16–17 mm thick and cramped behind a switch, so a deep back box of about 60 mm is used: with wiring through back boxes there is one at every point anyway. The circuit MCB must not be larger than the relay allows: 16 A for the Shelly 1 Gen3 and 10 A for the compact Shelly 1 Mini Gen3, so a B10 on the lighting circuit suits both.
Cables, core colours and the MCB
Core colours are set by HD 308: live is brown, black or grey, neutral is blue, and green-and-yellow is earth only, never live or neutral. With wiring through back boxes, two ordinary 3×1.5 cables run to a switch with neutral or to a relay: from the consumer unit and to the light. Blue is neutral in both, the brown from the consumer unit is the live, the brown to the light is the output to the lamp, and nothing needs re-marking. Neutral and earth are joined in the back box with lever connectors; earth is taken through the back box even if the device has no terminal for it: in Germany the standard requires this.
In older wiring looped in at the light, a 3×1.5 comes down to the no-neutral switch: brown is the live, blue is the output to the lamp. Here the blue is live — the only such case in the diagrams in this article. Mark it at both ends with brown tape or sleeving: this is mandatory in the UK and standard practice elsewhere.
Lighting is wired as a separate circuit at the consumer unit: a B10 MCB on 1.5 mm² cable. In Spain, 10 A for lighting is mandatory. In Germany, B16 is also used on 1.5 mm², but only where the standard’s table rates the cable for 16 A (in conduit in a wall or clipped direct to a wall), and not in a thermally insulated wall. With a B16, also check which MCB rating your relay allows.
Wiring diagrams
Smart switch with neutral
The main option with wiring through back boxes: the neutral is already in the back box, and the switch is powered between L and N, not through the lamp, so even a low-wattage LED lamp does not glow when it is off. The cables are the usual ones: consumer unit → back box 3×1.5 and back box → light 3×1.5. Brown from the consumer unit to L, brown from output ↓ to the light, the blues of both cables joined with a lever connector with a short link from it to the switch’s N, and the green-and-yellows passing through on another lever connector. The electronics and the lever connectors take up room, so use a deep 60 mm back box.
Without neutral, with a bypass
For older wiring looped in at the light: the cable from the consumer unit comes to the light fitting, and a 3×1.5 comes down to the switch carrying only the live and the switched live, while the neutral stays up at the light. This is the only such circuit in the series, and it is the reason no-neutral switches exist: they replace an ordinary switch without new cables. Brown is the live to L, blue runs from output ↓ to the light; it is live, so it is marked with brown tape. The switch draws a small current through the lamp, which makes a low-wattage LED lamp glow, so a bypass is fitted at the light in parallel with the lamp: one lead goes to the lamp’s L together with the wire from the switch, the other to N.
Smart relay behind an ordinary switch
The switch stays an ordinary one, from any range, and a smart relay sits behind it in a deep back box; the cables are the same 3×1.5 as for a switch with neutral. Brown from the consumer unit to the relay’s L, a short link from the relay’s L to the switch’s L, and from the switch output to the SW input; the relay’s N via a link from the neutral lever connector, and the brown to the light from output O. The input is set to the mode in which any flip of the switch changes the light over (Edge on Shelly): then both the switch and the app work, only “on” is no longer tied to the switch position.
Smart relay with a push-button
The same relay and the same 3×1.5 cables, but a retractive push-button instead of a switch: every press changes the light over, and releasing does nothing. The live reaches the push-button via a link from the relay’s L, and the push-button output goes to SW. The input is set to push-button mode (Button on Shelly, push button on Sonoff), otherwise the light will go off as soon as you let go of the button.
Common mistakes
A switch that needs a neutral where there is none
A smart switch that needs a neutral was bought for old wiring looped in at the light: only the live and the switched live reach the switch, so terminal N is left empty. There is a live on L, but the electronics need power between L and N, and without it the switch does not work: the light does not come on, either from the rocker or from the app.
Why this is wrong
There is no danger, but the switch is useless. Before buying, check whether there is a neutral in the back box. If there is not, choose a no-neutral switch with a bypass at the light, put a smart relay where the neutral is — at the light — or run a 5×1.5 cable from the light to the switch, with the blue as the neutral. Do not take a neutral from a nearby socket or another circuit: the current would leave on the live of one circuit and return on the neutral of another, and the RCD may trip.
No neutral and no bypass
A no-neutral smart switch was fitted, the light has a single low-wattage LED lamp, and there is no bypass. When on, the lamp lights as usual; when off, it glows faintly or blinks.
Why this is wrong
A no-neutral switch draws its power through the lamp even when it is off: a small current flows through the lamp all the time. That is enough for the driver of a low-wattage LED lamp to glow or flash. There is no danger, but the light never goes fully off. Fit a bypass at the light in parallel with the lamp, between the wire from the switch and N, or use lamps above the minimum load given in the switch instructions.
How to wire a smart switch, step by step
Switch off the lighting MCB
At the consumer unit, switch off the MCB for the lighting circuit, or the main switch if you are not sure which one it is. Tell everyone at home so that nobody switches it back on.
Check there is no voltage
First prove your voltage tester or multimeter on a socket you know is live. Then test every core in the back box and at the light: between each other and each one to earth.
Find the neutral and mark the cores
Take off the rocker and the frame and look at how many cables come into the back box. Two cables, with the blues joined to each other and not connected to the switch: there is a neutral, so fit a switch or relay that needs one. One cable, with the brown and blue on the switch: the wiring is looped in at the light, there is no neutral, and a no-neutral switch with a bypass will do. It is better to find this out before buying. Wrap the blue that carries the live to a no-neutral switch with brown tape at both ends.
Join neutral and earth
In a back box with a neutral, join the blue from the consumer unit, the blue to the light and a short link to the N of the switch or relay with a lever connector for three wires, and the two green-and-yellows with one for two. In older wiring looped in at the light, the joints are made at the light: the live from the consumer unit and the brown to the switch with one lever connector, the green-and-yellows from the consumer unit and to the switch, together with a short link to the light’s PE, with another, and the blue from the consumer unit to the light’s N.
Connect the switch or relay
Switch with neutral: brown from the consumer unit to L, the link from the neutral to N, brown to the light to ↓. Without neutral: brown to L, the marked blue to ↓. Relay: brown from the consumer unit to the relay’s L, a short link from the relay’s L taking the live to the switch or push-button, a wire from its output to SW, the link from the neutral to N, and the brown to the light to O. Markings differ between models, so check the diagram on the device. Arrange the wires so that the device sits in without being forced.
Connect the light and the bypass
Connect the brown to terminal L of the light, the blue to N and the green-and-yellow to PE. With a no-neutral switch and LED lamps, fit the bypass here too, in parallel with the lamp: one lead to the lamp’s L together with the wire from the switch, the other to N.
Check and set up
Switch the MCB on, add the switch or relay to the app according to the instructions and click the switch. On a relay, choose the input mode: Edge for an ordinary switch, Button for a push-button. Turn the light on and off from the app. Then switch the light off and look at the lamp in the dark: if it glows or flashes, you need a bypass.
Safety and who may do the work
Only work with the MCB switched off and after testing every core with a voltage tester or multimeter, having first proved the tester on a socket you know is live. A no-neutral switch passes a small current through the lamp even when it is off, so change the lamp or the light fitting only with the MCB off. Who may carry out this work is set by the law of your country. In England, replacing a switch is not notifiable under Part P, but the work must comply with BS 7671. In Germany, changes to the wiring may only be made by an electrician registered with the network operator; in Spain, by an authorised installer; in Poland, by a person with an SEP qualification. In a number of other countries, work on the wiring is for electricians only, so check the rules where you live.
Frequently asked questions
Can I fit a smart switch without a neutral?
Yes, there are no-neutral models: they replace an ordinary switch in older wiring looped in at the light, on the same 3×1.5 cable. Such a switch draws a small current through the lamp, so it has a minimum load — check the instructions. With low-wattage LED lamps a bypass is fitted at the light in parallel with the lamp, otherwise the lamp glows or blinks when off. If there is a neutral in the back box, a switch with neutral is more reliable.
How do I know if there is a neutral in the switch back box?
Switch off the MCB, take off the rocker and look at the cores. If two cables come into the back box and the blues are joined to each other rather than to the switch, there is a neutral. If there is one cable and the brown and blue are connected to the switch, there is no neutral: the blue is the wire to the lamp. Testing live with a tester is only for those who know how to work that way.
Why does an LED lamp glow when the smart switch is off?
Most often because the switch has no neutral and draws its power through the lamp: that current is enough for a low-wattage LED to glow or blink. A bypass at the light in parallel with the lamp helps, or a lamp above the switch’s minimum load. Another cause, named by Niko, is induced voltage in a long cable to the switch.
Can I take a neutral for a smart switch from a socket?
No: sockets and lighting are different circuits. If you take the neutral of a socket circuit, the current leaves on the live of the lighting circuit and returns on another circuit’s neutral, and the RCD may keep tripping. Take the neutral only from the circuit itself. If you cannot get it to the switch, fit a no-neutral switch with a bypass or a relay at the light.