Systems Architecture
The diagram below shows how LCARdS cards, core singletons, and Home Assistant relate at runtime.
Core Services
These services start on page load and become accessible to all LCARdS cards via window.lcards.core.*. Cards interact with them transparently — they do not need to implement any of this themselves.
| Service | window.lcards.core.* | What it does |
|---|---|---|
| Systems Manager | systemsManager | Centralised entity state subscriptions; cards register interest and receive smart push notifications — no duplicate subscriptions |
| DataSource Manager | dataSourceManager | Named data buffers tied to entities; records history, runs processing pipelines (moving average, min/max, aggregation) and notifies subscribers |
| Rules Engine | rulesManager | Evaluates conditions and hot-patches LCARd styles at runtime; target any card by tag, type, or ID |
| Theme Manager | themeManager | Token-based theming (colours, spacing, borders, and more); resolves theme tokens in any card field |
| Alert Mode | alertMode | Coordinated alert states (green / red / yellow / blue / gray / black); drives palette shifts, triggers sounds, driven by input_select.lcards_alert_mode |
| Animation Manager | animationManager | Coordinates Anime.js v4 animations; provides built-in configurable presets or accepts custom anime.js parameters |
| Sound Manager | soundManager | LCARS-style audio feedback for card interactions and UI events; configurable scheme with per-event overrides |
| Style Preset Manager | stylePresetManager | Central registry of named style presets for buttons, sliders, elbows; consumed from packs |
| Component Manager | componentManager | Registry of SVG component definitions (D-pad, Alert, custom shapes) used in button component mode |
| Asset Manager | assetManager | Loads and caches SVG and font assets for use across cards |
| Pack Manager | packManager | Loads and distributes content from packs (themes, presets, animations, assets, etc.) to appropriate managers at startup |
| Helper Manager | helperManager | Manages LCARdS and HA-LCARS input_* helper entities; auto-create from LCARdS Config Panel |
Template Support — any text field in any card supports four syntaxes: JavaScript [[[return ...]]], LCARdS tokens {entity.state} / {theme:colors.card.button}, DataSource {ds:sensor_name}, and Jinja2 {{states("sensor.temp")}} (Jinja2 evaluated by HA server).
Pack System
Packs are the extensibility mechanism that distributes themes, presets, animations, and assets to the core managers.
See Pack System for the full developer reference.