Skip to content

About

Terrazzo: Home Assistant dashboards rendered natively with Remote Compose — Android, Wear OS and an in-Home-Assistant wall-panel integration.

Topics

Resources

Stars

12 stars

Watchers

0 watching

Forks

Latest commit

 

History

1,696 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

homeassistant-remotecompose

Kotlin Multiplatform library that converts Home Assistant Lovelace dashboard cards into RemoteCompose documents. Android and iOS app targets are included. The SwiftUI app under ios/ uses the pure Swift/UIKit player from yschimke/rc-players; shared Kotlin data/client layers remain KMP.

Home Assistant integration

Terrazzo Remote Compose brings the same renderer into Home Assistant 2026.11 or newer. It adds a sidebar panel at /terrazzo that shows your Lovelace dashboards, suited to wall panels and tablets, behind Home Assistant's own sign-in. It also adds a Remote Compose card to the card picker, and an MCP server so AI assistants can read your home and propose dashboard edits for you to apply. It is a custom integration, not an app, so it works on Home Assistant OS, Container and Core. Setup, wall-panel options, updates and rollback are in the integration guide.

Open your Home Assistant instance and open a repository in the Marketplace.

Or in Home Assistant, go to Settings → Marketplace → ⋮ → Add from link and enter https://github.com/yschimke/homeassistant-remotecompose.

Rendered previews

Full gallery (every card type, light + dark): gist.github.com/yschimke/09c6fbeb83f71b4de3442a410010ee3f.

HA reference on the left, RemoteCompose on the right.

End-to-end dashboard

A realistic vertical stack — heading + two tiles + entities (with toggles) + glance. Each card is its own .rc document played in its own RemotePreview host; the "dashboard" is a regular Compose Column stacking those players. This mirrors the end-goal app where each Lovelace card becomes an independent, live-updating Glance widget.

theme Home Assistant RemoteCompose
light
dark

tile — light theme

variant Home Assistant RemoteCompose
temperature sensor
light on
light off
lock locked

tile — dark theme

variant Home Assistant RemoteCompose
temperature sensor
light on

other cards (light)

card Home Assistant RemoteCompose
button
entities
glance
markdown

Why this exists

HA's frontend is lit-element web components that read a live hass object and call services. Every public "render a Lovelace card to PNG/other" project runs the real frontend inside a headless Chromium (Puppeteer) — nobody has re-implemented the card set natively. That is the gap this library fills: take a card config + an HA state snapshot and emit a RemoteCompose byte stream that any RC player can render (Android apps, Glance widgets, Wear launcher tiles, ESP32 devices, etc.).

Module layout

Module Target Role
ha-model KMP (Android + JVM + iOS) Dashboard / view / section / card config + HA state snapshot types, kotlinx-serialization.
ha-client KMP (Android + JVM + iOS) Ktor WebSocket client, shared CardGenerator chain, and temporary recorded-card generator; exports TerrazzoKit for Apple hosts using Ktor Darwin.
rc-components Android Tier-1 RemoteHa* composables — RemoteCompose-native cards (RemoteString / RemoteColor / actions).
rc-components-ui Android Tier-2 plain Compose-UI wrappers (HaTile, HaButton, …) embedding the Tier-1 composables via RemotePreview, so apps can drop them into a normal Compose tree without seeing RemoteCompose types.
rc-converter Android CardConverter strategy + one impl per card type. Emits RemoteCompose content.
previews Android @Preview fixtures per card type, rendered by the ee.schimke.composeai.preview plugin for pixel-parity iteration.
demo-app Android Sample app: fetch a real dashboard, render via remote-player-compose.
ios iOS / SwiftUI Dashboard app using RcNativePlayerUIKit, with bundled demo cards, live named bindings, and offline caching.

Using the libraries

ha-model, ha-client, the rc-* rendering modules, rc-converter and room-ui publish to Maven Central as ee.schimke.ha:<module>, pinned together by ee.schimke.ha:ha-bom. What each is for, and what is not published yet, is in docs/architecture/library-publishing.md.

Key library references

Versions live in gradle/libs.versions.toml (remote-compose, remote-material3).

  • androidx.compose.remote:remote-creation-compose — the authoring DSL. Alpha, API shifts between releases.
  • androidx.compose.remote:remote-player-compose — playback inside a Compose app.
  • androidx.wear.compose.remote:remote-material3 — Wear-only mirror of Wear Material3. Not used for phone cards; for phone-sized HA cards we build on core RC primitives + hand-written Material3-flavoured wrappers.
  • ee.schimke.composeai.preview — the Gradle plugin that renders @Preview composables to PNG outside Android Studio. Drives the pixel-parity loop; see the compose-preview skill.

Rendering strategy: why 1-by-1, not automatic

Short answer: automatic conversion isn't feasible from a JVM/Android process. Cards don't expose a shared render IR we can intercept — each is a self-contained LitElement that pulls from hass.states, subscribes to history/statistics via WebSocket, and uses per-type CSS. The only way to "run" them is in a browser.

