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

Figured it out. Had to put the double quote in that one secondary email field. I say that but it was already there but had to update it again.

Awesome Integration and custom card. Iā€™ve been eyeballing it for a while, but just now getting around to installing it. I have a ā€œmainā€ email address that I use, but created a ā€œ[email protected]ā€ I have tied my USPS informed delivery, my UPS, and fedex accounts to that email address. I have left my amazon account on my main email and plugged in [email protected] into the amazon forwarded email address and told it to go back 5 days on amazon deliveries. It doesnā€™t appear to be updating (two packages delivered about an hour ago). First, do I need the quotes around the forward email address? Secondly, will it go back and look at previous emails in the ā€œpackagesā€ inbox? I donā€™t have any errors in my main home assistant log pertaining to any of this. any suggestions?

On a separate note, has anyone played with a picture elements card using conditional elements (like would only show up if you have a delivery coming or if one is scheduled etc?

I got this working but I learned I have to be patient and wait until the next day/morning to see it properly working.

This is wrong, youā€™d input your main email address as thatā€™s where the email would be coming from, if itā€™s coming from a gmail account you may be able to leave it as (none) as well.

Only for amazon.

b
This is wrong, youā€™d input your main email address as thatā€™s where the email would be coming from, if itā€™s coming from a gmail account you may be able to leave it as (none) as well.

Thanks @firstof9 . Does the email address that itā€™s being forwarded from need to be in quotes?

I donā€™t think it has to have quotes. If you donā€™t do quotes and it errors, try quotes.

All seems to be working well with this integrationā€¦ but I get this warning in the logs:

This error originated from a custom integration.

Logger: custom_components.mail_and_packages.helpers
Source: custom_components/mail_and_packages/helpers.py:187
Integration: Mail and Packages (documentation, issues)
First occurred: 8:47:33 AM (49 occurrences)
Last logged: 12:58:33 PM

Unexpected html format found.

Any insight?

Ignore it.

Easily done!

Iā€™m looking into this and currently loving it but I canā€™t seem to get the Amazon packages counter to update. The logs show that it is seeing the two emails in my inbox (one expected delivery today, one on saturday):

...
2022-12-22 13:35:08.132 DEBUG (SyncWorker_3) [custom_components.mail_and_packages.helpers] DEBUG imap_search: (OR FROM "[email protected]" FROM "[email protected]" SINCE 17-Dec-2022)
2022-12-22 13:35:08.326 DEBUG (SyncWorker_3) [custom_components.mail_and_packages.helpers] DEBUG email_search value: ('OK', [b'2661 2806'])
2022-12-22 13:29:45.629 DEBUG (SyncWorker_1) [custom_components.mail_and_packages.helpers] Amazon emails found: 2
2022-12-22 13:29:46.161 DEBUG (SyncWorker_1) [custom_components.mail_and_packages.helpers] Email Multipart: True
2022-12-22 13:29:46.161 DEBUG (SyncWorker_1) [custom_components.mail_and_packages.helpers] Content Type: multipart/alternative
2022-12-22 13:29:46.161 DEBUG (SyncWorker_1) [custom_components.mail_and_packages.helpers] Amazon Subject: Your Amazon.com order #XXX-XXXXXXX-XXXXXXX has shipped
2022-12-22 13:29:46.161 DEBUG (SyncWorker_1) [custom_components.mail_and_packages.helpers] RAW EMAIL: Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
...
Hi Mike, your package will arrive:

Thursday, December 22

This contains items from 2 orders

Track your package:
...
2022-12-22 13:35:05.633 DEBUG (SyncWorker_3) [custom_components.mail_and_packages.helpers] Looking for: will arrive:
2022-12-22 13:35:05.633 DEBUG (SyncWorker_3) [custom_components.mail_and_packages.helpers] First pass: Thursday, December 22

This contains items from 2 orders
2022-12-22 13:35:05.633 DEBUG (SyncWorker_3) [custom_components.mail_and_packages.helpers] Arrive Date: Thursday, December 22

This
2022-12-22 13:35:05.634 INFO (SyncWorker_3) [custom_components.mail_and_packages.helpers] International dates not supported. (unconverted data remains: 

This)
2022-12-22 13:35:05.634 DEBUG (SyncWorker_3) [custom_components.mail_and_packages.helpers] Arrive Date: Thursday, December 22

This
2022-12-22 13:35:05.634 INFO (SyncWorker_3) [custom_components.mail_and_packages.helpers] International dates not supported. (unconverted data remains: 

This)
2022-12-22 13:35:05.634 DEBUG (SyncWorker_3) [custom_components.mail_and_packages.helpers] Arrive Date: Thursday, December 22

This
2022-12-22 13:35:05.671 INFO (SyncWorker_3) [custom_components.mail_and_packages.helpers] International dates not supported. (unconverted data remains: 

This)
2022-12-22 13:35:05.671 DEBUG (SyncWorker_3) [custom_components.mail_and_packages.helpers] Arrive Date: Thursday, December 22

This
2022-12-22 13:35:05.672 INFO (SyncWorker_3) [custom_components.mail_and_packages.helpers] International dates not supported. (unconverted data remains: 

This)
2022-12-22 13:35:05.672 DEBUG (SyncWorker_3) [custom_components.mail_and_packages.helpers] Arrive Date: Thursday, December 22

This
2022-12-22 13:35:05.679 INFO (SyncWorker_3) [custom_components.mail_and_packages.helpers] International dates not supported. (unconverted data remains: 

This)
2022-12-22 13:35:05.679 DEBUG (SyncWorker_3) [custom_components.mail_and_packages.helpers] Arrive Date: Thursday, December 22

This
2022-12-22 13:35:05.680 INFO (SyncWorker_3) [custom_components.mail_and_packages.helpers] International dates not supported. (unconverted data remains: 

This)
2022-12-22 13:35:05.680 DEBUG (SyncWorker_3) [custom_components.mail_and_packages.helpers] Arrive Date: Thursday, December 22

This
2022-12-22 13:35:05.681 INFO (SyncWorker_3) [custom_components.mail_and_packages.helpers] International dates not supported. (unconverted data remains: 

This)
2022-12-22 13:35:05.681 DEBUG (SyncWorker_3) [custom_components.mail_and_packages.helpers] Looking for: estimated delivery date is:
2022-12-22 13:35:05.681 DEBUG (SyncWorker_3) [custom_components.mail_and_packages.helpers] Looking for: guaranteed delivery date is:
2022-12-22 13:35:05.681 DEBUG (SyncWorker_3) [custom_components.mail_and_packages.helpers] Looking for: Arriving:
2022-12-22 13:35:05.681 DEBUG (SyncWorker_3) [custom_components.mail_and_packages.helpers] Looking for: ArriverĆ :
2022-12-22 13:35:05.681 DEBUG (SyncWorker_3) [custom_components.mail_and_packages.helpers] Looking for: arriving:
2022-12-22 13:35:05.681 DEBUG (SyncWorker_3) [custom_components.mail_and_packages.helpers] Looking for: Dostawa:
2022-12-22 13:35:05.681 DEBUG (SyncWorker_3) [custom_components.mail_and_packages.helpers] Looking for: Zustellung:

Looks like the email they sent you is different.
Please open a bug on github with this information.

EDIT: double checked and we already parse this, make sure youā€™re using the latest beta version.

had updated to the latest beta (0.3.5-b20) as part of my debugging but had forgotten to restart HA after upgrading. oops and thanks!

1 Like

Set this up a week ago and have been watching it. Really slick!

Seems like all (or at least what Iā€™ve had delivered) is working except for USPS packages.
The Mail (letter/envelope) works but just not the packages.

Check your from address and the subject.

Hey @firstof9

From:
[email protected]

Subject:
Your Daily Digest for Sat, Dec 31

Thatā€™s your daily digest email, whereā€™s your out for delivery email?

Oh hmm interesting.
I didnā€™t get one?
I have all of the options checked on the Informed Delivery USPS site going to email A which then has a forward/filter rule to email B that the integration watches.

Filter rule is anything from: [email protected]

But Iā€™ve never gotten any other email from USPS beside the Daily Digest.

Hereā€™s all the email addresses and subjects USPS sends:

1 Like

Thanks. The InformedDelivery site shows via the Scan History:

Out for Delivery: 7:10am
Delivered, In/At Mailbox: 4:05pm

No email for either though.

Iā€™ll shoot off an email to USPS Support.

Did you figure this out? Iā€™m having the same problem. I only get daily digests, which include both mail and packages. But I donā€™t seem to be getting individual emails for the packages at all. Iā€™m guessing that M&P doesnā€™t parse the packages from digests and I need to contact USPS to find out why Iā€™m not getting the emails.