You are reading the development docs (2026.12.1-dev.1): features here may not be released yet.
Skip to content

Background and Anchors ​

The drawing an MSD is built on, and the named points on it that overlays and lines use. The overlays themselves have their own pages: Control Overlay, Line Overlay and Shape Overlay.

msd ​

Everything the display shows lives under the card's msd key: the blueprint, the view box, the anchors, the overlays and how lines are routed. The other top-level keys (id, rules, sizing) are on the overview.

  • An msd needs a blueprint (base_svg.source) or a view_box. A view_box with no blueprint is a blank canvas.
  • Every position, size and distance under msd is in the drawing's own units (its view box), not pixels, so the whole display scales with the card.
yaml
type: custom:lcards-msd-card
grid_options:
  columns: full
  rows: 5
msd:
  # the blueprint, and the part of it to show
  base_svg:
    source: builtin:ncc-1701-a-blue
  view_box: [180, 270, 1600, 720]
  # a card on the drawing, and a line from it to the bridge marker (br)
  overlays:
    - id: bridge-ctl
      type: control
      attachment: top-left
      position: [190, 278]
      size: [340, 96]
      card:
        type: custom:lcards-button
        preset: lozenge
        entity: input_boolean.lcards_test_lights
        text:
          name:
            content: BRIDGE
            show: true
            font_size: 30
    - id: bridge-line
      type: line
      anchor: bridge-ctl
      attach_to: br
      route: auto
      corner_style: round
      style:
        color: var(--lcards-gray-medium-light)
        width: 3
KeyTypeDefaultDescription
msd.base_svgobject-The blueprint: see base_svg. Not needed for a blank canvas
msd.view_boxauto / listautoThe part of the drawing shown, [min_x, min_y, width, height]: see view_box
msd.anchorsobject-Your own named points: see anchors
msd.overlayslist-The controls, lines and shapes: see Overlay types
msd.routingobject-Card-wide line routing settings: see Line Routing
msd.channelsobject-Named corridors that guide lines: see Line Routing
msd.animationslist-One animation for a group of overlays: see msd.animations
msd.background_animationlist / object-An animated canvas behind the drawing: see background_animation
msd.triggers_updatestring-all: every control gets every Home Assistant update. Slower; prefer triggers_update on the one control that needs it (Control Overlay)

base_svg ​

The blueprint the display is drawn on: a built-in ship, your own SVG file, or none. Its markers and outline also give you anchors to attach lines to without placing any yourself.

  • source takes builtin:<name> (see Built-in blueprints), a file in your /config/www folder as /local/<file>.svg, a full https:// URL (the site must allow it), or an SVG from the Home Assistant media library as media-source://....
  • In the MSD Studio's Base SVG tab, Asset library lists the built-in blueprints, Custom path takes a /local/ path or a URL, and Browse Home Assistant media picks an SVG from the media library (it lists only SVG files).
  • render_visual: false hides the blueprint but still reads its anchors: use it with an animated or image background and anchors placed on that instead.
yaml
type: custom:lcards-msd-card
grid_options:
  columns: full
  rows: 6
msd:
  base_svg:
    source: builtin:ncc-1701-kelvin
KeyTypeDefaultDescription
base_svg.sourcestringrequiredbuiltin:<name>, /local/<file>.svg, an https:// URL, media-source://..., or none for a blank canvas
base_svg.filterslist-Dim, blur or tint the blueprint: see Base SVG Filters
base_svg.render_visualbooleantruefalse: don't draw the blueprint, only read its anchors and view box
base_svg.harvest_landmarksbooleantrueWork out anchors from the blueprint's outline: see Automatic anchors
base_svg.harvest_svg_elementsbooleantrueUse the blueprint's own named markers as anchors: see Automatic anchors
base_svg.animationslist-Animations on parts of the blueprint, by id or class: see base_svg.animations

Built-in blueprints ​

The blueprints that come with LCARdS, for source: builtin:<name>. The MSD Studio's Asset library lists the same ones.

SourceBlueprint
builtin:ncc-1701-aUSS Enterprise NCC-1701-A (Constitution class refit), the master systems display
builtin:ncc-1701-a-blueThe same ship in blue, with markers for the bridge (br), warp core (wc) and shuttle bay (sb)
builtin:ncc-1701-kelvinUSS Enterprise NCC-1701 of the Kelvin timeline films
builtin:galaxy-class-lineartA Galaxy class starship from the side in line art, drawn in your theme's colour, with anchors for its main parts: bridge, saucer, neck, engineering, warp_core, impulse, shuttle_bay, deflector, torpedo, nacelle, bussard, pylon
builtin:enterprise-d-shuttlecraft15-anomalyShuttlecraft 15, a type-6 shuttle of the Enterprise-D, with anomaly markers
  • The line-art Galaxy class suits a labelled schematic: its lines take your theme's colour, and labels join its parts by anchor name (attach_to: warp_core). The MSD Studio's Quick label tool snaps to them.
  • Its outline comes from the Galaxy class model the Astrometrics card shows; the decks, the warp core and the nacelle coils are drawn inside it.
