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

You have an automation in your config somewhere that needs to be removed.

Yes… agreed. And it was likely deprecated sometime in the last few months. But I don’t know where it is, and I thought someone familiar with this integration might be able to point me in the right direction.

You’ll need to dig through your yaml files.

Found. Searching for the automation ID is no good if it’s only referenced by its alias.

1 Like

I was getting the same errors and killed the automation, but it is in the project documentation.

Anyone’s integration stopped working after the latest HA upgrade?
Home Assistant 2022.9.4
Supervisor 2022.08.6
Operating System 9.0
Frontend 20220907.2

All entities are unavailable after HA restart this morning. In the logs, I have timeouts fetching data. I’ve made no changes to email authentication.

No issues here.

Thanks… after resubmitting the config and restarting the integration, it’s back to working fine. Odd.

Has anyone noticed that if a package is sent via stamps.com that it will not be shown in this integration?
I think the Post Office changed the email, because I think before that it was under packages coming but now there is a section for stamps.com. Am I missing something or do I need to submit an issue on GitHub?

I’m trying to setup this integration but having some troubles.

  1. Manual installed per the instructions on the Github page. (Unzip mail_and_packages to config/custom_components/mail_and_packages). Restarted HA.

  2. Created a gmail account for forwarding mail to. Setup 2-step verification, created an App Password. Tested the App Password by connecting Thunderbird mail client to imap.gmail.com:993 and it works.

  3. In Home Assistant\Integrations I added the Mail and Packages integration, but when I enter the gmail account (using the same info I used when testing with Thunderbird), it spins for a while, then I get an error “Unknown error Occurred” and shortly there after Home Assistant restarts.

I also confirmed I could ping imap.gmail.com from the HA console.

Any ideas what I might be doing wrong?

Thanks.

Check your home-assistant.log for errors.

Ya, it was a total brain fart on my part. My desktop and Home Assistant are in different firewall zones/VLANS. My desktop VLAN has far fewer outbound port restrictions, where the VLAN Home Assistant is on blocks all outbound ports by default. So basically I forgot to explicitly open TCP:993 to Home Assistant. Once I did that, it worked.

1 Like

So the integration setup completed, but I’m not seeing any updates to the sensors. I am getting this error multiple times in HA logs:

ERROR (SyncWorker_0) [custom_components.mail_and_packages.helpers] Error searching emails: SEARCH command error: BAD [b'Could not parse command']

I did some googling, and it looks like this could be a python/google thing. It seems Gmail IMAP only accepts UTF-8 searches when they’re a literal, and the Python imaplib has limited literal support? I might be way off base here (I’m not a developer). Here’s a link to what I found in case its helpful:
https://github.com/ikvk/imap_tools/issues/88

Make sure you’re running the latest beta.

That seemed to clear up the error. Is there a way to simulate a package delivery (short of me placing an order on Amazon)?

Hi all I seem to somehow have orphaned some entities when adding and removing this integration. It was giving me an error when I tried to update the settings so I thought removing the integration and adding it back was the next best thing. I want to try to get these cleaned up again before adding the integration back. Any idea why there weren’t deleted when the integration was deleted? How do I remove these now?

Edit: It seems when I deleted the integration it removed all the entities associated with my email, but not my wife’s as you see the _2 for everything.

Is there an ability to read all forwarded messages? I use Office365 which has just permanently killed IMAP and so I have created an @outlook.com email that I can forward all of my tracking emails to. This seems to kill the automation though (except amazon?) as the IMAP search is FROM usps@ for example.

Any ability to setup forwarding to war for all shippers?

Utilize app passwords for office365

https://support.microsoft.com/en-us/account-billing/manage-app-passwords-for-two-step-verification-d6dc8c6d-4bf7-4851-ad95-6d07799387e9

@firstof9 Completely deprecated

“We’re removing the ability to use Basic authentication in Exchange Online for Exchange ActiveSync (EAS), POP, IMAP, Remote PowerShell, Exchange Web Services (EWS), Offline Address Book (OAB), Outlook for Windows, and Mac.”

You can temporarily re-opt-in but by January 2023 it will be dead forever.

That sucks, I’ll research into OAuth.