Skip to content

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.

Servicewindow.lcards.core.*What it does
Systems ManagersystemsManagerCentralised entity state subscriptions; cards register interest and receive smart push notifications — no duplicate subscriptions
DataSource ManagerdataSourceManagerNamed data buffers tied to entities; records history, runs processing pipelines (moving average, min/max, aggregation) and notifies subscribers
Rules EnginerulesManagerEvaluates conditions and hot-patches LCARd styles at runtime; target any card by tag, type, or ID
Theme ManagerthemeManagerToken-based theming (colours, spacing, borders, and more); resolves theme tokens in any card field
Alert ModealertModeCoordinated alert states (green / red / yellow / blue / gray / black); drives palette shifts, triggers sounds, driven by input_select.lcards_alert_mode
Animation ManageranimationManagerCoordinates Anime.js v4 animations; provides built-in configurable presets or accepts custom anime.js parameters
Sound ManagersoundManagerLCARS-style audio feedback for card interactions and UI events; configurable scheme with per-event overrides
Style Preset ManagerstylePresetManagerCentral registry of named style presets for buttons, sliders, elbows; consumed from packs
Component ManagercomponentManagerRegistry of SVG component definitions (D-pad, Alert, custom shapes) used in button component mode
Asset ManagerassetManagerLoads and caches SVG and font assets for use across cards
Pack ManagerpackManagerLoads and distributes content from packs (themes, presets, animations, assets, etc.) to appropriate managers at startup
Helper ManagerhelperManagerManages 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.


Further Reading