Wall Switches, Buttons, and Relays: What's in Your Box

Module 20 · Lesson 4

Wall Switches, Buttons, and Relays: What's in Your Box

The "relay in the box" decision requires knowing the installation. You don't open 230V boxes yourself. You're learning what to check with an electrician before buying a module.

Lesson 3 settled the bulb-versus-relay choice. Now you're entering the 230V layer: the neutral wire, the switch type, a three-way circuit, room in the box, and market models as categories. An electrician does the mounting. You plan, integrate HA, and test the finished point.

Plan on about 90 to 100 minutes.

A 230V installation isn't part of the hands-on exercise

Don't remove the switch yourself, pull the mechanism out of the box, touch the wires, or take measurements. For someone without qualifications, turning off a single breaker isn't confirmation that every wire in the box is de-energized.

Only take photos of wires once an electrician has safely opened the box for you. It's also worth asking them for a description of the wires, a wiring diagram, and a record of the installed device's model.

Dividing roles: you, the electrician, Home Assistant

You build the map and define the expected behavior. The electrician identifies the wires, evaluates the circuit, and mounts the device. You integrate the finished module into HA. After mounting, you run functional tests without opening the box.

A real-life problem: the module doesn't fit the box

You bought two modules "just in case." The electrician opens the box at the living room switch: shallow depth, many wires, no N. He says, "this model needs a neutral, and there isn't one here." The hallway has a three-way circuit with two switches. The bedroom has a dimmer with a 20W minimum load, and you have 9W LEDs: flickering.

This is a normal day in the smart home. Modules aren't universal. The box and the circuit decide. This lesson teaches you to ask the right questions before buying.

Why a switch box might not have a neutral wire

In a classic lighting circuit, a permanently live wire may reach the switch, and a live wire leaving the switch runs to the lamp. The neutral wire can run directly to the fixture and never appear in the switch box at all.

A smart module needs its own 230V power between L and N, even when the fixture is off. That's why most relays need N in the box, or a different mounting location with access to a neutral.

The number and color of the wires alone aren't enough to identify the installation. A blue wire being present isn't proof it serves as the neutral. An electrician confirms each wire's function by measurement and by analyzing the whole circuit.

"No N" isn't one universal solution

No-neutral modules draw a small current through the load even when the light is off. Their compatibility depends on the lamp type, wattage, LED driver, and the specific model's requirements.

Don't automatically assume every no-neutral module needs a bypass, or that every one will work with any LED bulb. A no-N variant has to be: compatible with the load type, within the minimum wattage, sometimes needing a bypass, and evaluated with the specific LED source. Check the full documentation for the model and test one circuit.

With no N in the box, module choice narrows to no-N variants, or moving the module to a location with access to a neutral. An electrician can run N in during a renovation. That's a cost and a project, not "I'll tighten it up over the weekend."

What kind of control you have on the wall

For configuring a module, what matters most isn't what the faceplate looks like, but how the mechanism behaves and which system it belongs to.

A stable toggle

Stays in its new position after being pressed. A module can react to every change in its state.

A momentary button

Returns after being released. It can allow single, double, or long presses, if the module and integration support that.

A three-way or four-way system

One light controlled from two or more locations. Don't buy a module until an electrician has identified the circuit's full topology.

Not every smart relay requires swapping a plain toggle for a momentary button. Many devices support both input types. A momentary button is useful when you want to use multi-clicks or a long press, but you only decide after checking the model's documentation and the household's habits.

A momentary button and detach solve two different problems

A momentary button tells the module the input generates a brief pulse. Detach mode tells it that an input change isn't meant to directly switch the output. You can use a momentary button without detach, or detach with a plain toggle, if the specific module supports it.

For a plain lamp, the safest Plan B usually comes from locally linking the input to the output. You use detach when you have a specific reason, like keeping a smart bulb constantly powered.

A three-way circuit: topology first, then the device

In a classic three-way setup, two switches are linked by traveler wires, so either one can change the light's state. In a four-way setup, additional switches sit between them, allowing control from more locations. An electrician determines: how to preserve the existing switches, how to report the input's state, whether replacing the setup with momentary buttons is being considered, and whether every point will work without HA.

There's no single universal way to add a smart module to every such circuit. The solution depends on which box has the permanently live wire, the wire to the lamp, the neutral, and the traveler wires. The electrician identifies the topology and only then chooses the location and mounting method.

