Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Hass-Alarm Panel

GitHub release GitHub Workflow Status License

Advanced alarm control panel for Home Assistant with PIN authentication, plugin support, and headless tablet interface.

πŸš€ Features

Security

  • πŸ” BCrypt PIN Hashing - Military-grade security with work factor 12
  • πŸ›‘οΈ Rate Limiting - Protection against brute force attacks (5 attempts, 15-min lockout)
  • 🎫 Session Management - Secure 30-day sessions with auto-refresh
  • πŸ“ IP Tracking - Full audit trail with IP address logging
  • 🚫 IP Filtering - Optional IP range restrictions

User Interface

  • πŸ“± Headless Panel - Touch-optimized fullscreen interface for tablets
  • πŸ–₯️ Admin Panel - Complete user and PIN management
  • ⌨️ Standard Panel - Traditional numeric keypad interface
  • 🎨 Color-Coded States - Visual feedback (Green=Disarmed, Red=Armed, Orange=Armed Home)

Integration

  • 🏠 Home Assistant Events - Automatic event firing for notifications
  • πŸ”Œ REST API - Complete plugin architecture for custom integrations
  • πŸ“² Multi-Device Support - Track unlimited tablets/devices
  • πŸ”” Real-time Updates - Live alarm state synchronization

Technical

  • 🐳 Docker Ready - Multi-architecture support (amd64, arm64, armv7, armhf, i386)
  • πŸ—οΈ Home Assistant Add-on - One-click installation
  • πŸ“Š Database Support - MySQL, SQLite
  • ⚑ High Performance - <100ms response times, minimal resource usage

πŸ“¦ Installation

Home Assistant Add-on (Recommended)

  1. Add this repository to your Home Assistant add-on store:

    https://github.com/werddomain/Hass-Alarm
    
  2. Install the "Hass-Alarm Panel" add-on

  3. Configure and start the add-on

πŸ“– Full Installation Guide

Docker

docker run -d \
  --name hass-alarm \
  -p 5000:80 \
  -e Ha__Host="your-ha-instance:8123/" \
  -e Ha__ApiKey="your_token" \
  -e Ha__Entities__Arm="input_boolean.alarm_home" \
  -e Ha__Entities__ArmHome="input_boolean.alarm_ar" \
  -e Admin__Email="admin@example.com" \
  -e Admin__Password="YourPassword123!" \
  ghcr.io/werddomain/hass-alarm:latest

Manual Installation

See INSTALLATION.md for detailed instructions.

🎯 Quick Start

Prerequisites

Create the required Home Assistant entities:

# configuration.yaml
input_boolean:
  alarm_home:
    name: Alarm Armed
    icon: mdi:shield-lock

  alarm_ar:
    name: Alarm Armed Home
    icon: mdi:shield-home

First-Time Setup

  1. Access the admin panel at http://homeassistant.local:8099
  2. Log in with your admin credentials
  3. Create users under Users section
  4. Assign PINs under PIN Codes section
  5. Test the panel at /Home/Panel or /HeadlessPanel

πŸ“± Usage

Admin Panel

  • URL: http://homeassistant.local:8099
  • Features: User management, PIN management, action groups

Standard Alarm Panel

  • URL: http://homeassistant.local:8099/Home/Panel
  • Features: Numeric keypad, PIN entry, alarm control

Headless Tablet Panel

  • URL: http://homeassistant.local:8099/HeadlessPanel
  • Features:
    • Fullscreen touch interface
    • Device name registration
    • 30-day persistent sessions
    • Auto-lock after inactivity
    • Real-time state updates

REST API

  • Base URL: http://homeassistant.local:8099/api/plugin
  • Documentation: PLUGIN_GUIDE.md

πŸ”Œ API Example

import requests

# Register device
device = requests.post("http://homeassistant.local:8099/api/plugin/device/register",
    json={"deviceName": "My Tablet"})

# Authenticate
auth = requests.post("http://homeassistant.local:8099/api/plugin/authenticate",
    json={"pin": "1234", "deviceId": device.json()["device_id"]})

# Change alarm state
requests.post("http://homeassistant.local:8099/api/plugin/state",
    headers={"X-Session-Token": auth.json()["session_token"]},
    json={"action": "arm"})

🏠 Home Assistant Integration

Event Automation

automation:
  - alias: "Alarm State Change Notification"
    trigger:
      platform: event
      event_type: hass_alarm_state_change
    action:
      - service: notify.mobile_app
        data:
          title: "Alarm Status Changed"
          message: >
            {{ trigger.event.data.friendly_name }} changed alarm to
            {{ trigger.event.data.new_state }} from
            {{ trigger.event.data.device_name }}

Event Data

Events include:

  • timestamp - ISO 8601 timestamp
  • user_name - Username
  • friendly_name - User's email or display name
  • pin_name - Name assigned to the PIN
  • new_state - New alarm state (arm, disarm, arm_home)
  • device_name - Device that made the change
  • device_ip - IP address of the device

πŸ“š Documentation

πŸ› οΈ Development

Building from Source

# Clone repository
git clone https://github.com/werddomain/Hass-Alarm.git
cd Hass-Alarm/Hass-Alarm

# Restore dependencies
dotnet restore

# Run migrations
dotnet ef database update

# Build
dotnet build

# Run
dotnet run

Running Tests

dotnet test

Building Docker Image

docker build -t hass-alarm -f hass-alarm/Dockerfile .

πŸ”„ Version Management

