fix(drone): reliable detection notify + self_id, graceful unknown-make#48
Merged
Conversation
The example "drone detected" automation triggered on `numeric_state above: 0`, which fires only on the single 0->1 crossing of the drone count. A second drone arriving while one was already tracked (1->2), or a re-detection before the count fell back to 0, was silently missed — the "doesn't always fire" report. Switch to a state trigger gated on the count increasing, which catches every new drone. The message only rendered FAA make/model and fell back to "Unknown drone" whenever the registry couldn't resolve the serial (off, or a spoof/test serial not in the FAA DOC set) — the "unknown values" report. It now degrades make/model -> UA type -> "Drone" and adds self_id + AGL, so it stays useful without a registry hit. Plumb the Remote ID Self-ID message (`self_id`) through DroneInfo -> parse -> DronePayload so the broadcast description (e.g. "Spoofing test") reaches HA. Additive optional payload field; no schema_version bump. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The example "drone detected" automation triggered on
numeric_state above: 0, which fires only on the single 0->1 crossing of the drone count. A second drone arriving while one was already tracked (1->2), or a re-detection before the count fell back to 0, was silently missed — the "doesn't always fire" report. Switch to a state trigger gated on the count increasing, which catches every new drone.The message only rendered FAA make/model and fell back to "Unknown drone" whenever the registry couldn't resolve the serial (off, or a spoof/test serial not in the FAA DOC set) — the "unknown values" report. It now degrades make/model -> UA type -> "Drone" and adds self_id + AGL, so it stays useful without a registry hit.
Plumb the Remote ID Self-ID message (
self_id) through DroneInfo -> parse -> DronePayload so the broadcast description (e.g. "Spoofing test") reaches HA. Additive optional payload field; no schema_version bump.