The Mail and Packages integration creates sensors for supported shippers to show a snapshot of mail and packages that are scheduled to be delivered the current day. For the packages that are scheduled for delivery the current day a count of in transit and delivered packages will be provided. It also generates the number of USPS mail pieces and provides a rotating GIF of the USPS provided images of the mail, if available, for the current day.
- π¦ 13 Supported Shippers - USPS, UPS, FedEx, Amazon, DHL, Canada Post, Royal Mail, Australia Post, Hermes, Poczta Polska, InPost, DPD Poland, and GLS
- πΈ USPS Informed Delivery Images - Automatic download and GIF/MP4 creation from daily mail images
- πͺ Amazon Hub Locker Support - Detects pickup codes and provides dedicated tracking
- π Multi-Language Support - Recognizes notifications in English, Italian, Polish, and German
- π Privacy First - All processing done locally, no external services or data sharing
- π 50+ Sensors - Comprehensive tracking of delivered, in-transit, and exception packages per shipper
- π· 2 Cameras - USPS mail images and Amazon delivery photos
- π Custom Services - On-demand camera refresh and more
- Huge contributions from @firstof9 moving the project forward and keeping it active!
From your instance of HASS, the Mail and Packages integration connects to the email account you supply where your shipment notifications are sent. It reviews at the subject lines of the current day's emails from the supported shippers and counts the subject lines that match known language from the supported shippers about their transit status. For USPS Informed delivery emails, it also downloads the mail images to combine them into a rotating GIF. See the WIKI information on how this works.
The email can not be deleted until the next day. You can have your email filtered into a folder and have the integration watch that folder.
The image will revert back to the no mail graphic after the first email check after midnight, local time.
- All procedures are done locally on your machine.
- No external services are used to process your email.
- No data is sent outside of your local instance of Home Assistant
Please note that files stored in the www Home Assistant folder are publicly accessible unless you have taken security measures outside of Home Assistant to secure it. For increased security and simplicity the USPS Informed Delivery image name is random by default and no longer has the option to turn it on/off. Two new sensors have been created that provide the local file path or a web accessible url for use in displaying or sending in various Home Assistant notification methods.
sensor.mail_image_system_pathsensor.mail_image_url- Requires that eitherExternal_URLorInternal_URLis defined in the general configuration options in Home Assistant.
- Open HACS in your Home Assistant instance
- Go to "Integrations"
- Search for "Mail and Packages"
- Click "Download"
- Restart Home Assistant
- Go to Settings β Devices & Services β Add Integration
- Search for "Mail and Packages" and follow the configuration steps
- Download the latest release from GitHub releases
- Extract the
mail_and_packagesfolder to yourcustom_componentsdirectory - Restart Home Assistant
- Go to Settings β Devices & Services β Add Integration
- Search for "Mail and Packages" and follow the configuration steps
- Email Account - A dedicated email account (Gmail, Outlook, etc.) where shipping notifications are sent
- IMAP Access - IMAP must be enabled on your email account
- USPS Informed Delivery (Optional) - Register at USPS Informed Delivery for mail image features
- Shipping Notifications - Sign up for delivery notifications with your preferred shippers:
- USPS Informed Delivery
- UPS My Choice
- FedEx Delivery Manager
- Amazon (already enabled for most accounts)
- FFmpeg (Optional) - Required only if you want MP4 video generation from mail images
The integration currently supports 13 international shipping carriers:
| Shipper | Delivered | In Transit | Exceptions | Tracking |
|---|---|---|---|---|
| USPS (USA) | β | β | β | β |
| UPS | β | β | β | β |
| FedEx | β | β | β | β |
| Amazon | β | β | β | β |
| Canada Post | β | β | β | β |
| DHL | β | β | β | β |
| Hermes (UK) | β | β | β | β |
| Royal Mail (UK) | β | β | β | β |
| Australia Post | β | β | β | β |
| Poczta Polska (Poland) | β | β | β | β |
| InPost (Poland) | β | β | β | β |
| DPD (Poland) | β | β | β | β |
| GLS | β | β | β | β |
See the Wiki - Supported Shipper Requirements for email configuration details for each shipper.
The integration is configured through the Home Assistant UI. After installation, add it via:
Settings β Devices & Services β Add Integration β Mail and Packages
| Setting | Required | Default | Description |
|---|---|---|---|
| Host | Yes | - | Your email server address (e.g., imap.gmail.com) |
| Port | Yes | 993 | IMAP port (typically 993 for SSL) |
| Username | Yes | - | Your email address |
| Password | Yes | - | Your email password or app-specific password |
| Folder | No | INBOX | Email folder to monitor (use quotes for folders with spaces) |
| Setting | Default | Description |
|---|---|---|
| Scan Interval | 5 minutes | How often to check for new emails (minimum 5 minutes) |
| IMAP Timeout | 30 seconds | Timeout for IMAP connection (minimum 10 seconds) |
| GIF Duration | 5 seconds | Animation speed for mail image GIFs |
| Image Security | Enabled | Randomize image filenames for privacy |
| Generate MP4 | Disabled | Create MP4 videos from mail images (requires FFmpeg) |
| Amazon Forwards | - | Comma-separated list of emails for forwarded Amazon notifications |
| Amazon Days | 3 | How many days back to look for Amazon packages |
| Allow External Access | Disabled | Allow images to be accessed externally |
| Custom Image | Disabled | Use a custom image when no mail is present |
For detailed configuration instructions, see Wiki - Configuration and Email Settings.
The integration creates comprehensive sensors for tracking your deliveries:
sensor.mail_updated- Timestamp of last successful update
Each supported shipper gets multiple sensors (where applicable):
sensor.mail_<shipper>_delivered- Packages delivered todaysensor.mail_<shipper>_delivering- Packages in transit for todaysensor.mail_<shipper>_exception- Packages with delivery issuessensor.mail_<shipper>_packages- Total packages from this shipper
sensor.mail_usps_mail- Number of mail pieces (from Informed Delivery)sensor.mail_image_system_path- Local file path to mail imagessensor.mail_image_url- Web-accessible URL for mail images
sensor.mail_amazon_hub- Amazon Hub Locker packages with pickup code in attributes
sensor.mail_packages_delivered- Total packages delivered today (all shippers)sensor.mail_packages_in_transit- Total packages in transit (all shippers)
camera.mail_usps_camera- Rotating GIF/MP4 of your USPS Informed Delivery mail imagescamera.mail_amazon_delivery_camera- Amazon package delivery photos
Manually refresh the mail camera(s) to fetch the latest images.
Parameters:
entity_id(optional): Specific camera entity to refresh (e.g.,camera.mail_usps_camera). Leave blank to refresh all cameras.
Example:
service: mail_and_packages.update_image
data:
entity_id: camera.mail_usps_camera