The number of places you control a light from doesn't have to match the number of inputs on the module. In some designs, several buttons can control one input; in others, extra modules or a rewiring job will be needed. Don't pick a device on the rule "three switches means three S inputs."

On the hallway-and-stairs map, you write: "three-way: yes, number of control locations: 2, module: to be determined with the electrician." Don't order a module before that entry exists.

Bypass: only when the specific setup requires it

A bypass isn't a universal add-on for every no-N module or every dimmer. It's used only when the specific device's documentation and the result of a test with the actual load call for it.

A bypass creates an extra path for a small current to flow, per the manufacturer's design, so the module's electronics can run stably with a given load. Signs of a mismatch can include glowing after the light is off, flickering, unstable startup, or the module switching itself off. An electrician chooses a solution based on the device model, the LED source, the driver, and the wiring method.

A dimmer's minimum load is a parameter of the specific model, not a general requirement for all dimmers. You choose a dimmer-plus-source or dimmer-plus-driver combination, not just the wattage on the label.

Room in the box: more than just depth

The box's depth alone doesn't answer whether the module will fit. An electrician has to account for the switch mechanism, terminals, connectors, the number of wires, their bend radius, and being able to safely close the fixture without crushing insulation.

Several modules mounted close together can raise the temperature inside a box or enclosure. The current limit can depend on temperature. An electrician evaluates mounting compatibility per the manufacturer's documentation. Don't drill into or modify an enclosure yourself.

In a setup prepared for a smart bulb, an electrician can give the fixture constant power and use the wall input purely as a control signal. The exact method depends on the specific module's design.

Market examples: not interchangeable

The models below are examples for comparing requirements, not a shopping list. The full model number, firmware version, and integration determine compatibility.

Example Category The key question Don't assume
Shelly 1 Mini Gen4 A module with N, dry-contact output How should the input, output, and Plan B work? That detach is required for a plain light
SONOFF ZBMINI-L2 A Zigbee module without N Is the specific load compatible with the instructions? That it always needs a bypass
Aqara Dual Relay T2 A two-channel module with N Which functions are available in your chosen integration? That two channels solve every three-way circuit or blind
Aqara Light Switch H2 EU A complete smart wall switch Which installation variant and protocol are you choosing? That it behaves identically to a module mounted behind an old toggle

The Shelly 1 Mini Gen4 is a multi-protocol module requiring N; before choosing a communication mode, check compatibility with your own system. The energy-metering version (e.g. 1PM Mini) has a different size, a different way of mounting in the load path, and may run warmer: don't treat them as interchangeable.

The Aqara Dual Relay T2 needs L and N. Some manufacturer features: specific operating modes or energy metering, for instance: may not be available in ZHA or Zigbee2MQTT. Check this before mounting, not just after pairing. The Aqara Light Switch H2 EU is a separate category: a ready-made wall switch with N and no-N variants and a choice of protocol, not a module hidden behind an old toggle.

Don't assume a two-channel module automatically solves a three-way circuit. What matters is input handling, configuration modes, and how the wires are routed.

A point card for the electrician consultation

Fill this in before the conversation. The electrician confirms the fields about wiring and mounting. This is the main hands-on material for this lesson.

Room and point: ..................................................
Light's function: main / task / decorative / wayfinding
Number of control locations: ..................................................
Current fixture type: toggle / button / three-way / four-way / unsure
Is there N in the box: confirmed by the electrician
Module mounting location: box / fixture / panel / other
Load type and wattage: ..................................................
Number of LED drivers or power supplies: ..................................................
Expected control without HA: ..................................................
Should the fixture stay constantly powered: yes / no
Behavior after power returns: off / last state / other
Chosen model and full number: ..................................................
Does the manufacturer require a bypass: yes / no / to check
Local input works after losing Zigbee: yes / no / to test
Mounting and test date: ..................................................

Questions you have to ask before mounting

  • Is a stable toggle staying, or should it be a momentary button?
  • Should a press locally switch the module's output?
  • Should the fixture be physically disconnected, or stay constantly powered?
  • What should happen once Home Assistant is turned off?
  • What should happen after a power loss and restoration?

Look for an electrician who wants to understand the circuit's topology, the device's documentation, and the expected manual-control behavior before mounting anything.

