Skip to content

Fix Apollo Firmware Version sensor showing unknown - #88

Merged
bharvey88 merged 2 commits into
betafrom
fix-apollo-version-sensor
Mar 6, 2026
Merged

Fix Apollo Firmware Version sensor showing unknown#88
bharvey88 merged 2 commits into
betafrom
fix-apollo-version-sensor

Conversation

@bharvey88

@bharvey88 bharvey88 commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

Version: 26.3.2.1

Adds:

Fixes:

  • Apollo Firmware Version text sensor showing "unknown" in Home Assistant
  • Replaced component.update with text_sensor.template.publish for the version sensor in both on_client_connected and reportAllValues script
  • Removed update_interval: never so the lambda also fires periodically (every 60s) as a fallback

The root cause is that ESPHome's component.update action silently skips execution when the component's is_ready() check fails (see UpdateComponentAction::play() in esphome/core/base_automation.h). The text_sensor.template.publish action calls publish_state() directly without this guard.

Breaks:

Checks:

  • Documentation Updated
  • Build Number Incremented In AIR-1.yaml

Summary by CodeRabbit

  • Refactor
    • Streamlined how the Apollo Firmware Version sensor is updated — some automatic update paths were removed, leaving the sensor as a diagnostic value without those earlier automatic updates.
  • New Features
    • Devices of the AIR-1 type now publish their firmware version on boot so the version is reported when the device starts.

The sensor was showing "unknown" because component.update silently fails
when the component's is_ready() check returns false. Replaced with
text_sensor.template.publish which calls publish_state() directly.

Also removed update_interval: never so the lambda fires every 60s as a
periodic fallback.
@coderabbitai

coderabbitai Bot commented Mar 6, 2026

Copy link
Copy Markdown

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: 85892161-8da2-42b3-a596-c658ec423eb6

📥 Commits

Reviewing files that changed from the base of the PR and between 9b21aee and 9737039.

📒 Files selected for processing (2)
  • Integrations/ESPHome/AIR-1.yaml
  • Integrations/ESPHome/Core.yaml
💤 Files with no reviewable changes (1)
  • Integrations/ESPHome/Core.yaml

Walkthrough

Removed component.update calls and the sensor lambda for the Apollo Firmware Version text sensor in Core.yaml; added an explicit text_sensor.template.publish action on boot in AIR-1.yaml to publish the firmware version.

Changes

Cohort / File(s) Summary
Core — remove automatic updates
Integrations/ESPHome/Core.yaml
Removed - component.update: apollo_firmware_version from api.on_client_connected and from the status/script flow; removed the text sensor lambda that returned "${version}" (sensor remains diagnostic).
AIR-1 — publish on boot
Integrations/ESPHome/AIR-1.yaml
Added text_sensor.template.publish in on_boot to publish apollo_firmware_version with state ${version}. No other control-flow changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • TrevorSchirmer

Poem

🐰 I hopped through YAML, tidy and spry,

Published a version with a blink of an eye,
Removed the old call that would wake with a shove,
Now AIR-1 greets boots with a soft firmware love,
Hooray — small hops, big peace from above.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly references the main issue being fixed (Apollo Firmware Version sensor showing unknown) and accurately reflects the primary change in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-apollo-version-sensor

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.

@github-actions
github-actions Bot requested a review from TrevorSchirmer March 6, 2026 17:59
Per ESPHome dev feedback: the version is a compile-time constant, so
publish it once on_boot rather than using a lambda with periodic updates.
Removed publish from on_client_connected and reportAllValues script.
@bharvey88

Copy link
Copy Markdown
Contributor Author

confirmed working!

@bharvey88
bharvey88 merged commit b5096d4 into beta Mar 6, 2026
11 checks passed
@bharvey88
bharvey88 deleted the fix-apollo-version-sensor branch March 6, 2026 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants