Skip to content

Fix Apollo Firmware Version sensor showing unknown#26

Merged
bharvey88 merged 2 commits intobetafrom
fix/firmware-version-sensor
Mar 7, 2026
Merged

Fix Apollo Firmware Version sensor showing unknown#26
bharvey88 merged 2 commits intobetafrom
fix/firmware-version-sensor

Conversation

@bharvey88
Copy link
Copy Markdown
Contributor

@bharvey88 bharvey88 commented Mar 6, 2026

What does this implement/fix?

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.

Same fix as ApolloAutomation/AIR-1#87

Types of changes

  • Bugfix (fixed change that fixes an issue)

Checklist / Checklijst:

  • The code change has been tested and works locally

Summary by CodeRabbit

  • Refactor
    • Enhanced firmware version sensor responsiveness in ESPHome integration by refactoring how version changes are communicated and detected across system states.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 6, 2026

Warning

Rate limit exceeded

@bharvey88 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 34 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 638aaeeb-547d-4529-aba3-bd947fc13961

📥 Commits

Reviewing files that changed from the base of the PR and between 34d01c4 and 3b8789a.

📒 Files selected for processing (1)
  • Integrations/ESPHome/Core.yaml

Walkthrough

This pull request modifies the ESPHome configuration to change how the apollo_firmware_version sensor is updated. Instead of using component update calls, the firmware version is now published via text_sensor.template.publish events in API actions, boot scripts, and status reporting. The update_interval constraint is also removed from the sensor definition.

Changes

Cohort / File(s) Summary
ESPHome Firmware Version Sensor
Integrations/ESPHome/Core.yaml
Replaced component.update: apollo_firmware_version with text_sensor.template.publish calls in API actions and boot scripts; removed update_interval: never from text_sensor definition.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

Suggested reviewers

  • TrevorSchirmer

Poem

🐰 The firmware hops in a brand new way,
No more component.update delays,
With template.publish, so swift and light,
The version sensors bounce just right!
Update_interval? Gone without a trace,
Let the text_sensor publish with grace!

🚥 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 and accurately summarizes the main change: fixing the Apollo Firmware Version sensor that was showing unknown values in Home Assistant.
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/firmware-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.

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 component.update from on_client_connected and reportAllValues.
@bharvey88
Copy link
Copy Markdown
Contributor Author

confirmed working with sleep as well!

@bharvey88 bharvey88 merged commit b74b943 into beta Mar 7, 2026
8 checks passed
@bharvey88 bharvey88 deleted the fix/firmware-version-sensor branch March 7, 2026 16:07
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