Files

4.3 KiB
Executable File

Imperial Command Center

A full-screen touchscreen kiosk dashboard for Home Assistant control with a Star Wars Imperial/dark theme.

Features

  • Google Calendar - Month view with event details
  • To-Do List - HA built-in todo integration
  • Alarmo - Arm/disarm panel with numeric keypad
  • Thermostats - Temperature display and control (supports 2 thermostats)
  • Lights - Grouped by room, individual toggles, master on/off
  • Door Locks - Status indicators, lock/unlock with confirmation
  • Camera Overlay - All cameras via go2rtc WebRTC
  • Person Detection Alert - Full-screen popup on Frigate detection
  • Package Detection - Binary sensor status display
  • Presence Wake - Screen wakes on approach (TensorFlow.js person detection)
  • Screen Sleep - Auto-sleep after idle timeout

Tech Stack

  • Electron - Desktop shell with kiosk mode
  • React 18 + TypeScript
  • Tailwind CSS - Imperial dark theme
  • Zustand - State management
  • home-assistant-js-websocket - HA connection
  • go2rtc WebRTC - Camera streaming
  • TensorFlow.js COCO-SSD - Presence detection

Quick Start

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Home Assistant with long-lived access token
  • go2rtc server (for camera feeds)

Installation

# Clone the repository
git clone https://github.com/your-repo/imperial-command-center.git
cd imperial-command-center

# Install dependencies
npm install

# Copy environment file
cp .env.example .env

# Edit .env with your settings
nano .env

Configuration

Edit .env with your Home Assistant and service URLs:

VITE_HA_URL=http://192.168.1.50:8123
VITE_HA_WS_URL=ws://192.168.1.50:8123/api/websocket
VITE_GO2RTC_URL=http://192.168.1.241:1985
VITE_FRIGATE_URL=http://192.168.1.241:5000

Edit src/config/entities.ts to configure your Home Assistant entity IDs.

Development

# Start development server (React only)
npm run dev

# Start with Electron
npm run electron:dev

Building

# Build for Linux (AppImage)
npm run build:linux

# Build for Windows (NSIS installer)
npm run build:win

# Build all platforms
npm run electron:build

Deployment

Linux Kiosk Setup

  1. Build the application:

    npm run build:linux
    
  2. Run the deployment script:

    sudo ./scripts/deploy-linux.sh
    
  3. Configure autologin for the kiosk user (for LightDM):

    # /etc/lightdm/lightdm.conf
    [Seat:*]
    autologin-user=kiosk
    autologin-session=openbox
    
  4. Start the service:

    sudo systemctl start imperial-command-center
    

Manual Service Setup

  1. Copy the AppImage to /opt/imperial-command-center/
  2. Copy the service file:
    sudo cp imperial-command-center.service /etc/systemd/system/
    sudo systemctl daemon-reload
    sudo systemctl enable imperial-command-center
    

Home Assistant Setup

Long-Lived Access Token

  1. Go to your Home Assistant profile
  2. Scroll to "Long-Lived Access Tokens"
  3. Create a new token
  4. Enter it in the dashboard settings

Required Entities

Configure these in src/config/entities.ts:

  • 2 climate entities (thermostats)
  • 10 light entities (grouped by room)
  • 3 lock entities
  • 1 alarm_control_panel entity (Alarmo)
  • 1 binary_sensor for package detection
  • 1 todo entity

Alarmo Setup

The dashboard expects Alarmo to be installed and configured in Home Assistant.

Camera Integration

The dashboard uses go2rtc for camera streaming:

  1. Ensure go2rtc is running and configured with your cameras
  2. Update camera names in src/config/entities.ts to match go2rtc stream names
  3. Camera feeds use WebRTC for low-latency streaming

Keyboard Shortcuts (Development)

  • F11 - Toggle fullscreen
  • Ctrl+Shift+I - Open DevTools
  • Escape - Exit fullscreen (when not in kiosk mode)

Troubleshooting

Connection Issues

  • Verify Home Assistant URL is correct
  • Check access token is valid
  • Ensure HA allows WebSocket connections from the kiosk IP

Camera Feed Issues

  • Verify go2rtc is accessible from the kiosk
  • Check stream names match between go2rtc and entity config
  • Ensure WebRTC is not blocked by firewall

Screen Wake/Sleep

  • Requires X11 (Wayland may not work)
  • Install xdotool and unclutter for full functionality
  • Check xset commands work manually

License

MIT