3D Printed Wall Switches for Home Assistant
In this article
Yes, 3D printed wall switches have made Home Assistant smart homes significantly more accessible by providing a low-cost, customizable path to replace traditional light switches with smart controls. Instead of buying expensive smart switches or rewiring, you can print a housing that fits over your existing switch and integrates a smart relay or module, often for under $20 in parts.
Background: The Problem with Smart Switches
Traditional smart switches are expensive, often $30–$60 each, and require neutral wires that many older homes lack. They also come in fixed colors and styles that may not match your décor. For renters, replacing a wall switch is usually off-limits because it modifies the electrical system. These barriers made smart lighting feel out of reach for many people, especially those who rent or live in older buildings.
How 3D Printed Wall Switches Work
The core idea is to keep your existing physical switch and add a smart actuator behind it. A 3D printed bracket or cover holds a small motor or servo that physically presses the switch, while a smart relay (like a Sonoff or Shelly) controls the motor and connects to Home Assistant via Wi-Fi or Zigbee. The printed part replaces just the wall plate or adds a mechanism around the existing toggle, so no electrical wiring is touched.
For a simpler approach, you can print a housing that contains a smart button or a touch sensor that sends a command to Home Assistant, which then controls a smart bulb or plug. This avoids any electrical work entirely and is fully reversible—ideal for renters.
Benefits: Cost, Customization, and Learning
- Cost: A 3D printed switch costs a few dollars in filament, plus $5–$15 for a relay or button module. Total is often under $20, versus $30–$60 for a commercial smart switch.
- Customization: You can print any color, shape, or size. Need a switch with a built-in night light or a larger button for accessibility? You can design it.
- Learning: Building your own switch teaches you about electronics, firmware, and home automation—a great entry point for hobbyists.
- Reversibility: Most designs snap over the existing switch without cutting wires, so you can return the house to its original state when you move out.
How to Choose a Design
Before printing, decide what you want the switch to do and what hardware you have. Here are the main options:
- Motorized toggle: A small servo or linear actuator physically flips the switch. Works with existing toggle switches and requires a relay to control the motor.
- Smart button: A printed housing with a momentary button that sends a command to Home Assistant via ESPHome or Tasmota. No wiring to the mains—just a battery or USB power.
- Touch sensor: Similar to a smart button but uses a capacitive touch pad, which can be printed as a sleek flat surface.
- Switch replacement: A printed faceplate that holds a smart relay module (like Shelly 1) wired behind the existing switch. This requires basic electrical knowledge and is not for renters.
Check the dimensions of your existing switch plate and the clearance behind it. Many designs on sites like Thingiverse or Printables are made for standard US decora or toggle switches, but you can modify the STL in TinkerCAD if needed.
Common Problems and Troubleshooting
The most frequent issues are mechanical and firmware-related. A motor might not have enough torque to flip a stiff switch—use a servo with metal gears or add a lever arm. The printed part may warp if printed with PLA in a hot car or near a heater; use PETG or ABS for better heat resistance. If the switch doesn't respond reliably, check the Wi-Fi signal strength, as metal boxes can block it. For ESPHome devices, ensure you have the correct GPIO pins defined in the YAML configuration.
Another common problem is that the toggle switch's physical state doesn't match the logical state in Home Assistant. Use a sensor to detect the switch position (e.g., a magnetic reed switch) or set up a template switch that tracks the last command.
Costs and Materials
Here's a rough breakdown of what you'll need:
- 3D printer filament: $5–$10 per switch (a few grams of PLA or PETG).
- ESP8266 or ESP32 board: $3–$8.
- Relay module or servo: $2–$10.
- Power supply (USB or battery): $5–$15.
- Miscellaneous wires, screws, and connectors: $5.
Total is typically $15–$30 per switch, depending on the design and whether you reuse parts. In contrast, a commercial smart switch costs $30–$60 and requires professional installation if you're not comfortable with wiring.
Safety and Electrical Considerations
If your design involves opening the wall or connecting to mains voltage, you must follow strict safety rules. Always turn off the circuit breaker before working on any wiring. Use a voltage tester to confirm power is off. If you're not confident, hire a licensed electrician. Never use 3D printed parts as the sole insulation for live wires—printed plastic is not rated for high voltage. Keep all mains connections inside a certified electrical box, and use the printed part only for the user interface (the button or toggle), not as a junction box.
For battery-powered smart buttons, there's no electrical risk, but ensure the battery is secured and cannot be punctured. Use a reputable lithium-ion battery with a protection circuit, and charge it with a proper charger.
Alternatives to 3D Printing
If you don't have a 3D printer or prefer a ready-made solution, consider these alternatives:
- Smart bulbs with a remote or app—no switch replacement needed, but you lose the physical switch.
- Switchbot—a commercial device that physically presses your existing switch. It's about $40 and works with Home Assistant via Bluetooth or a hub.
- Shelly relays—tiny Wi-Fi relays that fit behind your existing switch, with a companion app and Home Assistant integration. They require wiring but are cheaper than full smart switches.
- Zigbee or Z-Wave switches—more reliable than Wi-Fi, but still need wiring.
3D printing offers the most flexibility and the lowest cost, but it requires time and patience. If you want a quick, no-solder solution, a commercial smart button like the IKEA Tradfri or Aqara button can be placed on the wall with adhesive and programmed in Home Assistant.
Frequently Asked Questions
Do I need to know how to code to use a 3D printed switch?
Basic familiarity with ESPHome or Tasmota helps, but many designs come with pre-built firmware you can flash with a single command. You can also use a simple Zigbee button that requires no coding—just pair it with Home Assistant.
Will a 3D printed switch work with a dimmer?
Most 3D printed designs are for on/off switches, not dimmers. To dim, you'd need a smart dimmer module or a smart bulb. You can still print a housing for a dimmer knob, but it's more complex.
Can I use a 3D printed switch with a smart bulb?
Yes. Many people use a printed button that sends a command to Home Assistant, which then controls a smart bulb. This avoids any wiring and keeps the bulb smart.
Is it safe to leave a 3D printed switch on the wall?
If it's battery-powered and doesn't touch mains wiring, yes. If it's near a heat source or direct sunlight, use PETG or ABS to prevent warping. For mains-connected designs, follow electrical codes and use certified components.
What if I don't have a 3D printer?
Many public libraries and makerspaces offer 3D printing services for a small fee. You can also order prints online from services like Shapeways or treatstock. The STL files are usually free.
Will this work with Home Assistant out of the box?
If you use ESPHome, you'll need to configure the device in Home Assistant, but the process is well-documented and takes about 10 minutes. Zigbee devices are even simpler—just pair them via the integration.