AfterShip smart home integration, free and open source

Track parcels from all your carriers with AfterShip: counters, scenes and a dashboard widget.
Track the parcels of all your carriers (USPS, UPS, FedEx, DHL, Royal Mail, Amazon… more than 1,100 carriers) in Gladys with AfterShip. The integration reads the shipments of your AfterShip account, counts those not delivered yet, starts your scenes when a parcel changes status and shows the shipments on their way on the dashboard.
Requirements
- An AfterShip account whose plan includes the Tracking API (Pro plan or higher: AfterShip removed it from the free and Essentials plans).
- An API key: in the AfterShip admin, open Settings > API keys and create a key.
AfterShip is an online service: the integration needs Internet access and works in every country.
Installation
- In Gladys, open Integrations, then the external integrations store.
- Search for AfterShip and click Install.
- Wait for the container to start: the integration shows up in the list.
Configuration
In the Configuration tab of the integration:
- API key: paste the key created in AfterShip.
- Refresh interval: how often the shipments are read, in seconds (900 by default, i.e. 15 minutes; 5 minutes to 1 hour).
Save, then click Test the connection: the number of shipments of the account shows under the button. Two more buttons track a shipment (tracking number, optional name, optional carrier code: AfterShip detects it when empty) and stop tracking a shipment.
Device
In the Discovery tab, add the AfterShip device. It carries:
- Shipments not delivered: the number of shipments not in the "Delivered" status (like the Home Assistant sensor), with history;
- one counter per status: pending, info received, in transit, out for delivery, to pick up, attempt failed, exception, expired, delivered;
- Latest shipment update: a text describing the most recently updated shipment.
Scenes and dashboards
Triggers ("AfterShip" card of the scene editor):
- Shipment status changed: a shipment moved to a new status. Filter by status (for example "Out for delivery" or "To pick up") and, if needed, by tracking number. Variables: shipment name, number, carrier, status, previous status, carrier message, expected delivery, tracking link.
- New shipment update: the carrier recorded a new checkpoint. Same filters; extra variables: checkpoint location and time.
An added shipment triggers nothing: only the changes of the shipments already known count. A change that happened during a restart is still reported at the next refresh.
Actions:
- Track a shipment: adds a tracking number; returns the AfterShip id, the carrier and the status. A number already tracked is not an error.
- Stop tracking a shipment: removes a number; returns the number of shipments removed (0 when none).
- Refresh the shipments: reads the account at once; returns the number of shipments not delivered, out for delivery and to pick up.
"Shipments" widget: two live counters (not delivered, out for delivery), the list of the shipments on their way, the most urgent first (out for delivery, to pick up, attempt failed, exception…), with their latest checkpoint, expected date and tracking link, and a Refresh button. The "Show delivered shipments" option adds them to the list.
Example: "when a shipment moves to Out for delivery, send me a message with {{triggerEvent.data.title}}".
Help
A question or a problem? Ask on the Gladys community forum or open an issue on the GitHub repository.
If the configuration says "AfterShip refused the API key", check the key and that your plan includes the Tracking API.
Configuration settings
These are the settings AfterShip asks for in its configuration screen in Gladys.
| Setting | Type | Required | Description |
|---|---|---|---|
| Getting started | section | No | The integration reads the shipments of your AfterShip account. Create an API key in the AfterShip admin (Settings > API keys). The Tracking API needs a Pro plan or higher. |
| API key | secret | Yes | Key of your AfterShip account, with access to the Tracking API. |
| Refresh interval (s) | number | No | How often the shipments are read, in seconds (5 minutes to 1 hour). |
How to install AfterShip in Gladys
- In Gladys, open Integrations: AfterShip appears in the catalog, next to the native integrations, with a community badge.
- Click Install. Gladys pulls the Docker image (
ghcr.io/prohand/gladys-aftership:1.1.0), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration). - Open the Configuration screen of the integration, fill in the settings, and save.
- You can also install it directly from its repository URL: https://github.com/prohand/gladys-aftership.
AfterShip requires Gladys >=5.1.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.
Not running Gladys yet? It is free and open source: follow the installation guide to get started.
About external integrations
AfterShip is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by prohand, not by the Gladys core team.
- Browse all integrations, native and community
- Build and publish your own external integration
- Source code on GitHub — source of this documentation