Skip to content

HA Actions ​

Control LCARdS from automations, scripts, voice assistants, and Developer Tools

LCARdS registers a set of HA actions under the lcards domain. Once the integration is installed they appear automatically in:

  • Automations & Scripts: action: blocks in YAML or the visual editor
  • Voice assistants that call HA services
  • Developer Tools → Actions (one-shot testing)
  • The REST / WebSocket API for external integrations

Targeting ​

Several lcards.* actions support targeting specific browsers/devices and/or users. Set any combination of the below fields for supported services. If these options are omitted, then the action is global and every connected browser will pick it up.

FieldTypeDescription
target_device_idslistBrowser device UUIDs (localStorage.lcards_device_id in each tab)
target_device_nameslistDisplay names set in Config Panel → Users & Devices or via ?lcards_device= URL param. Non-unique names match every device sharing that name.
target_user_idslistHA user UUIDs
target_user_nameslistHA user display names (case-insensitive)

See Users & Devices for how device IDs and display names are assigned.


Alert Mode Actions ​

Alert state is stored in input_select.lcards_alert_mode, the single source of truth. All alert actions update that entity, which propagates automatically to the ThemeManager (colour palette), SoundManager (alert sounds), and any lcards-alert-overlay cards on the dashboards.

lcards.set_alert_mode ​

Set any alert mode by name.

FieldTypeRequiredOptions
modeselect✅red_alert, yellow_alert, blue_alert, gray_alert, black_alert, green_alert
yaml
action: lcards.set_alert_mode
data:
  mode: red_alert

Shortcut actions ​

One-shot actions that each set the corresponding alert mode directly. All support targeting; when targeting fields are present only the matched browsers update their local alert state (global input_select.lcards_alert_mode is not written).

ActionEffect
lcards.red_alertActivates red alert
lcards.yellow_alertActivates yellow alert
lcards.blue_alertActivates blue alert
lcards.gray_alertActivates gray alert
lcards.black_alertActivates black alert
lcards.clear_alertReturns to normal (green_alert)
yaml
action: lcards.red_alert

Screen Effect Actions ​

Play or clear layered screen effects on connected browser tabs. Supports targeting.

Effects are applied per slot: backdrop (CSS filters), color (colour overlay), and canvas (animated canvas). Slots are independent: you can update one without touching the others. See Screen Effects for the full preset reference and parameter docs.

lcards.trigger_effect ​

Play one or more layered screen effects.

FieldTypeRequiredNotes
layersobject✅Per-slot effect config: see below
durationnumberAuto-clear all effects after this many ms (100–300000). Omit for a persistent effect that must be cleared manually.
target_device_idslist→ Targeting
target_device_nameslist→ Targeting
target_user_idslist→ Targeting
target_user_nameslist→ Targeting

layers object: each key is a slot name; omit a slot to leave it unchanged, set it to null to clear it. Each slot object requires a preset key plus any preset-specific overrides:

SlotPresetKey params
backdropbluramount (e.g. "8px")
backdropgrayscaleamount (e.g. "100%")
backdropsaturateamount (e.g. "200%")
backdropcontrastamount (e.g. "200%")
backdrophue-rotateangle (e.g. "90deg")
colorcolor-tintcolor (e.g. "rgba(200,0,0,0.35)")
colorvignetteopacity (e.g. 0.7)
canvasstaticopacity, scale
canvaspixelateopacity, pixelSize
canvasglitchopacity, intensity
canvasscanlinesopacity

See Screen Effects for full parameter details.

yaml
# Red-tinted blur - persistent until cleared
action: lcards.trigger_effect
data:
  layers:
    backdrop:
      preset: blur
      amount: "12px"
    color:
      preset: color-tint
      color: "rgba(180,0,0,0.35)"
yaml
# TV static for 5 seconds, then auto-clear
action: lcards.trigger_effect
data:
  duration: 5000
  layers:
    canvas:
      preset: static
      opacity: 0.4