Automatic Releases

The project uses GitHub Actions for automatic builds and releases:

  • Automatic builds on push to main
  • Multi-architecture Docker images
  • Semantic versioning
  • Automated changelog generation

Creating a Release

Use the GitHub Actions workflow:

  1. Go to Actions β†’ Version Bump
  2. Click Run workflow
  3. Select bump type (patch/minor/major)
  4. The workflow will:
    • Update version in config.json
    • Create a git tag
    • Build multi-arch Docker images
    • Create GitHub release

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         Hass-Alarm                          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚
β”‚  β”‚Admin Panel   β”‚  β”‚Standard Panelβ”‚  β”‚Headless Panelβ”‚    β”‚
β”‚  β”‚(Web UI)      β”‚  β”‚(Keypad)      β”‚  β”‚(Tablet UI)   β”‚    β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚
β”‚         β”‚                  β”‚                  β”‚            β”‚
β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜            β”‚
β”‚                            β”‚                               β”‚
β”‚                    β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”                      β”‚
β”‚                    β”‚   Controllers  β”‚                      β”‚
β”‚                    β”‚ - Home         β”‚                      β”‚
β”‚                    β”‚ - Plugin       β”‚                      β”‚
β”‚                    β”‚ - HeadlessPanelβ”‚                      β”‚
β”‚                    β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜                      β”‚
β”‚                            β”‚                               β”‚
β”‚         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β”‚
β”‚         β”‚                  β”‚                  β”‚           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚Session Serviceβ”‚ β”‚AlarmState Svcβ”‚ β”‚HA Event Serviceβ”‚   β”‚
β”‚  β”‚- 30-day tokensβ”‚ β”‚- State mgmt  β”‚ β”‚- Event firing  β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚         β”‚                  β”‚                  β”‚           β”‚
β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β”‚
β”‚                            β”‚                               β”‚
β”‚                    β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”                      β”‚
β”‚                    β”‚   Database     β”‚                      β”‚
β”‚                    β”‚ - Users/PINs   β”‚                      β”‚
β”‚                    β”‚ - Devices      β”‚                      β”‚
β”‚                    β”‚ - Sessions     β”‚                      β”‚
β”‚                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
                             β”‚ API Calls
                             β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚ Home Assistant   β”‚
                    β”‚ - input_boolean  β”‚
                    β”‚ - Events         β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“Š Project Structure

Hass-Alarm/
β”œβ”€β”€ .github/
β”‚   └── workflows/          # GitHub Actions workflows
β”‚       β”œβ”€β”€ build-addon.yml # Build and publish workflow
β”‚       └── version-bump.yml# Version management workflow
β”œβ”€β”€ hass-alarm/             # Home Assistant add-on
β”‚   β”œβ”€β”€ rootfs/             # Add-on filesystem
β”‚   β”‚   └── etc/services.d/hass-alarm/
β”‚   β”‚       β”œβ”€β”€ run         # Startup script
β”‚   β”‚       └── finish      # Shutdown script
β”‚   β”œβ”€β”€ config.json         # Add-on configuration
β”‚   β”œβ”€β”€ Dockerfile          # Add-on Docker image
β”‚   β”œβ”€β”€ README.md           # Add-on store page
β”‚   └── DOCS.md             # Add-on documentation
β”œβ”€β”€ Hass-Alarm/             # Main application
β”‚   β”œβ”€β”€ Controllers/        # MVC controllers
β”‚   β”‚   β”œβ”€β”€ HomeController.cs
β”‚   β”‚   β”œβ”€β”€ PluginController.cs
β”‚   β”‚   └── HeadlessPanelController.cs
β”‚   β”œβ”€β”€ Services/           # Business logic
β”‚   β”‚   β”œβ”€β”€ AlarmState.cs
β”‚   β”‚   β”œβ”€β”€ SessionService.cs
β”‚   β”‚   β”œβ”€β”€ HomeAssistantEventService.cs
β”‚   β”‚   β”œβ”€β”€ RateLimitService.cs
β”‚   β”‚   └── PinHashingService.cs
β”‚   β”œβ”€β”€ Data/               # Data layer
β”‚   β”‚   β”œβ”€β”€ ApplicationDbContext.cs
β”‚   β”‚   └── Models/
β”‚   β”‚       β”œβ”€β”€ Device.cs
β”‚   β”‚       β”œβ”€β”€ PanelSession.cs
β”‚   β”‚       └── PinCode.cs
β”‚   β”œβ”€β”€ Views/              # Razor views
β”‚   β”‚   β”œβ”€β”€ Home/
β”‚   β”‚   └── HeadlessPanel/
β”‚   └── Migrations/         # EF Core migrations
β”œβ”€β”€ INSTALLATION.md         # Installation guide
β”œβ”€β”€ PLUGIN_GUIDE.md         # API documentation
β”œβ”€β”€ README.md               # This file
└── repository.json         # Add-on repository config

🀝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

πŸ“ License

MIT License - See LICENSE file for details

πŸ™ Acknowledgments

πŸ“ž Support

πŸ—ΊοΈ Roadmap

  • Mobile app integration
  • Biometric authentication support
  • Multi-language support
  • Custom themes
  • Advanced reporting and analytics
  • Integration with more alarm systems
  • Voice assistant integration

⭐ Star History

If you find this project useful, please consider giving it a star!


Made with ❀️ for the Home Assistant community

About

Docker Application for Home Assistant. Integrate a web based alarm panel.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages