Skip to content

Fix firmware update entity being stale for 6h after boot - #61

Merged
TrevorSchirmer merged 2 commits into
betafrom
fix-update-first-check
Jul 22, 2026
Merged

Fix firmware update entity being stale for 6h after boot#61
TrevorSchirmer merged 2 commits into
betafrom
fix-update-first-check

Conversation

@bharvey88

Copy link
Copy Markdown
Contributor

The update: http_request component polls the manifest every 6 hours, and its first poll fires during boot before the network is up. When that happens it logs "Network not connected, skipping update check" and silently waits for the next 6-hour tick — so for ~6 hours after every boot/power cycle the Firmware Update entity shows stale information even when an update is published.

This adds a manifest check triggered the moment the network connects, making the entity accurate within seconds of boot. The 6-hour poll remains the steady-state cadence.

Found and verified on physical hardware while porting this update system to MTR-1 (the fix is included in the MTR-1/AIR-1/MSR-1/MSR-2 ports).

Note: TEMP-1B is battery/sleep-oriented — the check adds one small HTTPS fetch per wake while connected.

The http_request update component polls every 6h and the first poll
fires before the network is up, so a freshly booted device does not
see an available update for up to 6 hours. Trigger a manifest check
as soon as the network connects.
@bharvey88 bharvey88 added the bugfix Bug fix label Jun 11, 2026
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@bharvey88, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 58 minutes and 45 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0ed052b4-216c-4c6c-b26c-365f1f5de247

📥 Commits

Reviewing files that changed from the base of the PR and between 1de60a3 and 2cb1cba.

📒 Files selected for processing (3)
  • .github/release-drafter.yml
  • Integrations/ESPHome/TEMP-1.yaml
  • Integrations/ESPHome/TEMP-1B.yaml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-update-first-check

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 fix-update-first-check branch from eb4f520 to 2cb1cba Compare June 11, 2026 14:41
@bharvey88
bharvey88 requested a review from TrevorSchirmer July 1, 2026 16:51
bharvey88 added a commit that referenced this pull request Jul 8, 2026
Same feature as CAST-1 and AIR-1 (ApolloAutomation/AIR-1#107):

- Firmware Channel select (Stable/Beta) sets the OTA manifest URL via a
  new apply_ota_source script keyed by a per-variant variant_slug
  substitution ("", "-b", "2", "-b2"), replacing the per-file
  firmware_update_manifest_url; Firmware Update button force-installs
  and prevents deep sleep for the download duration.
- The four Minimal yamls (the adopted end-user configs) gain the managed
  update system, and their device identity is aligned with the improv
  images since they become the images fielded devices update onto.
- build.yml now serves the Minimal images at firmware*/; the improv
  images move to *-factory/ for the web installer only.
- build-beta.yml publishes beta builds of all four variants to a rolling
  beta pre-release.
- update component id renamed firmware_update -> update_http_request to
  match the other Apollo repos, and wifi on_connect refreshes the update
  entity (same fix as PR #61).

Version: 26.7.8.1

🤖 Generated with [Claude Code](https://claude.com/claude-code)
bharvey88 added a commit that referenced this pull request Jul 8, 2026
Same feature as CAST-1 and AIR-1 (ApolloAutomation/AIR-1#107):

- Firmware Channel select (Stable/Beta) sets the OTA manifest URL via a
  new apply_ota_source script keyed by a per-variant variant_slug
  substitution ("", "-b", "2", "-b2"), replacing the per-file
  firmware_update_manifest_url; Firmware Update button force-installs
  and prevents deep sleep for the download duration.
- The four Minimal yamls (the adopted end-user configs) gain the managed
  update system, and their device identity is aligned with the improv
  images since they become the images fielded devices update onto.
- build.yml now serves the Minimal images at firmware*/; the improv
  images move to *-factory/ for the web installer only.
- build-beta.yml publishes beta builds of all four variants to a rolling
  beta pre-release.
- update component id renamed firmware_update -> update_http_request to
  match the other Apollo repos, and wifi on_connect refreshes the update
  entity (same fix as PR #61).

The BLE variant yamls also gain the managed update system (they
inherit the Firmware Update button and apply_ota_source from Core.yaml,
so they must define update_http_request for CI to pass).

Version: 26.7.8.1

🤖 Generated with [Claude Code](https://claude.com/claude-code)
bharvey88 added a commit that referenced this pull request Jul 8, 2026
Same feature as CAST-1 and AIR-1 (ApolloAutomation/AIR-1#107):

- Firmware Channel select (Stable/Beta) sets the OTA manifest URL via a
  new apply_ota_source script keyed by a per-variant variant_slug
  substitution ("", "-b", "2", "-b2"), replacing the per-file
  firmware_update_manifest_url; Firmware Update button force-installs
  and prevents deep sleep for the download duration.
- The four Minimal yamls (the adopted end-user configs) gain the managed
  update system, and their device identity is aligned with the improv
  images since they become the images fielded devices update onto.
- build.yml now serves the Minimal images at firmware*/; the improv
  images move to *-factory/ for the web installer only.
- build-beta.yml publishes beta builds of all four variants to a rolling
  beta pre-release.
- update component id renamed firmware_update -> update_http_request to
  match the other Apollo repos, and wifi on_connect refreshes the update
  entity (same fix as PR #61).

The BLE variant yamls also gain the managed update system (they
inherit the Firmware Update button and apply_ota_source from Core.yaml,
so they must define update_http_request for CI to pass).

Beta-channel builds compile thin beta-channel/ wrapper yamls so the
Firmware Channel select defaults to Beta on firmware obtained from the
beta channel (fresh flashes only; stored choices still win).

Version: 26.7.8.1

🤖 Generated with [Claude Code](https://claude.com/claude-code)
bharvey88 added a commit that referenced this pull request Jul 8, 2026
Same feature as CAST-1 and AIR-1 (ApolloAutomation/AIR-1#107):

- Firmware Channel select (Stable/Beta) sets the OTA manifest URL via a
  new apply_ota_source script keyed by a per-variant variant_slug
  substitution ("", "-b", "2", "-b2"), replacing the per-file
  firmware_update_manifest_url; Firmware Update button force-installs
  and prevents deep sleep for the download duration.
- The four Minimal yamls (the adopted end-user configs) gain the managed
  update system, and their device identity is aligned with the improv
  images since they become the images fielded devices update onto.
- build.yml now serves the Minimal images at firmware*/; the improv
  images move to *-factory/ for the web installer only.
- build-beta.yml publishes beta builds of all four variants to a rolling
  beta pre-release.
- update component id renamed firmware_update -> update_http_request to
  match the other Apollo repos, and wifi on_connect refreshes the update
  entity (same fix as PR #61).

The BLE variant yamls also gain the managed update system (they
inherit the Firmware Update button and apply_ota_source from Core.yaml,
so they must define update_http_request for CI to pass).

Beta-channel builds compile thin beta-channel/ wrapper yamls so the
Firmware Channel select defaults to Beta on firmware obtained from the
beta channel (fresh flashes only; stored choices still win).

Version: 26.7.8.1

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@TrevorSchirmer
TrevorSchirmer merged commit 4b4189d into beta Jul 22, 2026
38 checks passed
@TrevorSchirmer
TrevorSchirmer deleted the fix-update-first-check branch July 22, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants