A HACS custom integration that tracks shipping packages from USPS, UPS, FedEx, and SpeedX with a built-in Lovelace card.
- Track packages from USPS, UPS, FedEx, and SpeedX
- Auto-detect carrier from tracking number format
- Built-in Lovelace card with status icons and color coding
- Add/remove packages via the UI options flow or the
add_packageservice - Add Package Lovelace card — form card for adding packages directly from the dashboard
- Modular carrier system — easy to extend with new carriers; the frontend dropdown and Dev Tools service definition stay in sync automatically via the scraper
- Open HACS in Home Assistant
- Go to Integrations → 3-dot menu → Custom repositories
- Add this repository URL with category Integration
- Install "Package Tracker"
- Restart Home Assistant
- Copy
custom_components/package_tracker/to yourconfig/custom_components/directory - Restart Home Assistant
This integration has two components: a scraper container that fetches tracking data, and a HACS integration that displays it in Home Assistant.
Run the scraper as a Docker container on your network (e.g. on the same host as Home Assistant):
# docker-compose.yml
services:
scraper:
image: wolffruoff/package-tracker-scraper:latest
container_name: package-tracker-scraper
ports:
- "8230:8230"
volumes:
- scraper-data:/data
environment:
- PORT=8230
- DB_PATH=/data/package_tracker.db
restart: unless-stopped
volumes:
scraper-data:docker compose up -dFollow the Installation steps above.
- Go to Settings → Devices & Services → Add Integration
- Search for "Package Tracker"
- Enter the scraper URL (e.g.
http://localhost:8230)
The Lovelace cards are served as a static file by HA. Register the resource so dashboards can load it:
- Go to Settings → Dashboards → 3-dot menu → Resources
- Click Add Resource
- Set the URL to
/package_tracker/package-tracker-card.js - Set the resource type to JavaScript module
- Click Create
After a manual install the resource must be added manually. HACS installs may handle this automatically.
- Go to the Package Tracker integration
- Click Configure
- Select Add a package
- Enter a label, tracking number, and optionally select the carrier (auto-detected by default)
Call package_tracker.add_package from Developer Tools → Services or an automation:
service: package_tracker.add_package
data:
tracking_number: "92001234567890123456"
label: "Amazon Order"
carrier: "" # leave blank to auto-detectFields: tracking_number (required), label (required), carrier (optional — usps, ups, fedex, speedx, or blank for auto-detect).
Add custom:package-tracker-add-card to any dashboard for a form-based UI (see Lovelace Cards). The carrier dropdown is populated dynamically from the scraper, so it always reflects the carriers it supports.
Displays all tracked packages sorted by status priority:
type: custom:package-tracker-card
title: My Packages
show_delivered: trueThe card auto-discovers all sensor.package_tracker_* entities.
| Option | Type | Default | Description |
|---|---|---|---|
title |
string | "Package Tracker" | Card title |
show_delivered |
boolean | true | Show delivered packages |
A form card for adding packages without leaving the dashboard. Supports the visual editor in the card picker.
type: custom:package-tracker-add-card
title: Add Package| Option | Type | Default | Description |
|---|---|---|---|
title |
string | "Add Package" | Card title |
Each tracked package creates a sensor with these attributes:
label— Package labelcarrier— Carrier name (usps/ups/fedex/speedx)tracking_number— Tracking numberestimated_delivery— Estimated delivery date (ISO format)last_updated— Last successful API poll (ISO format)raw_status— Raw status text from the carriertracking_url— Direct link to the carrier's tracking pageevents— List of tracking events with timestamp, location, description, and status
First-time setup (installs uv, Python 3.12, and all dependencies):
make setupRun tests:
make test # HA integration tests
make test-scraper # Scraper tests
make test-all # Both
make coverage # Tests with coverageCI requires all tests to pass before merging.