Smart Switch
A 3D-printed servo-actuated wall switch controller that integrates seamlessly with Home Assistant via MQTT. This project transforms any standard wall switch into a smart switch that can be controlled remotely while maintaining the ability to operate it manually.
Overview
The SmartSwitch is designed to retrofit existing wall switches without requiring electrical modifications. The device consists of a 3D-printed enclosure that mounts over a standard wall switch and houses an ESP8266 microcontroller and a servo motor. The servo physically actuates the switch lever, providing both remote control and manual operation capabilities.
Key Features
- Non-invasive Installation: Mounts over existing wall switches without electrical modifications
- 3D-Printed Housing: Custom enclosure designed for wall mounting
- Remote Control: Control via Home Assistant, web interface, or MQTT commands
- Manual Override: Physical switch remains fully functional
- Home Assistant Integration: Automatic discovery and seamless integration
- Persistent Settings: Remembers switch positions and calibration settings
- WiFi Connectivity: Connects to your home network for remote access
Home Assistant Integration
The device automatically registers with Home Assistant using MQTT discovery, providing:
- Switch Entity: Main ON/OFF control that appears as a standard switch in Home Assistant
- Fine Control Buttons: Additional buttons for precise servo positioning (+1°, -1°, +10°, -10°)
- Calibration Controls: SET_ON and SET_OFF buttons to calibrate switch positions
- Status Monitoring: Real-time availability and state feedback
- Automation Ready: Fully compatible with Home Assistant automations and scenes
How It Works
- Physical Mounting: The 3D-printed bracket mounts securely over your existing wall switch
- Servo Actuation: A servo motor physically moves the switch lever up or down
- MQTT Communication: The ESP8266 connects to your WiFi and communicates via MQTT
- Home Assistant Discovery: The device automatically appears in Home Assistant without manual configuration
- Dual Operation: Use Home Assistant for remote control or operate the switch manually as normal
Use Cases
- Smart Home Integration: Add any wall switch to your Home Assistant setup
- Remote Lighting Control: Control lights from anywhere in your home
- Automation: Include traditional switches in complex home automation scenarios
- Accessibility: Provide remote control for hard-to-reach switches
- Energy Management: Monitor and control electrical loads through Home Assistant
Technical Highlights
- ESP8266-based: Reliable WiFi connectivity and sufficient processing power
- MQTT Protocol: Fast, lightweight communication with Home Assistant
- Non-blocking Operation: Smooth servo movement without affecting responsiveness
- Persistent Storage: EEPROM storage for calibration and configuration settings
- Web Interface: Built-in HTTP server for direct device control and configuration
Project Structure
This project provides a complete solution including:
ESP8266 firmware with Home Assistant integration
MQTT topic management and device discovery
Servo control with position calibration
Web-based configuration interface
Comprehensive documentation and setup guides
Perfect for makers who want to add smart home functionality to existing switches without rewiring or electrical work.