yaml
# Target one device, all three slots
action: lcards.trigger_effect
data:
  target_device_names:
    - Kitchen Tablet
  layers:
    backdrop:
      preset: grayscale
      amount: "80%"
    color:
      preset: vignette
      opacity: 0.5
    canvas:
      preset: scanlines
      opacity: 0.3

lcards.clear_effect ​

Clear one or all active screen effects. Supports targeting.

FieldTypeRequiredNotes
slotselectWhich slot to clear: backdrop, canvas, or color. Omit to clear all slots.
target_device_idslist→ Targeting
target_device_nameslist→ Targeting
target_user_idslist→ Targeting
target_user_nameslist→ Targeting
yaml
# Clear all active effects on all browsers
action: lcards.clear_effect
yaml
# Clear only the backdrop slot
action: lcards.clear_effect
data:
  slot: backdrop
yaml
# Clear everything on a specific device
action: lcards.clear_effect
data:
  target_device_names:
    - Kitchen Tablet

Sound Actions ​

Play a sound effect on connected browser tabs, without touching alert mode, theme, or any screen effect. Useful for subtle audio cues from automations (e.g. a soft chime when a kiosk tablet wakes). Supports targeting.

Sound playback always respects the target device's master Sound Effects Enabled toggle (input_boolean.lcards_sound_enabled); if the user has muted sounds, play_sound stays silent too. It does not check the cards / ui / alerts category toggles, since an automation-triggered sound isn't tied to any of those categories.

See Sound Configuration for the full event list, schemes, and per-user/per-device overrides.

lcards.play_sound ​

Provide either event_type or asset_key, not both. If both are given, asset_key wins.

FieldTypeRequiredNotes
event_typeselectPlays whatever sound is currently configured for that UI event on the target device; respects its per-event override and active sound scheme. One of the 26 event keys listed in Sound Configuration.
asset_keystringPlays one exact sound file (e.g. lcards_default_system_ready), bypassing the target's scheme/overrides entirely. Find valid keys via the Config Panel Sound tab or window.lcards.core.assetManager.getRegistry('audio').list() in the browser console.
target_device_idslist→ Targeting
target_device_nameslist→ Targeting
target_user_idslist→ Targeting
target_user_nameslist→ Targeting
yaml
# Play the user's configured "notification" sound on all browsers
action: lcards.play_sound
data:
  event_type: notification
yaml
# Subtle wake chime on one kiosk tablet, alongside the screen-wake call
action: lcards.play_sound
data:
  event_type: notification
  target_device_names:
    - Kitchen Tablet
yaml
# Play one exact sound file regardless of the device's active scheme
action: lcards.play_sound
data:
  asset_key: lcards_default_system_ready
  target_device_names:
    - Kitchen Tablet

Portal Overlay Actions ​

Display or clear a custom HA card over the full-screen portal on connected browser tabs. Supports targeting.

Cards are mounted in the 'ha-service' portal slot, which is independent of the Alert and Connection overlay slots; they do not interfere with each other.

For more advanced use-cases, you can refer to using browser_mod integration page.

lcards.show_portal_card ​

Displays a card or message in the portal overlay.

FieldTypeRequiredNotes
contentobject✅Any HA card config (type: custom:lcards-button, type: entities, etc.)
layersobjectSEM effect layers: same shape as lcards.trigger_effect
positionselectContent anchor. Default: center. Options: center, top, top-left, top-right, bottom, bottom-left, bottom-right, left, right
widthstringCSS width for the content container, e.g. '400px'
heightstringCSS height for the content container
durationnumberAuto-dismiss after this many milliseconds (100–300000)
dismissbooleanWhether clicking the backdrop dismisses the overlay
target_device_idslist→ Targeting
target_device_nameslist→ Targeting
target_user_idslist→ Targeting
target_user_nameslist→ Targeting
yaml
action: lcards.show_portal_card
data:
  content:
    type: custom:lcards-button
    entity: light.bridge
  position: center
  width: "360px"
  duration: 10000
  dismiss: true
  layers:
    backdrop:
      preset: blur
      amount: "8px"
    color:
      preset: color-tint
      color: "rgba(0,0,0,0.5)"
