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

Using LCARdS with browser_mod ​

LCARdS and browser_mod work side by side: LCARdS draws full-screen alerts, effects and colour changes, and browser_mod handles popups, navigation and browser sensors. They don't get in each other's way.

  • A typical pairing: browser_mod shows the popup with the buttons, LCARdS sets the mood behind it.
  • Each tool has its own id for a browser: see Pattern 3.

No dependency

LCARdS works fully without browser_mod installed. Everything here is optional.


Integration Patterns ​

Pattern 1: LCARdS effects alongside a browser_mod popup ​

browser_mod shows the information and the buttons; an LCARdS screen effect darkens and tints the screen behind them.

yaml
actions:
  - action: browser_mod.popup
    data:
      title: Security Alert
      content:
        type: entities
        entities:
          - binary_sensor.front_door
          - binary_sensor.hallway_motion
      right_button: Acknowledge
      right_button_action:
        action: browser_mod.close_popup
  - action: lcards.trigger_effect
    data:
      duration: 10000
      layers:
        backdrop:
          preset: blur
          amount: 10px
        color:
          preset: color-tint
          color: alpha(var(--lcars-alert-red), 0.3)
        canvas:
          preset: static
          opacity: 0.25

Pattern 2: Full LCARS alert with browser_mod acknowledgement button ​

LCARdS holds the alert; browser_mod's popup clears it when someone acknowledges.

yaml
actions:
  - action: lcards.red_alert
  - action: browser_mod.popup
    data:
      title: CONDITION RED
      content:
        type: markdown
        content: Motion detected at **Front Entrance**. Acknowledge to clear.
      right_button: Acknowledge & Clear
      right_button_action:
        action: lcards.clear_alert
      left_button: Keep Active
      left_button_close: true
      dismissable: false

Pattern 3: Targeted effect on one device ​

Both tools can act on one browser, each by its own id.

Independent device IDs

The LCARdS device name and browser_mod's BrowserID are separate. To give a tablet the same name in both, open it once with both URL parameters: ?lcards_device=kitchen-tablet&BrowserID=kitchen-tablet.

yaml
actions:
  - action: lcards.trigger_effect
    data:
      duration: 15000
      target_device_names:
        - kitchen-tablet
      layers:
        backdrop:
          preset: blur
          amount: 8px
        color:
          preset: color-tint
          color: alpha(var(--lcars-alert-red), 0.35)
  - action: browser_mod.popup
    data:
      title: Kitchen Timer
      content: Timer expired - check the oven!
      timeout: 15000
    target:
      browser_id:
        - kitchen-tablet

Pattern 4: browser_mod activity sensor gating an LCARdS effect ​

browser_mod's sensors tell you whether a tablet is in use; play the effect only then.

yaml
conditions:
  - condition: state
    entity_id: binary_sensor.kitchen_tablet_browser
    state: "on"
actions:
  - action: lcards.trigger_effect
    data:
      duration: 5000
      target_device_names:
        - kitchen-tablet
      layers:
        canvas:
          preset: glitch
          intensity: 0.5

Pattern 5: Trigger LCARdS effects from browser_mod JavaScript ​

browser_mod can run LCARdS's browser console API directly, with no round trip to the server.

  • window.lcards.screenEffect.play() plays one effect for a while; window.lcards.screenEffect.applySlot() keeps one on a layer until it is cleared. See the console API.
yaml
action: browser_mod.javascript
data:
  code: "window.lcards?.screenEffect?.play('static', { duration: 2000, opacity: 0.4 })"

As a card's tap_action (browser_mod reads service: inside its own browser_mod: block; that is browser_mod's grammar, not a Home Assistant action):

yaml
tap_action:
  action: fire-dom-event
  browser_mod:
    service: browser_mod.javascript
    data:
      code: "window.lcards?.screenEffect?.play('glitch', { duration: 1500 })"

An effect that stays until cleared:

yaml
action: browser_mod.javascript
data:
  code: "window.lcards?.screenEffect?.applySlot('canvas', 'scanlines', { opacity: 0.2 })"

Reference ​

Service quick reference ​

Which action to use for what. The LCARdS ones are on the Home Assistant Actions page.

IntentAction
Red alert everywherelcards.red_alert
Red alert on one devicelcards.red_alert with target_device_names
Screen blur, tint or canvas effectlcards.trigger_effect
Clear screen effectslcards.clear_effect
Clear the alertlcards.clear_alert
A card over the whole screenlcards.show_portal_card
A popup with buttonsbrowser_mod.popup
Navigate a browserbrowser_mod.navigate
A toast notificationbrowser_mod.notification
Reload a browserlcards.reload or browser_mod.refresh
Run JavaScript in a browserbrowser_mod.javascript
Set a browser's Home Assistant themebrowser_mod.set_theme

Capability comparison ​

What each tool can do.

LCARdSbrowser_mod
Full-screen visual overlayYes: backdrop, colour and canvas layersPartly: a dialog, not a screen overlay
Recolouring the whole interfaceYes: alert modes shift every --lcars-* and --lcards-* colourNo
Backdrop filters and canvas animationsYesNo
An alert state that lastsYes: input_select.lcards_alert_modeNo
Popup dialogs with buttonsPartly: an alert overlay card or lcards.show_portal_card can show any cardYes
Browser navigationNoYes
Per-browser sensorsNoYes: path, activity, battery, viewport and more
Screen on and off (Fully Kiosk)NoYes
Per-device and per-user targetingYesYes
Running JavaScript remotelyNoYes: browser_mod.javascript

Released under the MIT License. | About