Skip to content

Follow any GPS tracker already in Home Assistant - #10

Merged
aniceberg merged 1 commit into
mainfrom
claude/device-tracker-provider
Nov 5, 2026
Merged

aniceberg merged 1 commit into
mainfrom
claude/device-tracker-provider

Conversation

@aniceberg

Copy link
Copy Markdown
Owner

Adds a third provider that follows any device_tracker entity 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.

  • Setup: a new menu choice with no login. It offers only trackers that have a location right now, then goes on to the first bus profile. The provider is added once; more trackers are added as bus profiles.
  • Excluded: Bus Monitor's own tracker entities, and router or Bluetooth trackers.
  • Speed and direction: worked out from movement between reports, because integrations don't agree on a speed unit.
  • Accuracy: reports with gps_accuracy above 250 m don't trigger alerts.
  • Slow starts: if the tracker's integration loads after Bus Monitor, the bus keeps its name and picks up positions once the tracker reports.
  • Docs: docs/ha_trackers.md covers 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

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>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T00:42:05.299733Z 744274f PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@aniceberg
aniceberg merged commit 61c7bde into main Nov 5, 2026
6 checks passed
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