Skip to content

Add managed firmware update system - #95

Merged
TrevorSchirmer merged 4 commits into
betafrom
add-managed-update-system
Jun 17, 2026
Merged

TrevorSchirmer merged 4 commits into
betafrom
add-managed-update-system

Conversation

@bharvey88

@bharvey88 bharvey88 commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

Ports the managed OTA update system from R_PRO-1 to all MTR-1 variants, so devices can self-update from the GitHub Pages manifests directly in Home Assistant.

Changes

  • update: http_request component (Firmware Update entity in HA) + ota: http_request platform on all three variants, pulling from the existing GitHub Pages manifests
  • safe_mode for boot-loop recovery after a bad flash
  • http_request with verify_ssl: true (esp-idf TLS, same as R_PRO-1)
  • BLE variant is now built and published by CI to its own firmware-ble/ manifest, and MTR-1_BLE.yaml updates from it — without this, a BLE device taking an update would be silently converted to the factory (non-BLE) firmware and lose Bluetooth proxy
  • Manifest check triggered on wifi.on_connect: the update component's first 6-hour poll fires before the network is up and skips silently, leaving the entity stale for ~6h after every boot (R_PRO-1 has this today). The trigger makes the entity accurate within seconds of boot.
  • min_version raised to 2025.11.0 to match the floor R_PRO-1 set when this system landed there

Testing

Tested end to end on a physical MTR-1 (both the factory-path and BLE-path manifests): flash → update offered in HA with release notes → OTA install from Pages → reboot on new version → Bluetooth proxy intact on the BLE variant. Verified across seven consecutive mock releases on a fork.

Note for support: devices need outbound HTTPS (443) to apolloautomation.github.io — isolated IoT VLANs that block egress will show "up to date" forever with ESP_ERR_HTTP_CONNECT in debug logs.

Summary by CodeRabbit

  • New Features

    • Added a BLE firmware variant alongside the factory firmware.
    • Devices now use an HTTP-based firmware update flow that checks for updates automatically on Wi‑Fi connect.
  • Chores

    • Bumped minimum ESPHome requirement to 2025.11.0.
    • CI/release workflow updated to build/publish the additional BLE firmware and adjusted release formatting.

Port the managed firmware update system from R_PRO-1 to all MTR-1
variants:

- Add http_request OTA platform alongside the existing esphome OTA
- Add update component pulling the firmware manifest from GitHub Pages
- Add safe_mode for recovery from failed updates
- Build and publish the BLE variant (firmware-ble) so BLE devices
  update from their own manifest instead of being converted to the
  factory firmware
The http_request update component polls every 6h and the first poll
fires before the network is up, so a freshly booted device would not
see an available update for 6 hours. Trigger a manifest check as soon
as WiFi connects.
@bharvey88 bharvey88 added the new-feature New feature label Jun 11, 2026
@coderabbitai

coderabbitai Bot commented Jun 11, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2b51c48e-3db9-4459-a65a-5148868f4b6c

📥 Commits

Reviewing files that changed from the base of the PR and between 7ea8632 and 99297c7.

📒 Files selected for processing (1)
  • .github/release-drafter.yml

Walkthrough

The PR adds a BLE firmware to the build workflow, bumps ESPHome min_version to 2025.11.0 across device configs, migrates OTA to http_request-based updates with wifi-triggered checks, and updates the release-drafter template.

Changes

ESPHome OTA Migration and BLE Build Integration

Layer / File(s) Summary
BLE Firmware Build Integration
.github/workflows/build.yml
Workflow extends the yaml-files input to include Integrations/ESPHome/MTR-1_BLE.yaml, enabling the BLE variant to be built and published alongside factory firmware.
ESPHome Minimum Version Requirements
Integrations/ESPHome/MTR-1.yaml, Integrations/ESPHome/MTR-1_BLE.yaml, Integrations/ESPHome/MTR-1_Factory.yaml
All three device configurations update esphome.min_version from 2025.8.0 to 2025.11.0.
HTTP Request-Based OTA and WiFi Update Triggers
Integrations/ESPHome/MTR-1.yaml, Integrations/ESPHome/MTR-1_BLE.yaml, Integrations/ESPHome/MTR-1_Factory.yaml
Replace ota: platform: esphome with ota: platform: http_request, add http_request with verify_ssl: true, define update components that use a manifest.json source, add safe_mode, and trigger update checks via wifi.on_connect -> component.update.

Release Drafter

Layer / File(s) Summary
Release template formatting
.github/release-drafter.yml
Add category-template to bold category titles and simplify the "What's Changed" template, removing the full changelog compare link and a promotional line.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • TrevorSchirmer

Poem

🐰 A rabbit hops through configs with glee,
HTTP updates flowing wild and free,
BLE joins the build with a joyful bound,
OTA now checks when Wi‑Fi's found,
Firmware flowers fall without a sound.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add managed firmware update system' accurately reflects the main objective of the PR, which is to add a managed OTA update system across all MTR-1 variants enabling self-updates from GitHub Pages manifests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-managed-update-system

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Home Assistant shows only the first 255 characters of an ESPHome
release summary, so boilerplate is expensive and ## headings render
oversized in the update dialog:

- Render category titles and What's Changed in bold instead of H2
- Drop the star-the-repo footer
- Drop the Full Changelog line: it semver-truncates 4-part versions
  (always links ...X.Y.Z.1) - the shared build workflow now appends
  a correct compare link instead
@bharvey88
bharvey88 force-pushed the add-managed-update-system branch from 41c8325 to 99297c7 Compare June 11, 2026 14:40
@TrevorSchirmer
TrevorSchirmer merged commit ba86738 into beta Jun 17, 2026
11 checks passed
@TrevorSchirmer
TrevorSchirmer deleted the add-managed-update-system branch June 17, 2026 16:08
@coderabbitai coderabbitai Bot mentioned this pull request Aug 18, 2026
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants