Repository navigation
ha-remote: five Home Assistant toggles with an Android companion - #31
Merged
Merged
Conversation
|
@krtkygpta Could you please upload the APK or those who can't build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
apps/ha-remote— a watch app that shows up to five Home Assistant controls (lights or light groups) as tappable rows with stock-style toggle switches, grouped into sections named from the phone. Tapping a row sends a compact toggle request over the app channel (channel key K); the Android companion is the only Home Assistant client: it runs the command and sends the authoritative state back, so rows reflect reality — including changes made from other controllers (5 s polling on the phone).Three surfaces:
app_features!(PAGE)) — the same screen next to the face; rows toggle right there.app_features!(WIDGET)) — the favorite control's name and state; the stock card is text-only, so a tap opens the app and toggling happens there or on the page.Protocol
ASCII
H1frames, 128 B max, five slots, 15-byte UTF-8 names, 10-byte section titles.H1?hello/config request,H1T seq slot targettoggle request,H1W resultwidget-capability probe.H1C/H1Gconfig (enabled slots, names, sections, favorite),H1A seqack,H1S slot on resultauthoritative state,H1P10 s heartbeat,H1E seq codegeneric errors.Entity IDs, Home Assistant URLs and tokens never leave the phone; the channel carries names, indexes, states and generic error codes only. The watch persists a
D2blob (names, sections, last states) in its own storage as a display fallback. Full contract:ANDROID_COMPANION.md.Companion app (separate repo, not part of this PR)
krtkygpta/ha-remote hosts the Android companion (Material 3, a foreground service keeps the BLE link and the HA connection alive, background state sync) and mirrors this watch app under the same
apps/ha-remote/layout, with PC install instructions. It connects to the already-bonded watch with a second GATT client while Nothing X stays connected (no second pairing, no bind handshake), reads K over the shell service, and speaks the sameH1protocol.Requirements
Also in
store.md: the FMC patched firmware/App Loader with channel key K (2026-11-13 or newer); the page and widget surfaces need a loader from 2026-11-15 or newer and stub v4+.About the second commit
store: pass the SDK remap path as TOML-safe POSIX on Windows—scripts/store buildpasses the SDK path inside acargo --configTOML value; on Windows, native backslashes in that quoted value are parsed as escapes and every build fails..as_posix()is byte-identical behavior on Linux/macOS. Happy to split it into its own PR if you prefer to keep this one app-only.Testing
cargo test -p ha-remote); clean release build against the pinned SDK (4a5b025);scripts/store check ha-remotepasses.(Screenshot taken during development; the current build hides unconfigured rows and shows per-name icons.)