homelab-codex-ws/services/ha-diag-agent/service.yaml
Oskar Kapala ab8895d28b feat(ha-diag-agent): scaffold service with HA REST client and event emitter
- new per-host service, follows node-agent pattern
- 7 new HA event types defined (routing in supervisor — Phase 5)
- HeartbeatCheck as pipeline validator (pings /api/, emits ha_websocket_dead)
- service.yaml + host configs for piha (ken) and chelsty-infra (chelsty)
- test scaffolding with aiohttp/aiosqlite mocks (15/15 passing)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 12:26:34 +02:00

38 lines
912 B
YAML

service:
name: ha-diag-agent
# Deployed per-host: piha (site: ken) and chelsty-infra (site: chelsty)
owner_node: per-host
exposure: local-only
monitor: true
dependencies:
- homeassistant
ports:
- 8087
healthcheck:
type: http
path: /health
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
restart_policy: unless-stopped
persistence:
paths:
- /opt/homelab/events
- /var/lib/ha-diag-agent
runtime:
env_vars:
- HA_TOKEN # long-lived HA access token (required)
- HA_URL # http://homeassistant.local:8123
- NODE_NAME # canonical node name: piha, chelsty-infra, ...
- LOCATION_TAG # human site label: ken, chelsty, ...
- CHECK_INTERVAL # seconds between check cycles (default: 60)
- PORT # FastAPI port (default: 8087)
- LOG_LEVEL # default: info