Repository navigation
Follow any GPS tracker already in Home Assistant - #10
Conversation
A third provider for vehicles that already have a device_tracker entity, whichever integration made it. No login. Speed and course come from movement because integrations don't agree on a speed unit, and fixes above 250 m accuracy don't trigger alerts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 744274f976
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ): | ||
| continue | ||
| position = self._position(state, *where, now) | ||
| self._last[state.entity_id] = position |
There was a problem hiding this comment.
Exclude inaccurate fixes from the motion history
When a low-accuracy report is followed by an accurate one, the rejected coordinates still become the baseline for calculating the next report's speed and course. For example, a stationary tracker reporting latitude 40.0, then 40.02 with gps_accuracy=1500, then 40.0 again at 10-second intervals produces a valid final position moving at approximately 222 m/s. TripTracker._note_movement() consequently marks the parked bus as running, enabling false running-late/offline alerts and switching to fast polling. Only retain accurate positions as motion baselines so a rejected fix cannot contaminate subsequent valid reports.
Useful? React with 👍 / 👎.
Adds a third provider that follows any
device_trackerentity already in Home Assistant, whichever integration made it. This is the route for bus or vehicle trackers that have no provider of their own here, without scraping vendor apps.gps_accuracyabove 250 m don't trigger alerts.docs/ha_trackers.mdcovers setup and limits. Timing depends on how often the tracker reports, and "no GPS fix" alerts can misfire on trackers that only update when they move.Tested: 215 tests pass, including the flow and a loaded entry. They use simulated tracker states.
Not tested: a real integration's tracker in a running Home Assistant, or a real bus trip.
🤖 Generated with Claude Code