Skip to content

docs(automations): dedup drone_detected against drone_conflict/nearby - #62

Merged
ifnull merged 2 commits into
mainfrom
docs/drone-detected-dedup-condition
Aug 30, 2026
Merged

ifnull merged 2 commits into
mainfrom
docs/drone-detected-dedup-condition

Conversation

@ifnull

@ifnull ifnull commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to a real-world report: drone_detected (example #4) was firing on the same poll as drone_conflict (example #5) for essentially every close-in drone — read as a duplicate push.

Root cause, not a bug: tracker.tick() runs _evaluate_alerts() before _publish_summary() (tracker.py:220-222), so binary_sensor.airspace_alert_drone_conflict/_nearby are already updated in HA by the time sensor.airspace_nearest_drone's track_id-change trigger fires on the same tick. Combined with geometry — a drone flying near the operator's own watchpoint typically satisfies drone_conflict's/drone_nearby's proximity+altitude thresholds the moment it gets its first position fix — the two automations trip together on essentially every close-in detection.

Adds a condition to drone_detected so it only fires for drones NOT already covered by drone_conflict/drone_nearby (farther out or higher up), leaving those two to own the close-in case with their richer alert semantics.

Docs-only change.

Test plan

  • File is a reference/example doc, not parsed by CI — reviewed by hand for YAML validity and consistency with the existing note style.

ifnull and others added 2 commits August 30, 2026 18:41
Reported: drone_detected was firing on the same poll as drone_conflict
for essentially every close-in drone. Root cause is ordering + geometry,
not a bug: tracker.tick() runs _evaluate_alerts() before
_publish_summary(), so the alert binary_sensors are already updated in
HA by the time nearest_drone's track_id-change trigger fires on the
same tick — and a drone flying near the operator's own watchpoint
typically satisfies drone_conflict's/drone_nearby's proximity+altitude
thresholds the moment it gets its first position fix. Add a condition
so drone_detected only fires for drones NOT already covered by
drone_conflict/drone_nearby, leaving those to own the close-in case.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Rebased onto main after #63 released 1.1.1. This PR originally claimed 1.1.1;
that slot is now a released tag, so the docs fix moves to 1.1.2.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ifnull
ifnull force-pushed the docs/drone-detected-dedup-condition branch from e83b16f to 3aa789f Compare August 30, 2026 23:42
@ifnull
ifnull merged commit 29a2177 into main Aug 30, 2026
3 checks passed
@ifnull
ifnull deleted the docs/drone-detected-dedup-condition branch August 30, 2026 23:49
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.

1 participant