yaml
# The line-art Galaxy class with two labels joined to its parts by name
type: custom:lcards-msd-card
grid_options:
  columns: full
  rows: 5
msd:
  base_svg:
    source: builtin:galaxy-class-lineart
  overlays:
    - id: lbl_1
      type: control
      attachment: right
      position: [430, 90]
      size: [354, 75.4]
      card:
        type: custom:lcards-button
        preset: text-only
        min_height: 0
        text:
          label:
            content: MAIN BRIDGE
            show: true
            position: center-right
            font_size: 52
            color: theme:colors.ui.secondary
    - id: ln_1
      type: line
      anchor: lbl_1
      anchor_side: right
      anchor_gap: 24
      attach_to: bridge
      attach_side: center
      route: manhattan
      corner_radius: 40
      style:
        color: var(--lcars-card-top-color, var(--lcards-gray-medium))
        width: 10
    - id: lbl_2
      type: control
      attachment: right
      position: [760, 640]
      size: [302, 75.4]
      card:
        type: custom:lcards-button
        preset: text-only
        min_height: 0
        text:
          label:
            content: WARP CORE
            show: true
            position: center-right
            font_size: 52
            color: theme:colors.ui.secondary
    - id: ln_2
      type: line
      anchor: lbl_2
      anchor_side: right
      anchor_gap: 24
      attach_to: warp_core
      attach_side: center
      route: manhattan
      corner_radius: 40
      style:
        color: var(--lcars-card-top-color, var(--lcards-gray-medium))
        width: 10

view_box ​

Which part of the drawing the card shows, and the coordinates every position on it uses. By default it is the blueprint's own view box, so the whole drawing fits the card.

  • Give [min_x, min_y, width, height] to show only part of the blueprint: the card crops to it and keeps its shape (width to height).
  • Overlay positions stay in the blueprint's coordinates whatever the view box: cropping moves the window, not the overlays.
  • In the MSD Studio, the Base SVG tab's ViewBox section switches between Auto-detect from SVG and a custom view box.
yaml
# Only the ship's middle, cropped from the 1920 by 1200 blueprint
type: custom:lcards-msd-card
grid_options:
  columns: full
  rows: 5
msd:
  base_svg:
    source: builtin:ncc-1701-a-blue
  view_box: [180, 270, 1600, 720]
More about view_box
  • No view box in the SVG: with auto, an SVG file that has no viewBox of its own is read as [0, 0, 400, 200]. Give view_box for such a file.
KeyTypeDefaultDescription
view_boxauto / listautoauto: the blueprint's own view box. Or [min_x, min_y, width, height] in the blueprint's units; required for a blank canvas

A blank canvas ​

A display with no blueprint: give a view_box and draw everything with overlays. Use it for a panel of controls wired together, or a floor plan drawn from shapes.

  • A view_box with no base_svg is a blank canvas; base_svg.source: none says the same thing and needs a view_box too.
  • With no blueprint there are no automatic anchors: place overlays by [x, y] or by your own anchors.
yaml
type: custom:lcards-msd-card
grid_options:
  columns: full
  rows: 4
msd:
  view_box: [0, 0, 800, 300]
  overlays:
    - id: deck
      type: shape
      kind: rect
      position: [40, 40]
      size: [720, 220]
      corner_style: round
      corner_radius: 24
      style:
        color: var(--lcars-orange)
        width: 3
        fill: alpha(var(--lcars-orange), 0.1)
    - id: lights-ctl
      type: control
      position: [400, 150]
      size: [260, 80]
      card:
        type: custom:lcards-button
        preset: lozenge
        entity: input_boolean.lcards_test_lights
        text:
          name:
            content: DECK LIGHTS
            show: true

anchors ​

Your own named points on the drawing, for placing controls and for the ends of lines. A control's position, a line's anchor or attach_to, and a shape's position or points can all name an anchor instead of giving [x, y].

  • Each anchor is [x, y] in the drawing's units. Either value may be a percentage of the view box instead ("40%"), measured from its top-left corner.
  • An anchor you name here wins over an automatic anchor of the same name, so you can move a blueprint's marker without editing the file.
  • In the MSD Studio, the Anchors tab adds anchors with Add Anchor or by clicking Place on Canvas.
yaml
type: custom:lcards-msd-card
grid_options:
  columns: full
  rows: 4
