Skip to content

Melodious 2.0

Choose a tag to compare

@schlambos schlambos released this 08 Nov 21:39

What's new since 1.3

41 commits, 114 files changed, 3 external contributors.

Remote pairing

Pair Harmony remotes (Smart Control, Companion, Elite) to the hub without the cloud. (#77, #78, #81)

  • Settings → Remotes: open an RF pairing window, pair a remote, see the outcome.
  • Each paired remote gets its own section with activity buttons and per-activity key maps.
  • Keys stay alike across all paired remotes by default. Edits write every remote's map in one save. Per-remote overrides are supported — a key set for one remote only stays that way.
  • Companion remotes now work: the hub resolves each remote's EquadID to its own maps, so presses on a Companion (16422/16423) hit the right map instead of the Smart Control's. Saving an activity that has no Companion map creates one automatically. (#81)
  • No remote model names in on-screen text. The pairing step names the proven model (Smart Control: Menu + Mute); everything else says "this remote" / "the other remote".

Android TV and Google TV network control

Pair with and control Android TV / Google TV sets over the network. (#101, #106)

  • Android TV Remote v2 protocol: TLS with pinned certs, polo pairing on port 6467.
  • Power on/off from standby, D-pad, volume, inputs, digits, colour keys — all over the network.
  • A network TV is an ordinary hub device: put it in activities, assign remote buttons, set power order.
  • Device list shows a Network badge. Learn-a-button and IR import are hidden for network devices. Delete goes through CommitAndroidTvDevices and forgets the pairing.
  • Live connection/power/volume status on device and remote screens.

Implementation credit to @apnar (#99). Rebased onto main with conflict resolution in the web shell and build script. (#106 restored device-list hooks and the build step lost in the rebase.)

Two-way Home Assistant integration

The hub and Home Assistant now share device state in both directions. (#95, #96, #97, #98, #100, #103, #104, #105)

Hub → Home Assistant (ha-melodious 0.7.1):

  • Mirror selected hub-only devices (IR, Bluetooth, network) into Home Assistant as power switches, input selectors, command buttons, and activity sensors.
  • 5-second cheap poll via /api/state?version=N (304 when unchanged), full fetch only on change.
  • Loop guard: mirrored entities excluded from the HA→hub pickers.

Home Assistant → hub:

  • Spec v2 merged devices: key + entities table, <alias>:<action> command values validated against the table. v1 device sets still accepted; existing device and command IDs preserved on migration. (#96)
  • Volatile /api/ha-state channel: POST /api/ha-state accepts state snapshots (≤64 KiB, ≤64 devices, 1 push/s per IP rate limit). Written to tmpfs, never flash. Integer version counter; GET /api/ha-state?since=<version> for cheap polling. States marked stale after 90 s. (#98)
  • Live state in the web app: power, input/source, app, playing, volume/mute on device and remote screens. Redundant commands dimmed. "State unknown" when stale — never "Off". Fix It hints. (#98)
  • LG theater state: HDMI source, connected ports with signal, ARC sound output with TV-reported volume. Display-only theater_links show observations on linked hub devices (e.g. IR soundbar on ARC). Connection/signal are observations, not inferred power. (#100)
  • Live state in the Android app: same state strip and Fix It hints as the web app. Polls /api/ha-state?since= every 3 s in the foreground. Network TV badge. (#103)
  • Role-based power-on order: new activities save PowerOnOrder by role priority (Display → Volume → Player). Default NextDevicePowerOnDelay by role: Display 2500 ms, Volume 1500 ms, others 1000 ms. User-set values (including 0) are preserved. Existing activities never reordered. (#104)
  • Engine plugin reboot: the installer now reboots when a /pkg plugin changes, since the engine loads them once at start. (#97)
  • RAM memoization of device-set pushes: identical /api/ha-devices bodies skip the flash backup and writer pass. Fixes engine stalls caused by repeated pushes of a refused set. (#102)

Bluetooth

  • Consumer-page keys: Home, Back, Menu, Search, Guide, Info, Settings, Exit — the HID Consumer Control keys needed for Chromecast with Google TV. Uses the existing report ID 3 descriptor; no re-pairing needed. (#89, #93; original draft by @danielvijge)
  • hciconfig/hcitool path resolution: codex_bt_pair_agent now resolves helpers at runtime with access(path, X_OK) instead of hard-coding /usr/bin. Fixes hubs where the helpers are in /usr/sbin. (#92)

Installer

  • Flash space measurement: a static MIPS statfs probe measures free flash before installing. Estimates jffs2 overhead (zlib level 3 per 4 KiB node + margin). Blocks with BLOCKED_CAPACITY if the files won't fit. --skip-flash-check overrides. (#84)
  • Dropbear reuse: when the root tool's dropbearmulti is byte-identical, hard-links it instead of writing a second copy (~320 KB saved). (#84)
  • Root tool leftovers: preflight lists staging folders and the duplicate Dropbear. --remove-root-tool-leftovers cleans them. (#84)
  • Post-install flash warning when less than ~0.65 MB remains. (#84)

Multi-subnet cloud blocker

The cloud blocker now routes all RFC 1918 private ranges, so hubs on a different subnet from the control devices can route traffic back. (#85, by @danielvijge)

Touch and remote editing

  • On-screen buttons shortcut on the running activity card and Remote header. (#94)
  • Hard-key hold-command picker: Custom Hold now has a full command search with device chips, press+hold summary, and scope selector (this remote / all remotes). (#94)
  • New activities get Touch on-screen buttons: number pad (Logitech slot layout) and a Home button from the first member device. Existing activities are never reseeded. (#110)
  • Home key fix: a device command named "Home" maps to the Touch's real Home hard key, not Menu. Menu aliases are menu only. (#110)

Security

  • Recovery portal hardening: control characters stripped in SSID/password writes, SSID 1–32 chars validated, password 8–63 printable ASCII or 64-hex, portal binds only to 192.168.76.1, 5 s client timeouts. (#107)
  • Pinned builds: codex_dhcpd, codex_portal, and Dropbear tarball all built with pinned toolchains and fail-closed SHA-256 checks. (#107)
  • Secret redaction: /export/wifi, /export/mqtt, and /export/bundle redact the Wi-Fi PSK and MQTT password when sign-in is off. Restoring a redacted payload preserves the on-hub secret. (#107)

Documentation

  • README trimmed from 1,094 to 548 lines. Deep details moved to docs/INSTALL.md, docs/HOME_ASSISTANT.md, docs/MELODIOUS_WEB_UI.md, docs/DESKTOP_APP.md, docs/TOUCH_EDITOR.md, and docs/BUILD.md. All screenshots, tables, and section flow preserved. (#108)
  • HA design doc at docs/HA_DEVICES_DESIGN.md. (#95)
  • tools/ha_device_inventory.py: read-only HA WebSocket dumper with redaction. (#95)

Downloads

File What it is
melodious-hub-2.0.0.zip Hub software and installers (Python and PowerShell). Unzip on a computer on the same network as the hub.
melodious-2.0.0.apk Android app, Android 8.0+.
Melodious-2.0.0-arm64.dmg macOS app, Apple silicon (M1+).
Melodious-2.0.0-x64.dmg macOS app, Intel.
Melodious-2.0.0-arm64.zip, Melodious-2.0.0-x64.zip Same macOS apps, zipped.
melodious-update.json Version manifest for app self-updates.
SHA256SUMS.txt SHA-256 checksums for every file above.

The Android app is signed with the Melodious release key (certificate SHA-256 7a766509ca8424065c5f6c7ae4214369862a5a18881ee00e434c9f833e0bd2de), same key as all prior releases.

The macOS app needs macOS 13+. The Android app needs Android 8.0+.

Updating from 1.3

  • Hub: unzip and run the installer again. Configuration, activities, devices, and remote pairings are kept.
  • Android: 2.0.0 installs over 1.3.0 (same signing key).
  • Mac: the app can update itself (Update → Install and Restart), or replace it manually.
  • ha-melodious: update to 0.7.1 in HACS for mirror device support.

Known limits

  • Remote pairing: validated on hardware with Harmony Smart Control and Touch. Companion support is code-complete but hardware-tested only by community reporters. Elite gets the same configuration but has not been tested.
  • Android TV: validated by @apnar on AR9330 hub + Hisense 75U8H Google TV. Other Android/Google TV sets use the same protocol but have not been tested.
  • Assumed state: mirrored IR devices in Home Assistant use assumed_state=True — the hub has no IR feedback, so power/input state is inferred from activity membership.
  • Slow saves: with an activity running, a save can take up to two minutes during engine reload.
  • Trusted network only: plain HTTP, optional sign-in (off by default), no request origin checks, updates not signed.
  • macOS ad-hoc signed: may prompt for Keychain access after self-update.
  • Catalog protocols: Logitech catalog codes import only if the hub already has their IR protocol.

Contributors

Thank you to @danielvijge (multi-subnet cloud blocker, Consumer-page keys draft), @apnar (Android TV network control), and everyone who filed issues and tested.

License

MIT License for Melodious code. Upstream code (Ripthulhu/harmony-hub-control up to d87ceba) is all rights reserved by its authors. Third-party components keep their own licences. See LICENSE.