The electrician mounts it: you integrate it

Hand the electrician the point card, the manufacturer's instructions in a language they understand, and the expected Plan B behavior. After mounting, ask for a record: model, version, input mode, whether a bypass was used, power-on behavior.

Your role starts once the circuit is safely closed up and the device has power. You pair the module with the Zigbee coordinator, or add the Wi-Fi integration. You check the entities: switch or light, input event entities, and any energy metering.

A basic test with HA:

# Developer Tools → Actions
action: switch.turn_on
target:
  entity_id: switch.living_room_ceiling

# Repeat with switch.turn_off

Multi-click as an extra, not the foundation

The basic function belongs on a single press

Simply turning a light on and off shouldn't depend on a multi-click or an HA automation. Treat double and long presses as extras, like a Movie scene or turning off the whole room.

Build a multi-click automation in HA's wizard: choose a device trigger or the input's event entity, select a double press if it exists, and choose triggering a scene as the action. Only afterward inspect the YAML your installation generated.

Don't manually type in a sample device_id. Your own Home Assistant installation generates the device identifier. The available click types depend on the model, input mode, firmware, and integration.

An example of just the automation's action:

actions:
  - action: scene.turn_on
    target:
      entity_id: scene.living_room_movie

Accepting the point after mounting

The most important test: turn off Home Assistant (stop the service, or its control) and press every physical switch. The basic function has to work. Multi-click can disappear: that's acceptable, as long as the plain light still works.

☐ Every physical switch performs the basic function.
☐ The entity's state in HA changes after using the wall switch.
☐ Control from HA works in both directions.
☐ Basic control works with HA turned off.
☐ I checked behavior with Wi-Fi or Zigbee unavailable.
☐ I checked behavior after a power loss and restoration.
☐ The light doesn't glow or flicker once off.
☐ The module doesn't reset while switching on the load.
☐ Every point in the three-way or four-way circuit still works.
☐ Multi-clicks are an extra, not the only way to do basic control.
☐ The model, input configuration, and mounting date are recorded on the map.

Damp rooms and renovations

The bathroom: don't choose a solution based on the IP rating alone

Whether mounting is possible depends on the exact zone, the box or enclosure's construction, how the circuit is protected, the device's instructions, and the whole installation. An electrician evaluates this. The label IP44, IP55, or IP65 on one component alone doesn't mean the whole assembly is suited to a given location.

Where possible, power and control devices go in a safer, more accessible location, but the method has to follow the installation's actual design.

A 24V LED strip reduces some of the electrical risk, but still needs a proper design: the power supply type, its mounting location, insulation, connection sealing, the zone, and heat dissipation. Low voltage doesn't excuse skipping proper workmanship.

A renovation is the moment to run N to the boxes, install deeper enclosures, and plan mounting locations. Settle this with an electrician before buying modules.

What to do if the module itself fails

A damaged module can disable both HA control and the switch wired to its input. The user doesn't open the box at that point. They only cut power to the circuit if there's a direct hazard, or an electrician has advised it, and then report the failure.

An electrician, knowing the circuit's documentation, can replace the device or restore plain switching per the installation. The user's Plan B is documentation, access to the circuit's protection, a backup light source, and a professional's contact: not touching the wires themselves.

Write down the device's full model number, keep the instructions, photograph the label, and export the configuration if the manufacturer allows it. A spare module only makes sense if it's exactly the same version, an electrician will be available to swap it, and the configuration is documented.

Key takeaways

  • A neutral wire in the box significantly widens your choice of devices, but doesn't by itself guarantee a module is compatible.
  • A stable toggle, a momentary button, and three-way and four-way circuits are different ways of controlling a light.
  • A momentary button and detach mode aren't the same thing, and don't have to occur together.
  • Detach disconnects the input from directly controlling the output, and can weaken an HA-dependent Plan B.
  • A three-way or four-way circuit needs its full topology identified by an electrician.
  • A bypass isn't a universal add-on. It's applied according to the specific device's documentation.
  • Basic wall control has to be tested with Home Assistant turned off.
  • An electrician does the 230V work; the user documents, integrates, and tests the finished point.

In the next lesson, you'll move on to dimmers and brightness control: there too, the buying decision depends on the installation, not just the module's brand.

Finished this lesson?