A Flutter dashboard that connects to Home Assistant over its WebSocket API and shows live entity states, grouped by domain, with basic controls (lights/switches/fans, locks, covers, climate). Built for a portrait wall-mounted panel (Raspberry Pi + 12.3" 720x1920 DSI screen, driven by flutter-pi).
lib/src/ha_client/— the WebSocket protocol client (ha_websocket_client.dart): auth handshake,get_states,subscribe_events,call_service, all correlated by message id.ha_credentials_store.dartpersists the base URL and long-lived access token as a plain JSON file (see note below on why notflutter_secure_storage).lib/src/providers/— Riverpod providers wiring the client into the UI:entitiesProviderconnects, does the initialget_states, then keeps a liveMap<entityId, HaEntity>updated from thestate_changedsubscription.lib/src/features/onboarding/— first-run screen to enter the HA URL and a long-lived access token (generate one from your HA user profile page).lib/src/features/dashboard/— the entity grid, grouped by domain, with per-domain card widgets.
flutter run -d macos # or chrome, linux, etc — anything you have set up
You'll need a Home Assistant long-lived access token: HA → your profile → scroll to "Long-Lived Access Tokens" → Create Token.
flutter-pi renders straight to the framebuffer via DRM/KMS — no X11/Wayland
desktop required, which suits a dedicated kiosk panel. It does not use
Flutter's official linux/ desktop embedder (the linux/ folder in this
repo is just the standard flutter create output, harmless to keep for
desktop testing but unused on the Pi).
High-level steps (see the flutter-pi README for full detail, since exact steps vary by Pi model/OS image):
- On the Pi: build/install
flutter-piitself (a small C project; the flutter-pi repo has Raspberry Pi build instructions). - Build the app bundle for arm/arm64 using
flutterpi_tool(maintained by the flutter-pi author, and the recommended way to produce a build that matches flutter-pi's engine):dart pub global activate flutterpi_tool flutterpi_tool build --arch=arm64 --cpu=pi4 # adjust flags for your Pi model - Copy the resulting
build/flutter_assetsbundle to the Pi and run it:flutter-pi --release /path/to/flutter_assets - For kiosk boot, run flutter-pi from a systemd unit / autologin shell profile rather than a desktop session.
Cross-compiling for arm64 Linux isn't supported from a macOS host, so step 2 generally needs to run either on the Pi itself or on a Linux build machine/CI.
The secure-storage Linux backend depends on a D-Bus secret-service daemon
(gnome-keyring, kwallet, ...), which a headless Raspberry Pi OS Lite kiosk
image typically doesn't run, and it has no web implementation at all. Since
this is meant to be a single-user, physically-secured wall panel — and is
also previewed in a browser during development — HaCredentialsStore just
uses plain shared_preferences, which has a working implementation on every
target this app runs on.