Hey everyone, just finished up the very minor release for the USPS Package Tracker.
You can add my repo here: https://github.com/AndBobsYourUncle/hassio-addons
This uses the USPS Informed Delivery service and scans the email for the updates that are sent. It then keeps track of each package, and updates it as new emails come in.
You have an endpoint that serves up enroute packages, delivered today, and one for getting all packages in the system.
To use this addon, I’d recommend creating a brand new Gmail account just for this, and setup Informed Delivery to send package notifications to that email address, like this:
First click on “Settings” in the Informed Delivery site:
Then fill out the package update notifications section with the new email address and check off all the possible updates:
Then, once you have your email up and running with Informed Delivery (and you’re getting emails there for package updates), then install the addon and follow this nifty video tutorial on how to link up your new Gmail account to this addon with OAuth:
You should start getting stuff like this when you hit the addons endpoints:
http://hassio.local:9005/packages
"packages": [
{
"status": "delivered",
"latest_message_subject": "USPS® Item Delivered, Front Door/Porch 943856749832308934",
"tracking_number": "943856749832308934",
"delivered_location": "Front Door/Porch",
"delivery_from": null,
"delivery_to": null,
"delivered_at": "2019-12-04T20:06:22.000Z"
},
{
"status": "delivered",
"latest_message_subject": "USPS® Item Delivered, Front Door/Porch 92039393012939023",
"tracking_number": "92039393012939023",
"delivered_location": "Front Door/Porch",
"delivery_from": null,
"delivery_to": null,
"delivered_at": "2019-12-04T20:06:25.000Z"
}
]
You also get a couple other endpoints:
http://hassio.local:9005/enroute
http://hassio.local:9005/enroute_today
http://hassio.local:9005/delivered_today
All of these automatically filter based on the current status and delivery date of the packages. You can use these endpoints to create sensors or custom UI cards, or whatever you’d like. I just have a couple sensors for now that count how many JSON objects are in the “packages” array, and show me the number of enroute and delivered packages.
The “delivered_today” route only shows packages that have a “delivered_at” of the current day.
Let me know if you have any questions or feature requests.