msd:
  view_box: [0, 0, 800, 300]
  anchors:
    port: [150, 120]
    starboard: ["80%", "40%"]
    relay: ["50%", "85%"]
  overlays:
    # controls centred on two anchors
    - id: port-ctl
      type: control
      position: port
      size: [200, 70]
      card:
        type: custom:lcards-button
        preset: lozenge
        entity: input_boolean.lcards_test_lights
        text:
          name:
            content: PORT
            show: true
    - id: starboard-ctl
      type: control
      position: starboard
      size: [200, 70]
      card:
        type: custom:lcards-button
        preset: lozenge
        entity: input_boolean.lcards_test_doors
        text:
          name:
            content: STARBOARD
            show: true
    # lines from each control to the relay anchor
    - id: port-line
      type: line
      anchor: port-ctl
      attach_to: relay
      route: auto
      corner_style: round
    - id: starboard-line
      type: line
      anchor: starboard-ctl
      attach_to: relay
      route: auto
      corner_style: round
KeyTypeDefaultDescription
anchors.<name>[x, y]-A named point in the drawing's units. Each value may be a percentage of the view box, as "40%"

Automatic anchors ​

A blueprint gives you anchors of its own, so lines can attach to it before you place any: its named markers, and landmarks worked out from its outline. Both are on by default.

  • Landmarks (harvest_landmarks) come from the blueprint's silhouette: hull_center (its middle), extremity_bow and extremity_stern (the right-most and left-most points), extremity_top and extremity_bottom, and on a twin-hulled shape such as a ship with nacelles, lateral_a and lateral_b (the tips of the two hulls).
  • Markers (harvest_svg_elements): every <circle>, <ellipse>, <text> and <rect> in the SVG with an id is an anchor of that name (a rectangle by its centre). The built-in ncc-1701-a-blue has br, wc and sb this way.
  • When names collide, your anchors win over markers, and markers over landmarks.
yaml
type: custom:lcards-msd-card
msd:
  base_svg:
    source: builtin:ncc-1701-a-blue
  overlays:
    - id: top-ctl
      type: control
      attachment: top-left
      position: [60, 60]
      size: [360, 100]
      card:
        type: custom:lcards-button
        entity: input_boolean.lcards_test_lights
        preset: lozenge
        text:
          name:
            content: TOP
            show: true
            font_size: 30
    - id: centre-ctl
      type: control
      attachment: top-left
      position: [60, 1040]
      size: [360, 100]
      card:
        type: custom:lcards-button
        entity: input_boolean.lcards_test_toggle
        preset: lozenge
        text:
          name:
            content: CENTRE
            show: true
            font_size: 30
    # a landmark from the outline, and one from the middle of the ship
    - id: top-line
      type: line
      anchor: top-ctl
      attach_to: extremity_top
      route: auto
    - id: centre-line
      type: line
      anchor: centre-ctl
      attach_to: hull_center
      route: auto
More about automatic anchors
  • Facing: extremity_bow is the right-most point, so it is the bow only on a blueprint that faces right.
  • Landmarks that share a spot: a landmark that lands on the same place as one before it is left out. On a ship whose nacelles reach furthest, lateral_a and lateral_b take that spot and extremity_bow or extremity_stern may not exist.
  • Ids from a drawing program: marker names come from the SVG as exported, so they can be numbered (g293) rather than meaningful. Ids that start with __ or msd-internal- are skipped.
  • In the MSD Studio: the Anchors tab lists both kinds read-only, as Base SVG: Computed (landmarks) and Base SVG: Harvested (markers), with a search box. Promote to User Anchor opens the Add Anchor form at that point, so you can give a g293 a proper name under anchors; Promote All does it for every entry the search matches.
  • Turning them off: set harvest_landmarks: false or harvest_svg_elements: false to drop either kind, for example a long list of numbered markers. Turning landmarks off also saves the work of reading the outline when the card loads.
KeyTypeDefaultDescription
base_svg.harvest_landmarksbooleantrueLandmarks from the blueprint's outline: hull_center, extremity_bow, extremity_stern, extremity_top, extremity_bottom, lateral_a, lateral_b
base_svg.harvest_svg_elementsbooleantrueThe blueprint's named <circle>, <ellipse>, <text> and <rect> elements, by their id

background_animation ​

An animated canvas behind the drawing: a starfield, a grid, a nebula, or a still image. It is the same background the button and elbow cards use, with every preset of Background Animations.

  • It draws behind the blueprint and every overlay, whatever their z_index.
  • To use a picture instead of a blueprint, set base_svg.render_visual: false and add the image preset: the blueprint's anchors and view box still apply, so you can keep its markers or place your own anchors on the picture.
  • In the MSD Studio it is the Base SVG tab's Background Effects section; the Studio's preview doesn't draw it.
yaml
type: custom:lcards-msd-card
grid_options:
  columns: full
  rows: 5
msd:
  base_svg:
    source: builtin:ncc-1701-a-blue
  view_box: [180, 270, 1600, 720]
  # stars drifting behind the ship
  background_animation:
    - preset: starfield
      config:
        count: 200
KeyTypeDefaultDescription
background_animationlist / object-A list of effects (preset and config), or inset and effects: see Background Animations

Released under the MIT License. | About