In my home automation project, one of my first goals was to control all the lighting. From being able to turn off all the lights that my kids (who act like they own Iberdrola) insist on leaving on, to turning off the kitchen light when leaving with my hands full. And also, why not — because it’s just cool to control your lights from another floor.
This article is a natural continuation of a reflection I published in 2018: “I want to automate my home lights, but nobody sells me what I need”, where I discussed the limitations of the smart home market at the time.
I ultimately chose to integrate lighting through smart relays installed behind conventional switches, instead of using smart bulbs exclusively. The solution combines Shelly devices (1 and 1L) and Zigbee relays based on Tuya, all managed via Home Assistant. Below I explain the technical reasons behind this architecture and how I addressed key issues like handling multi-way switching circuits.

Technical Advantages of Relays Over Smart Bulbs
The choice of relays over smart bulbs mainly comes down to reliability, interoperability, and electrical design:
- Preserve physical control: In an installation with smart bulbs, if the power is cut from the wall switch, the bulb loses connectivity. Relays, being physically integrated into the power circuit, allow you to keep using traditional mechanical switches without losing smart control. It’s essential that the house continues working even if the automation fails.
- Independence from the light fixture: With a relay, it doesn’t matter how many bulbs a lamp has or what type they are. You automate the entire circuit. This reduces costs and simplifies maintenance. Plus, bulbs tend to burn out and need replacing — it’s better to keep their cost low.
- Aesthetic compatibility: There’s no need to replace existing bulbs with “smart” ones that might not be available in the desired format, color temperature, or brightness.
- Centralized automation: By controlling the relays directly from Home Assistant, the automation logic is centralized and there’s less reliance on third-party APIs (like Tuya Cloud or Smart Life).
The Importance of Using Home Assistant as a Smart Hub
One of the most impactful decisions in this project was using Home Assistant as the central platform for managing all devices and automations. This choice brings several key benefits:
- Local control and privacy: Home Assistant lets you manage all devices without sending data to the cloud, improving both privacy and response times.
- Interoperability: It integrates multiple technologies and protocols (WiFi, Zigbee, Z-Wave, MQTT, Bluetooth…) under a unified interface.
- Advanced automations: Its automation engine is extremely flexible, allowing complex rules based on conditions, states, sensors, time, presence, and more.
- Customizable interface: The UI can be adapted to each user or family’s needs — from touchscreen panels to voice control.
- Large community and support: Home Assistant has a very active community and many integrations, which makes it easier to troubleshoot and expand the system.
Thanks to Home Assistant, I was able to integrate devices from different vendors and technologies into a cohesive, fully controlled ecosystem.
Devices I’ve finally used
Thanks to Home Assistant’s flexibility, I was able to use different types of devices depending on each electrical circuit’s characteristics — whether or not a neutral wire was present, whether it was a multi-way circuit, or based on the available network coverage (WiFi or Zigbee). This versatility let me tailor the solution to the real-world installation without sacrificing functionality or reliability.
Shelly 1

It’s a compact relay with neutral support. Ideal for standard circuits with enough space behind the switch. It integrates well with Home Assistant via MQTT or the native Shelly integration.
In addition to being configurable through the official Shelly app, it has a powerful web interface for advanced settings.
Shelly 1L

It is specifically designed for the very common case where no neutral wire (typically blue in Europe, or white in the US) reaches the switch box, and it’s difficult to run one. When controlling small loads, an external resistor or capacitor (bypass) may be needed for stable operation.
Otherwise, it offers the same features as the Shelly 1.
Zigbee Relays
Shelly works well, but its unit price is fairly high. That’s why I started looking for more affordable alternatives and found Zigbee relays — first from Sonoff, and later, through AliExpress, various Tuya-compatible devices using the Zigbee protocol. These turned out to be very practical and economical options.

Reasons for choosing this technology included:
- Avoiding WiFi congestion: Zigbee reduces the load on the WiFi network, which tends to get saturated (each WiFi router or repeater only supports a limited number of clients).
- Reliable performance and low latency: Zigbee is designed for home automation and offers quick, stable response.
- Mesh topology: Embedded Zigbee relays act as repeaters, strengthening and extending the network.
- Local integration with Home Assistant: They can be integrated via ZHA or Zigbee2MQTT, without external cloud dependencies.
- Low cost: Especially Tuya Zigbee relays, which are widely available on AliExpress under various brands at very affordable prices, making it feasible to automate many light points without a high budget.
Thanks to their compact form factor, they fit well behind wall switches and are easy to install.
I chose Zigbee2MQTT to control them because it gives deeper control and — in my experience — it’s beneficial to keep the Zigbee ecosystem independent of Home Assistant’s core.
It’s very important to select a Zigbee channel that minimizes interference with WiFi (such as channels 15, 20, or 25). In my case, Zigbee channel 25 has allowed me to enjoy a stable and reliable Zigbee mesh.
Occasional Use of Smart Bulbs (WiFi)
Although relay automation is the foundation of my setup, in some specific cases I’ve opted for WiFi smart bulbs, primarily to control color and brightness dynamically.
Relays can automate switching on and off, but they don’t allow for granular control of color temperature, brightness, or RGB color. In environments where ambient lighting is important — like rest zones, desks, or multipurpose rooms — I needed that flexibility.
So, in those cases I used smart bulbs, specifically:
- WiFi bulbs, to avoid common Zigbee bulb issues — they stop acting as mesh repeaters when powered off from the wall switch, which can destabilize the Zigbee network.
- Home Assistant-compatible models, preferably with local integration, such as:
- Bulbs with ESPHome or Tasmota, for direct integration without cloud dependence.
- WiZ brand bulbs, which offer excellent native integration with Home Assistant using the official
wiz
integration. This enables local control of brightness, color, effects, and color temperature.
These bulbs were placed in locations where installing a relay wasn’t feasible or practical — like floor lamps or sconces plugged into outlets.
In summary, while relays remain my main solution, I turn to smart bulbs when light control requires more than simple switching, always prioritizing network stability, local integration, and flexibility.
Solving the Multi-Way Switching Problem
One challenge I raised in my earlier article was multi-way circuits, where several switches control a single light. To solve this, I used relays capable of detecting state changes at their control input (SW).
In a traditional multi-way setup, each switch change alters the voltage state on the traveler wire. Placing the relay behind the final switch on the line allows it to detect the voltage change and toggle the light, regardless of which switch was flipped.
All Shelly relays support this use case, and many Zigbee relay models also support multi-way circuits — as they are designed to detect phase presence at one of their input terminals based on switch position. However, not all models support this. Some relays (like some Sonoff models) require both switch terminals to be directly connected to the relay, so it’s crucial to check the wiring diagram before attempting such an installation.


By using Shellys and Zigbee relays with a single switch terminal, I was able to preserve the existing wiring without needing to modify the switch logic. Traditional electrical switching remains functional, while the relay adds smart control transparently. All I had to do was identify the final switch in each circuit and install the relay behind it.
This approach allowed me to keep the original electrical wiring, improve the user experience, and integrate lighting with other smart home elements — motion sensors, schedules, presence detection, and voice control.