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

This is going to be a caching issue.

Try this:

  1. In chrome hit F12Network Tab
  2. Check Disable cache then refresh the page
  3. Everything should load up.
  4. Uncheck Disable cache and close the chrome console window

I had already cleared the cache on my laptop. I just followed your directions and it still shows the custom element does not exist.

Check the browser console (F12) for errors.

Two errors
chunk.53899b0337677dfbe7ab.js:1 GET https://xxxx.duckdns.org:8123/local/card-tools.js net::ERR_ABORTED 404 (Not Found)
and
chunk.53899b0337677dfbe7ab.js:1 Uncaught (in promise) https://xxxx.duckdns.org:8123/local/card-tools.js

Now I have Home-Assistant-Mail-And-Packages-Custom-Card.js:712 Uncaught SyntaxError: Unexpected token ‘export’

I was seeing similar errors with the home feed card a couple of years ago. Worked on some devices and not others. The author was able to fix it on his end.

https://community.home-assistant.io/t/lovelace-home-feed-card/103719/188

Just to be clear, the first two errors related to a file, Card-tools.js, is not a file supplied with the custom card not does it reference it in code.

Looked over the thread you provided. It appears the home feed card was relying on a CDN which was throwing security issues with CORS breaking the retrieval of certain files for card to function instead of loading all files locally. All files for the custom card are local.

I am unable to reproduce the issue or receive any console errors in the following OS and Browser combinations:
Safari - Mac: 1.4.1.1
Chrome - Mac: 91.0.4472.77, WIndows: 91.0.4472.101
Firefox - Mac: 87, 89
Edge - Mac: 91.0.864.48, Windows: 91.0.864.41

Unfortunately I do not have any chrome products other than the web browsers. Not sure if duckDNS has any caching abilities similar to cloud flare, but you may want to check that.

What is different between your PC and laptop?

I will leave the issue open, but I’m not sure how to proceed trouble shooting this.

I have two Samsung tablets that are identical. Works on one and not on other. The PCs have same version of chrome. The Chromebook has latest os and latest chrome.
I just tried on this tablet where The duckdns works correctly. I went to a new tab and used the direct ip address :8123 and it gets the element not found on this new tab. I switch to the duckdns tab and it is still working.
Not sure what to try next?

On the pc where it works, I tried to add a new card in a different tab.
I get this error:

Configuration errors detected:
Failed to fetch dynamically imported module: https://xxxx.duckdns.org:8123/hacsfiles/Home-Assistant-Mail-And-Packages-Custom-Card/Home-Assistant-Mail-And-Packages-Custom-Card-editor.js

Console error is:

Home-Assistant-Mail-And-Packages-Custom-Card.js:712 Uncaught SyntaxError: Unexpected token 'export'

Laptop chrome version is Version 91.0.4472.77 (Official Build) (64-bit)
Just saw there was an update Version 91.0.4472.101 (Official Build) (64-bit). No change after update.
Just saw that there was another beta. No difference in chrome.

So I haven’t had time to really debug this yet but is it possible if I am not an “email deleter” and old my old messages remain in my inbox… that the Amazon portion of this integration is downloading the image in every Amazon email every time it scans? I had a folder in www/mail_and_packages/amazon with nearly 2000 Amazon package images and “no deliveries” images that after deleting twice all images came back each time. I was wondering if there is a restriction on the dates it is scanning when checking for Amazon messages. I will look into more and turn on debug when I get a chance but was wondering if anyone else who has tens of thousands of messages in their inbox is also seeing this?

Yes 3 days prior to today’s date.

There should only ever be 1 image in there, if this isn’t the case, you have a file/directory permissions issue.

So does the integration itself do the deletion after the number of days? And yes it is very likely I messed up some permissions recently… I also emptied my inbox of Amazon emails.

The images are cleaned up at/after midnight daily.

Okay that seemed to definitely be a permission issue as you said, I still had about 1,000 Amazon emails left in inbox and only one image got put in that folder this time after correcting the folder permissions. Thank you.

1 Like

Hi all,
this looks like a realy interesting integration.
What do people do:

  • open up their regular email address to this integration
  • create rules to forward delivery notifications to another email address (that this integration watches)
  • or something else?

Cheers

Mathew

Noticed a possible USPS subject line change this morning. Logged it here: ISSUE: Possible USPS Package delivery subject change · Issue #473 · moralmunky/Home-Assistant-Mail-And-Packages · GitHub

Not sure if it’s related to the package having a delivery exception last night or not.

1 Like

I personally use my regular email address. Others have a specific mailbox they’ve setup for shipping emails and give the integration access.

The code is open, you can review it, nothing malicious occurs and it doesn’t delete any emails.

0.3.3-b5 should solve this.

Hello guys.

I just installed this coll integration, but I cannot see the Amazon packages SHIPPED.
I only see the delivered items.

Is there a way to see shipped packages OR event the “out for delivery” orders?

Thank you in advance!

You should have a sensor.mail_amazon_packages this is the “Out for Delivery” sensor for Amazon.