yaml
# Target a specific device
action: lcards.show_portal_card
data:
  content:
    type: markdown
    content: "# Alert!\nDoor opened."
  target_device_names:
    - Kitchen Tablet

lcards.clear_portal_card ​

Hides the portal card shown by show_portal_card. Only clears the 'ha-service' slot; alert and connection overlays are unaffected. Supports targeting.

FieldTypeRequiredNotes
target_device_idslist→ Targeting
target_device_nameslist→ Targeting
target_user_idslist→ Targeting
target_user_nameslist→ Targeting
yaml
action: lcards.clear_portal_card
yaml
# Clear on a specific device only
action: lcards.clear_portal_card
data:
  target_device_names:
    - Kitchen Tablet

Borg Assimilation Actions ​

Trigger and clear the Borg Assimilation mode from automations. Both actions support targeting.

To clear, you can call lcards.borg_deassimilate or simply relaod the page - this does not persist across reloads.

lcards.borg_assimilate ​

Trigger the Borg assimilation on one or all connected browsers.

FieldRequiredDefaultDescription
intro_durationNo-Auto-dismiss the intro after this many ms (1000–60000). Omit for click-to-dismiss.
site_countNo8Number of injection sites on screen (1–20)
tendrils_per_siteNo5Bézier tendrils per injection site (1–24)
tendril_lengthNo600Maximum tendril reach in pixels (100–1200)
particle_countNo2Nano-probe particles per tendril (0–6); 0 disables particles
transition_styleNoblur_fadePalette transition: blur_fade, flash, fade_only, off
font_swapNotrueSet to false to skip the Borg font injection; all other effects (palette, canvas intro, persistent layers) still run.
suppress_persistentNofalseSuppress all persistent effects after intro. Ignored if persistent_layers is also set.
intro_layersNo-Advanced. Full per-slot layers dict. Canvas param keys accept either snake_case or camelCase; both are normalised. Values override the corresponding flat shortcuts.
persistent_layersNo-Advanced. Full per-slot layers dict. Overrides suppress_persistent when set. Pass {} to suppress all.
target_device_idsNo-→ Targeting
target_device_namesNo-→ Targeting
target_user_idsNo-→ Targeting
target_user_namesNo-→ Targeting
yaml
# Broadcast - click-to-dismiss
action: lcards.borg_assimilate
yaml
# Auto-dismiss after 12 seconds
action: lcards.borg_assimilate
data:
  intro_duration: 12000
  transition_style: fade_only
yaml
# More injection sites, denser tendrils, longer reach
action: lcards.borg_assimilate
data:
  site_count: 12
  tendrils_per_site: 14
  tendril_length: 900
  particle_count: 3
yaml
# Custom intro with extra blur backdrop
action: lcards.borg_assimilate
data:
  intro_duration: 10000
  site_count: 12
  intro_layers:
    backdrop:
      preset: blur
      amount: "6px"
yaml
# Suppress all persistent effects - palette + font only
action: lcards.borg_assimilate
data:
  suppress_persistent: true
yaml
# Keep the existing font - palette + canvas intro still run
action: lcards.borg_assimilate
data:
  font_swap: false
yaml
# Target a specific device
action: lcards.borg_assimilate
data:
  intro_duration: 10000
  target_device_names:
    - Living Room TV

lcards.borg_deassimilate ​

Reverse the Borg assimilation and restore all browsers to normal.

