🏠 Smart Home Automation Webhook

Control your smart home devices by scanning QR codes with AllCodeRelay! Node.js webhook with MQTT and Home Assistant integration.

Node.js MQTT Home Assistant
Configure Webhook Full Documentation

Key Features

  • Device Control - Toggle lights, switches, and smart outlets
  • Scene Activation - Trigger complex automation scenes
  • Security Integration - Arm/disarm security systems
  • MQTT Support - Direct IoT device communication
  • Home Assistant - Full integration with HA ecosystem
  • Real-time Feedback - Instant status updates via AllCodeRelay
  • Custom Scenes - Create complex automation workflows
  • Mobile Optimized - Perfect for smartphone control

Device Codes

💡 Lights

💡 LIGHT_LIVING_ROOM
Living Room Light
💡 LIGHT_BEDROOM
Bedroom Light
💡 LIGHT_KITCHEN
Kitchen Light

🔌 Switches & Outlets

🌀 SWITCH_FAN
Ceiling Fan
📺 OUTLET_TV
TV Outlet

🎬 Scenes

🎬 SCENE_MOVIE
Movie Night
🌙 SCENE_BEDTIME
Bedtime
☀️ SCENE_MORNING
Good Morning

🔒 Security

🔒 SECURITY_ARM
Arm Security System
🔓 SECURITY_DISARM
Disarm Security System

Usage Examples

💡 Scanning a Light Control QR Code

When you scan LIGHT_LIVING_ROOM:

💡 Living Room Light 🟢 Living Room Light turned ON

🎬 Activating a Scene

When you scan SCENE_MOVIE:

🎬 Movie Night ✅ Scene activated! Living Room Light: dim Kitchen Light: off TV Outlet: on

🔒 Security Control

When you scan SECURITY_ARM:

🔒 Arm Security System ✅ Security system ARMED

Quick Start

1. Installation

# Install dependencies npm install # Copy environment configuration cp .env.example .env

2. Configuration

Edit .env file with your settings:

PORT=3000 MQTT_BROKER_URL=mqtt://localhost:1883 MQTT_USERNAME=your_mqtt_username MQTT_PASSWORD=your_mqtt_password HA_URL=http://localhost:8123 HA_TOKEN=your_home_assistant_token

3. Start the Server

# Production npm start # Development (with auto-reload) npm run dev

4. Generate QR Codes

Create QR codes for your devices using the device codes above.

Note: The webhook works without actual devices for testing - it will log commands and return success messages.

Integration Guides

🏠 Home Assistant Integration
  1. Get Long-Lived Access Token from Profile → Security
  2. Configure HA_URL and HA_TOKEN in .env
  3. Entity mapping works automatically
Example Entities:
  • light.living_room
  • switch.ceiling_fan
  • alarm_control_panel.home
📡 MQTT Integration

Configure your MQTT broker in .env:

MQTT_BROKER_URL=mqtt://192.168.1.100:1883 MQTT_USERNAME=homeassistant MQTT_PASSWORD=your_password
Example Topics:
  • home/living_room/light
  • home/security/arm

API Endpoints

Webhook Endpoint
  • POST /webhook - Main AllCodeRelay webhook
  • Body: {"code": "LIGHT_LIVING_ROOM"}
Utility Endpoints
  • GET /health - Health check and status
  • GET /devices - List all configured devices
Health Check Response
{ "status": "ok", "mqtt_connected": true, "timestamp": "2024-12-15T10:30:00.000Z" }

Files Included

Core Files
  • smart-home-webhook.js - Main webhook script
  • package.json - Node.js dependencies
  • .env.example - Environment configuration
  • smart-home-README.md - Complete documentation
Features
  • MQTT and Home Assistant integration
  • Configurable device mappings
  • Scene automation support
  • Production-ready with PM2 support

Get Started

Ready to control your smart home with AllCodeRelay?

Download Webhook Script Download Package.json Download Config Template View Full Documentation
Back to Gallery Main Site