So the approach is hand-written converters verified against real output:

  1. Fetch a reference screenshot for every card config we care about (use hass-lovelace-screenshotter or a Puppeteer script) — these go under references/<card-type>/<name>.png.
  2. Write a CardConverter and a @Preview fixture with the same config
    • snapshot.
  3. Render with compose-preview show --json — output lands under previews/build/compose-previews/renders/.
  4. Diff against the reference; iterate on the converter until pixel delta is under threshold. A diffimg / resemblejs-style check in CI gates regressions.
  5. Move to the next card type.

Start with tile (scaffolded), then entities / glance / gauge / button — these cover the bulk of real dashboards. picture-elements, map, and the graph cards are hard; iframe and custom cards are explicitly out of scope.

Local setup

One-time bootstrap to wire the repo's .githooks/ (ktfmt pre-commit check) into your clone:

./gradlew installGitHooks

Running the previews

compose-preview doctor             # verifies Java 21 toolchain
compose-preview list               # lists all @Preview entries
compose-preview show --json        # renders and prints PNG paths
compose-preview render --filter tile

Fetching HA config

HaClient (in ha-client) wraps the WebSocket commands the converter needs:

  • lovelace/config → Dashboard (resolved JSON — strategy dashboards are resolved client-side today; we do not).
  • get_states → Map<String, EntityState> for the current snapshot.

Auth is a long-lived access token (HA Profile → Security → create token).

Open questions / TODOs

  • Pin the RemoteCompose alpha once API churn slows. The Render bodies in rc-converter/cards/* are stubbed at the draw-call boundary for this reason.
  • Custom cards (type: custom:…) have no shared schema — each needs a hand-written converter. Start with the HACS top-10 (Mushroom, button-card, mini-graph-card, ApexCharts).
  • Strategy-based dashboards need client-side resolution; not implemented.
  • Theming: HA uses CSS custom properties via --ha-<name>. Remote components read RemoteMaterialTheme.colorScheme; the current HA-role projection covers shared card chrome, while richer HA-specific CSS role mapping remains future work.
  • Hosting: this library is agnostic about where it runs. A HA-side deployment (serves .rc bytes over HTTP) and an Android-side deployment (fetches config + renders locally) are both viable; keep the converter pure so both work.

Desktop downloads

Release tags publish desktop installers to GitHub Releases: Linux x64 (.deb), Windows x64 (.msi), and macOS Intel/Apple Silicon (.dmg). Each installer bundles Java; a separate Java installation is unnecessary. Installers are currently unsigned and macOS builds are not notarized.

Enter your HTTPS Home Assistant URL and choose Sign in with Home Assistant to log in through your browser. The app remembers your sign-in in the OS credential store and refreshes it automatically. Advanced options also accepts a long-lived access token for the current session.

Desktop installer checks run on pull requests and retain their packages as workflow artifacts. The Desktop installers workflow can also build any ref without publishing, or rebuild an existing release by supplying its tag. Manual builds stay build-only unless publish is explicitly selected; automated tagged releases publish all platforms. Release assets include SHA-256 checksums, and their filenames identify the application version and architecture. Installer metadata offsets the semantic major version by one to satisfy macOS packaging requirements while keeping upgrades monotonic.

On Arch Linux, install from the project's pacman repository so pacman -Syu keeps it up to date: see docs/desktop-linux.md.

Local packaging: ./gradlew :app-ui:packageDistributionForCurrentOS. Override the app version with -PdesktopVersion=0.1.0.

The JVM app has a dashboard sidebar, native navigation menus, keyboard shortcuts, and full screen. See desktop workspace behavior and shortcuts.

Web app

For a local authenticated /terrazzo wall-panel URL and Remote Compose Lovelace cards, including Marketplace installation, updates and rollback, see the Home Assistant integration installation guide.

The production Wasm app is deployed by Wasm website to GitHub Pages. Pull requests build the same production distribution and exercise browser flows before deployment. Existing documentation and Android authentication pages remain available alongside the app.

The /demo/ entry (or ?demo=1 on the root Wasm app) opens a generic dashboard with inline design controls, live public demo data when available, and an explicit fake-data fallback. The design-server image also packages this entry for ha.coo.ee/demo; its edge route must be deployed with the image. Live public demo reads, source switching and explicit fake-data fallback follow the demo data-source contract.

Local build: ./gradlew :app-ui:wasmJsBrowserDistribution. Serve app-ui/build/dist/wasmJs/productionExecutable over HTTP on localhost or over HTTPS; opening index.html directly from disk does not work.

Use an HTTPS Home Assistant URL and a long-lived access token from your profile. The browser connects over WSS, authenticates, loads your dashboards, and subscribes to state changes. Tokens remain in memory for the current session. Browser access requires a reachable Home Assistant endpoint with a valid TLS certificate. Supported entity, entities, tile and markdown cards use shared Compose UI; specialized Android card converters are not yet available on Wasm.

Browser checks: python -m pip install playwright==1.62.0, python -m playwright install chromium, then python scripts/test-wasm-browser.py app-ui/build/dist/wasmJs/productionExecutable. Set CHROMIUM_PATH to use an existing Chromium installation.

About

Terrazzo: Home Assistant dashboards rendered natively with Remote Compose — Android, Wear OS and an in-Home-Assistant wall-panel integration.

Topics

Resources

Stars

12 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages