Mail and Packages: Custom component for UPS, FEDEX, and USPS

I don’t know what sensors the card uses, but you should have a sensor you can check called sensor.mail_amazon_packages_delivered and sensor.mail_amazon_packages.

If you delete the emails before the delivery you’ll have 0 show up.

Nailed it. The card was using sensor.mail_amazon_packages. I changed it to sensor.mail_amazon_packages_delivered and now 2 is shown. It does appear to pick up the delivered packages now but not the ones in transit (sensor.mail_amazon_packages) even though I moved the emails out of the trash. There’s really no reason it shouldn’t work so I’m just gonna see how it behaves going forward. Thanks for your help.

1 Like

I see in const.py the FedEx section subject line reads as "fedex_delivering": { "email": ["[email protected]", "[email protected]"], "subject": [ "Delivery scheduled for today", "Your package is scheduled for delivery today", "Your package is now out for delivery",

but my subject line in my email is:
“FedEx Shipment 1234567890: Your packages are now out for delivery today”

Is the multiple why the sensor.mail_fedex_delivering isn’t picking it up?

1 Like

That would be a new variant on the subject, normally they do an email PER tracking number.
Does the email body contain both tracking numbers?

Yup, it looks like this:

image

Please open an issue, and if possible attach the email to the issue as well.

If you are using gmail you can follow these directions to download the email, please sanitize your email address and only change the last few digits of the tracking number.

1 Like

I assume this will be a problem when they’re delivered as well. I’ll update the issue when that email comes through.

1 Like

Me again. Looks like Amazon has a subject that isn’t included in const.py. If I’m not wrong let me know and I’ll open an issue.

The amazon sensor doesn’t use the subject line, did it catch this email?

It did not

You can try appending line 85 in const.py like this:

AMAZON_TIME_PATTERN = "will arrive:,estimated delivery date is:,guaranteed delivery date is:,Arriving:,Arriverà:,arriving:"

to see if that picks it up.

OK I added arriving: but it’s still not being picked up by any of the Amazon sensors.

Go ahead and open an issue, see if you can download the email and attach it to the issue as well.

Thanks!

I stumbled onto this integration from a HA subreddit post. I’ve set up an app password for gmail, but to no avail:

Username is email address. Not sure what the issue could be. Any thoughts?

That’s not a valid mail server, please review the integration wiki.

OK, thanks. I’m on it… I do try to review this stuff before posting silly questions. Step 1 indicates the host is The address provided by your email host. I clicked the link for notes about specific email providers, which doesn’t discuss the host name, only the app password setup.

I suspected the host name as the culprit, because everything else should be correct… but if there’s a reference to the host name in the wiki beyond what I posted above, I’m missing it.

EDIT: ah… it’s the POP server address. Got it.

Technically IMAP, but they both point at the same place.

EDIT: I’ve added a link for more info on setting up GMail. Thank you for the feedback.

Thanks for that. My USPS mail count sensor and gif are working.

I went back in to configure the integration (to lower the image duration down to 3 seconds), and I’m seeing an error that is preventing me from saving the new value:

User input malformed: expected str for dictionary value @ data['amazon_fwds']

I left that field as found/as it was in the first time I configured it, with "" in it. I’ve also tried clearing out that field.

I don’t have any Amazon forwarded email addresses… or are they just the typical, [email protected],[email protected],[email protected]?

EDIT: If you’re seeking feedback, check this spelling error in the path for “Allow external image use*” in Step 2 of the wiki:

Save the image to /path/to/config/www/mail_and_packages/ so it is accessible to use in iOS and Android notifications.

Using "" in the amazon forwards setting should be fine. You may need to run the latest beta to fix that.

I’ve fixed the typo, thanks again!

Just finished configuring this, but its showing 0 packages coming for me from Amazon and Fedex (I know i have 1 of each coming). Am i missing something? I setup with Gmail using an app password, pointed to my inbox, no errors i can see in the logs.