Files
portainer-core/stacks/home-assistant.yml
T
jpmschweitzerandClaude Opus 4.6 ec8c3f5925 feat(home-assistant): switch to host networking and add Matter Server
- Switch HA from bridge to host networking for better device discovery
- Add python-matter-server container for Matter protocol support
- Both services share host network for mDNS/IPv6 multicast
- Update NPM forward hostname to use IP address
- Add Matter Server setup instructions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 10:33:49 +01:00

115 lines
3.4 KiB
YAML

version: '3.8'
# Home Assistant - Smart Home Automation Platform
# Ports: 8123 (Home Assistant), 5580 (Matter Server WebSocket)
# GPU: No
# Storage: SSD (config and database)
services:
home-assistant:
image: ghcr.io/home-assistant/home-assistant:stable
container_name: home-assistant
restart: unless-stopped
network_mode: host
volumes:
# Config on SSD (includes database, automations, scripts)
- /home/jpmschweitzer/docker-data/home-assistant/config:/config
environment:
- TZ=Europe/Amsterdam
# Privileged mode for USB device access (Z-Wave, Zigbee dongles)
privileged: true
healthcheck:
test: ["CMD-SHELL", "curl -fSs http://localhost:8123/manifest.json || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 120s
deploy:
resources:
limits:
memory: 1G
matter-server:
image: ghcr.io/matter-js/python-matter-server:stable
container_name: matter-server
restart: unless-stopped
network_mode: host
security_opt:
- apparmor:unconfined
volumes:
# Matter fabric data on SSD (BACK UP before upgrades - contains device credentials)
- /home/jpmschweitzer/docker-data/matter-server/data:/data
# D-Bus socket for Bluetooth commissioning
- /run/dbus:/run/dbus:ro
environment:
- TZ=Europe/Amsterdam
healthcheck:
test: ["CMD-SHELL", "curl -fSs http://localhost:5580 || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
deploy:
resources:
limits:
memory: 512M
# Note: Both services use network_mode: host for LAN device discovery (mDNS, SSDP, Matter)
# Home Assistant reaches Matter Server at ws://localhost:5580/ws
# Other containers should reach HA via http://192.168.86.149:8123
# Setup Instructions:
# 1. Create config directory:
# mkdir -p /home/jpmschweitzer/docker-data/home-assistant/config
#
# 2. Deploy this stack via Portainer or:
# docker compose -f home-assistant.yml up -d
#
# 3. Wait for initial setup (1-2 minutes)
#
# 4. Access web interface: http://localhost:8123
# or external: https://housekeeping.schweitz.net
#
# 5. Complete the onboarding wizard:
# - Create admin account
# - Set home location
# - Configure integrations
#
# USB Device Access:
# Privileged mode is enabled for Z-Wave, Zigbee, or other USB devices.
# For specific device mapping instead, replace privileged: true with:
# devices:
# - /dev/ttyUSB0:/dev/ttyUSB0
# - /dev/ttyACM0:/dev/ttyACM0
#
# NPM Configuration:
# Domain: housekeeping.schweitz.net
# Scheme: http
# Forward Hostname/IP: 192.168.86.149
# Forward Port: 8123
# Websockets Support: ENABLED (required for HA)
# SSL: Let's Encrypt
#
# After NPM setup, add to configuration.yaml:
#
# http:
# use_x_forwarded_for: true
# trusted_proxies:
# - 172.16.0.0/12
# - 192.168.0.0/16
# - 10.0.0.0/8
#
# Matter Server Setup:
# 1. Create data directory:
# mkdir -p /home/jpmschweitzer/docker-data/matter-server/data
#
# 2. After deploying, connect from Home Assistant:
# Settings > Devices & Services > Add Integration > Matter
# Deselect "Install the official Matter Server app"
# Enter URL: ws://localhost:5580/ws
#
# 3. Commission devices via the HA Companion app (uses phone Bluetooth)
# or add --bluetooth-adapter 0 to the matter-server command for local BT
#
# Source: https://github.com/matter-js/python-matter-server