Skip to content

Fix LD2410 thresholds reading 0 after a cold boot - #106

Open
TrevorSchirmer wants to merge 1 commit into
betafrom
fix/ld2410-thresholds-after-boot
Open

TrevorSchirmer wants to merge 1 commit into
betafrom
fix/ld2410-thresholds-after-boot

Conversation

@TrevorSchirmer

Copy link
Copy Markdown
Member

Version: 26.11.15.1

What does this implement/fix?

After a cold boot the LD2410 gate thresholds (and sometimes version/MAC) stayed at 0 until Query Params was pressed.

Cause: every variant turned the radar's Bluetooth off at on_boot priority 900. In ESPHome that restarts the LD2410 and re-reads its settings only about 1 s later. On a cold boot the radar has not answered by then, so the values never fill in.

Changes:

  • Removed the unconditional Bluetooth-off hook from MSR-2.yaml, MSR-2_BLE.yaml and MSR-2_Factory.yaml. The radar is no longer restarted, and its config is no longer rewritten, on every boot.
  • Added a Core.yaml on_boot step at priority -200. It waits 5 s, re-reads the radar (read_all_info()), then turns the radar's Bluetooth off only if the radar reports it on. In that case it re-reads again 5 s after the restart. Bluetooth still ends up off after every boot, as before.
  • Version bumped to 26.11.15.1.

Compiles cleanly on ESPHome stable (2026.10.2) and dev (2026.12.0-dev) for MSR-2, MSR-2_BLE, MSR-2_Factory and both beta-channel variants. Still needs a cold power-cycle check on hardware (standard and BLE variants).

Fixes #97

Types of changes

  • Bugfix (fixed change that fixes an issue)
  • New feature (thanks!)
  • Breaking change (repair/feature that breaks existing functionality)
  • Dependency Update - Does not publish
  • Other - Does not publish
  • Website of github readme file update - Does not publish
  • Github workflows - Does not publish

Checklist / Checklijst:

  • The code change has been tested and works locally
  • The code change has not yet been tested

If user-visible functionality or configuration variables are added/modified:

  • Added/updated documentation for the web page

Each variant turned the radar's Bluetooth off at on_boot priority 900.
ESPHome's set_bluetooth() restarts the LD2410 and re-reads its settings
about 1 s later, before the freshly restarted radar answers, so the gate
thresholds stayed at 0 after a cold boot until Query Params was pressed.

Drop the unconditional Bluetooth-off from MSR-2, MSR-2_BLE and
MSR-2_Factory. Core.yaml now waits 5 s, re-reads the radar, turns its
Bluetooth off only when the radar reports it on, and re-reads again
after that restart.

Fixes #97
@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 57 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bfc1c793-e456-4540-a604-4070302aab66
Commits

Reviewing files that changed from the base of the PR and between 886f08b and 8ac38a5.

Files selected for processing: 4

  • Integrations/ESPHome/Core.yaml
  • Integrations/ESPHome/MSR-2.yaml
  • Integrations/ESPHome/MSR-2_BLE.yaml
  • Integrations/ESPHome/MSR-2_Factory.yaml
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

This branch has not been deployed

No deployments
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.

3 participants