Domotizing a light consists of adding electronic control without losing a safe and understandable physical control.
The time has come to dive into the hardware layer and get our hands dirty with electrical installation. Domotizing lighting is, historically, the first step of any installation, but it is also where the vast majority of users hit a technical wall: the lack of a neutral wire in the junction boxes.
In this article, we are going to analyze how the electricity of a traditional light point works, why smart devices break this scheme, and what the engineering solutions are for integrating relays and maintaining the manual usability of the home.
From this point onwards, we will be working with 230V alternating current. A wiring error can not only destroy the microcontroller but also poses a risk of electrocution and fire. Always disconnect the corresponding circuit breaker (MCB) in the electrical panel before handling any mechanism.
Smart Bulbs with Conventional Switches
The initial instinct for anyone starting in home automation is to buy a smart bulb (WiFi or Zigbee), screw it into the lamp, and link it to Home Assistant.
At an architectural level, this is a design error. If we install a smart bulb but keep the traditional wall switch, the moment someone (a visitor or a family member) presses the physical wall switch, they will physically cut the electrical current to the bulb.
The bulb will turn off, its radio chip will lose power, and Home Assistant will lose the connection, showing the entity as “Unavailable”. Your automations will stop working.
For the house to remain user-friendly, physical wall control must remain functional. One option is to install a relay behind the mechanism and leave the conventional lamp.
This does not mean that smart bulbs are useless. They are very useful when we want to regulate brightness, color temperature, or RGB, but it’s best to mount them in circuits where they will remain permanently powered and the physical control does not directly cut the current.
Anatomy of the Traditional Electrical Installation
To understand how to install a relay, we must first understand what is behind our wall switch.
In the vast majority of traditional residential electrical installations, the topology is as follows:
The Phase (L - Line) cable, which carries the current (usually brown, black, or grey), runs down from the ceiling junction box to the wall switch.
When we press the switch, we close the circuit.
The current goes up through a second cable called the Lamp Return (often the same color as or a different color from the Phase) to the ceiling bulb.
To close the electrical circuit and allow the current to return, the bulb is permanently connected to the Neutral (N) cable (always blue), which goes directly back to the electrical panel.
The technical problem: Since the Neutral goes directly through the false ceiling to the lamp, behind the wall switch we only have the Phase and the Return. There is no Neutral.
The Technological Problem: The Module Needs Power
A domotic relay (like a Shelly, a Sonoff Mini, or a recessed Zigbee module) is not a simple mechanical contact. Inside, it houses a microcontroller (an ESP32 or a CC2652 chip) and a radio antenna.
For this chip to be connected to WiFi or the Zigbee network 24 hours a day listening for commands from Home Assistant, it needs a continuous electrical supply. It needs to close its own internal circuit, and for this, it requires simultaneous connection to the Phase (L) and the Neutral (N).
If we put the relay in the switch box where there is no Neutral, the chip will not turn on. Faced with this, engineering offers us three solution paths.
Solution 1: Bringing the Neutral to the Mechanism
If you want a robust, stable system immune to flickering, this is the only definitive solution. It consists of using a cable pulling guide to run a blue cable (Neutral) from the nearest junction box (usually above the door or at the ceiling light point itself) down to the switch backbox.
Once we have Phase (L) and Neutral (N) in the backbox, wiring a hidden relay (a “module” type, like a Shelly 1 Plus or a Zigbee module) is trivial:
- Connect the Phase (L) and the new Neutral (N) to the relay’s power terminals. The chip now has permanent power.
- Connect the Lamp Return to the relay’s output terminal (usually marked as O for Output, or L1).
- Connect the two terminals of the traditional physical wall switch to the relay’s control inputs (generally marked as SW or S1/S2).
The SW terminal: It is a control input, but this does not imply that it is low voltage or safe to touch. In many modules, it is referenced to the 230V phase. Only follow the manufacturer’s wiring diagram and do not connect push buttons, sensors, or external circuits not intended for that voltage to it.
Once configured, it allows Home Assistant and the wall switch to control the same output without cutting power to the electronics.
Switch, Push Button, and Input Mode
Many smart relays allow you to configure how they interpret the physical SW input: as a toggle switch, as a momentary push button, or even as a decoupled input that does not directly toggle the output.
This is important because not all walls are wired the same. A traditional switch changes position and stays there. A push button, on the other hand, only closes the contact while we press it. For home automation, push buttons are often very convenient because each press can be interpreted as a command: on, off, double-click, long press, etc.
If you are planning a renovation or changing mechanisms, consider using push buttons instead of traditional switches. They offer great versatility with smart relays and avoid physical states that visually don’t match the actual state of the light.
Solution 2: Relays Without Neutral
We understand that not everyone can or wants to run cables through the corrugated tubing in their home (sometimes they are blocked, or the installation is very old).
For these cases, the industry has developed specific devices called “No-Neutral” (or Single Live Wire).
How do they manage to power themselves without a Neutral to close the circuit? They use an electrical engineering trick: they allow a tiny leakage current to pass through the bulb itself while it is off. This means using the resistance of the filament (or the LED driver) of the ceiling lamp as a path to reach the Neutral and keep their radio chip powered.
The Problem of Flickering and the Bypass
This leakage current trick worked perfectly with old incandescent bulbs, as the current was so low that it didn’t heat the tungsten.
However, modern LED bulbs are extremely efficient. That tiny leakage current the relay needs to “survive” is enough for the LED bulb’s internal capacitors to charge and discharge continuously. The result is that, with the light “off”, the LED bulb will start to flicker or remain slightly lit.
To fix this side effect, all “No-Neutral” relays require the installation of an additional component: the Bypass (Shunt Capacitor).
- The Bypass is physically installed in the ceiling, in parallel with the bulb (connected between the Phase reaching the lamp and the lamp’s Neutral).
- It acts as a low-impedance “alternative highway” for the relay’s leakage current. The current prefers to go through the Bypass instead of the LED driver, eliminating the flicker completely.
WiFi or Zigbee in No-Neutral Setups
Zigbee usually consumes less power than WiFi, which can make designing a no-neutral module easier. Even so, stability depends on the complete product, the load, and its bypass, not just the radio protocol. Check the minimum power rating, LED compatibility, and instructions for the specific model.
Complete Mechanism or Hidden Relay
When buying hardware for our wall, we will find two different physical formats on the market. The choice depends purely on aesthetics and the physical space in the junction boxes.
Hidden Relays or Micromodules
These are small blocks (Shelly, Sonoff Mini, Moes/Tuya Zigbee modules) designed to be placed in the back of the universal flush-mounted wall box.
- Advantage: They allow you to maintain the original aesthetic of your home (Simón, Niessen, Bticino). You can reuse the switches and faceplates you already have.
- Disadvantage: Standard Spanish flush-mount boxes (universal round/square mechanism) are very small. It is often physically impossible to fit the module, the wires, and the switch on top without straining the terminals.
Complete Mechanisms
These are switches that come with the faceplate, the button (touch or physical), and the relay integrated into a single unit.
- Advantage: They solve the space problem, as the entire assembly is designed to fit perfectly.
- Disadvantage: They change the aesthetic of the house (they have a different design) and many people don’t like the “feel” of touch glass panels. Fortunately, there are more and more Zigbee switches with a traditional mechanical push button.