FieldRequiredDefaultDescription
with_outroNotruePlay outro layers before reverting. false = immediate silent revert.
outro_layersNo-Layers dict for the outro. Longest duration param determines wait time. Omit for defaults (glitch on canvas, 1200 ms).
revert_transition_styleNofade_onlyPalette transition back to normal: flash, fade_only, blur_fade, off
target_device_idsNo-→ Targeting
target_device_namesNo-→ Targeting
target_user_idsNo-→ Targeting
target_user_namesNo-→ Targeting
yaml
# Broadcast - default glitch outro
action: lcards.borg_deassimilate
yaml
# Immediate silent revert
action: lcards.borg_deassimilate
data:
  with_outro: false
yaml
# Custom outro
action: lcards.borg_deassimilate
data:
  outro_layers:
    canvas:
      preset: glitch
      duration: 800
      intensity: 0.6
  revert_transition_style: fade_only

Frontend Control Actions ​

These actions can be helpful for troubleshooting, or just clean loading front-end. Both support targeting.

lcards.reload ​

Forces the matching browser tabs to reload (window.location.reload()). Useful after pushing new assets or changing configuration.

FieldTypeRequiredNotes
target_device_idslist→ Targeting
target_device_nameslist→ Targeting
target_user_idslist→ Targeting
target_user_nameslist→ Targeting
yaml
# Broadcast - reload all tabs
action: lcards.reload
yaml
# Reload a single device
action: lcards.reload
data:
  target_device_names:
    - Kitchen Tablet

WARNING

This immediately reloads the matched browser tabs. Use with care if users are actively interacting with dashboards.

lcards.set_log_level ​

Changes the JS frontend log level at runtime across matched tabs and updates the Python logger hierarchy simultaneously. Verbose output appears in the browser console immediately, no HA restart or page reload required. Supports targeting.

FieldTypeRequiredOptions
levelselect✅off, error, warn, info, debug, trace
target_device_idslist→ Targeting
target_device_nameslist→ Targeting
target_user_idslist→ Targeting
target_user_nameslist→ Targeting
yaml
action: lcards.set_log_level
data:
  level: debug

Automation Examples ​

Red alert on motion ​

yaml
alias: Red alert on motion
trigger:
  - platform: state
    entity_id: binary_sensor.hallway_motion
    to: "on"
action:
  - action: lcards.red_alert

Cycle through alert modes on a button press ​

yaml
alias: Demo alert cycle
trigger:
  - platform: state
    entity_id: input_button.demo_alert
action:
  - action: lcards.set_alert_mode
    data:
      mode: "{{ states('input_select.demo_alert_cycle') }}"

Enable debug logging when a dev mode flag is set ​

yaml
alias: LCARdS debug on dev mode
trigger:
  - platform: state
    entity_id: input_boolean.lcards_dev_mode
action:
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.lcards_dev_mode
            state: "on"
        sequence:
          - action: lcards.set_log_level
            data:
              level: debug
      - conditions:
          - condition: state
            entity_id: input_boolean.lcards_dev_mode
            state: "off"
        sequence:
          - action: lcards.set_log_level
            data:
              level: warn

Subtle chime when a kiosk tablet wakes ​

yaml
alias: Tablet wake chime
trigger:
  - platform: state
    entity_id: binary_sensor.hallway_motion
    to: "on"
action:
  - action: rest_command.fully_kiosk_wake_screen  # your existing wake call
  - action: lcards.play_sound
    data:
      event_type: notification
      target_device_names:
        - Kitchen Tablet

Borg mode: assimilate all browsers, auto-revert after 30 minutes ​

yaml
automation:
  - alias: "Borg Mode"
    trigger:
      - platform: time
        at: "20:00:00"
    action:
      - action: lcards.borg_assimilate
        data:
          intro_duration: 10000
      - delay:
          minutes: 30
      - action: lcards.borg_deassimilate

  • Borg Assimilation: full console API, layer params, and sequence documentation
  • Screen Effects: full preset reference for layers params used by trigger_effect, show_portal_card, and the borg actions
  • Sound Configuration: event list, schemes, and per-user/per-device overrides used by play_sound
  • Users & Devices: how device IDs and display names are assigned
  • Alert Mode Lab: interactive alert mode configuration