Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions homeassistant-event-gateway/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Home Assistant Event Gateway - Environment Configuration
# Copy this file to .env and fill in your values

# =============================================================================
# REQUIRED: Security
# =============================================================================

# Shared secret for authenticating Home Assistant webhooks
# Generate a random string: openssl rand -hex 32
HA_SHARED_SECRET=your-secret-here

# =============================================================================
# OPTIONAL: Slack Integration
# =============================================================================

# Slack Incoming Webhook URL
# Create one at: https://api.slack.com/messaging/webhooks
# Leave empty to disable Slack notifications
SLACK_WEBHOOK_URL=

# =============================================================================
# OPTIONAL: AI Explanations
# =============================================================================

# OpenAI API key (optional - enables AI explanations)
# Get one at: https://platform.openai.com/api-keys
OPENAI_API_KEY=

# OpenAI model to use (default: gpt-4o-mini)
# Options: gpt-4o-mini, gpt-4o, gpt-4-turbo, gpt-3.5-turbo
OPENAI_MODEL=gpt-4o-mini

# OR use Anthropic Claude instead of OpenAI
# Get an API key at: https://console.anthropic.com/
ANTHROPIC_API_KEY=

# Anthropic model to use (default: claude-3-haiku-20240307)
# Options: claude-3-haiku-20240307, claude-3-5-sonnet-20241022, claude-3-opus-20240229
ANTHROPIC_MODEL=claude-3-haiku-20240307

# =============================================================================
# OPTIONAL: Noise Filtering
# =============================================================================

# Deduplication window in seconds (default: 60)
# Events with same entity_id and state within this window are ignored
DEDUPE_WINDOW_SEC=60

# Burst detection threshold (default: 5)
# Number of events from same entity that triggers burst flag
BURST_THRESHOLD=5

# Burst detection window in minutes (default: 5)
BURST_WINDOW_MIN=5

# Night hours (24-hour format, UTC)
# Motion/door events during night hours are flagged as notable
NIGHT_START_HOUR=22
NIGHT_END_HOUR=6

# =============================================================================
# OPTIONAL: Entity Filtering
# =============================================================================

# Allowlist of entities to process (comma-separated)
# Supports wildcards: binary_sensor.*, sensor.temperature_*
# Leave empty to allow all entities
HA_ENTITY_ALLOWLIST=

# Denylist of entities to ignore (comma-separated)
# Supports wildcards: sensor.weather_*, automation.*
# These are filtered out even if in allowlist
HA_ENTITY_DENYLIST=sensor.time,sensor.date,sensor.uptime

# Event types that are always notable (comma-separated)
# Default: alarm_triggered,device_offline,battery_low
HA_NOTABLE_EVENT_TYPES=alarm_triggered,device_offline,battery_low

# State values that are always notable (comma-separated)
# Default: alarm,problem,unavailable
HA_NOTABLE_STATES=alarm,problem,unavailable
24 changes: 24 additions & 0 deletions homeassistant-event-gateway/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Dependencies
node_modules/

# Environment files
.env
.env.local
.env.*.local

# Codehooks
.codehooks/

# IDE
.idea/
.vscode/
*.swp
*.swo

# OS
.DS_Store
Thumbs.db

# Logs
*.log
npm-debug.log*
Loading