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

I also have a similar question. The default install location is /config/www/community/Home-Assistant-Mail-And-Packages-Custom-Card. Is that where the image path should be?

The image path can be any directory under /config/www, so technically that can be a valid path, but it’d be best to use something else like /config/www/images as an example.

Got it. Thanks. Card looks great! How do you set up two or more cameras? Currently I am getting two images, one from USPS and one from Amazon.

You’d setup a local file camera, it’s outlined in the wiki.

I read the wiki you linked to and see the example of the local camera. I do not see how to setup a second camera for the amazon picture so that it displays both deliveries.

FYI I ran into this issue again this morning. My sensors became unavailable so I removed/readded the integration but go the “user input malformed” error until I selected both random image and mp4 options. I was then able to go back in and remove those options by reconfiguring. Didn’t want to necrobump the issue.

Same method, just a different file name :wink:

This is normal if there’s an issue connecting to the email server. Highly recommend not removing/readding to fix. It’ll resove itself after some time :slight_smile:

I’ll look into the user input error.

EDIT: Did you happen to get a error in the log when that occured?

Understood but this was for like…24 hours. I think it was because i updated from b-17 to b-19 or 20, can’t remember which. I rolled back to 17 and everything is working again.

No, no log entry. I knew you’d want one too so I checked.

1 Like

When I tried this on config check it said wasn’t allowed. I’ll see if I can find more details. Thanks. I do not see how to setup multiple local cameras. I can get one or the other working, but not both.I just got it. For others:

camera:
  - platform: local_file
    file_path: /config/www/images/mail_today.gif
    name: mail_usps
camera 1:
  - platform: local_file
    name: amazon
    file_path: /config/www/images/amazon_delivered.jpg

Now that I have multiple cameras setup can I use them both on the custom mail an package card or do you need a second card?

I think you’d need to add a 2nd card.
I just use picture entities for the cameras myself.

1 Like

This is a new one:

Logger: custom_components.mail_and_packages
Source: custom_components/mail_and_packages/helpers.py:836
Integration: Mail and Packages (documentation, issues)
First occurred: 7:06:16 AM (1 occurrences)
Last logged: 7:06:16 AM
Unexpected error fetching Mail and Packages (imap.gmail.com) data: Expected list, got <class 'str'>

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 144, in async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 132, in _async_update_data
    return await self.update_method()
  File "/config/custom_components/mail_and_packages/__init__.py", line 37, in async_update_data
    return await hass.async_add_executor_job(process_emails, hass, config)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/mail_and_packages/helpers.py", line 129, in process_emails
    count[sensor] = get_items(account, const.ATTR_COUNT, amazon_fwds)
  File "/config/custom_components/mail_and_packages/helpers.py", line 836, in get_items
    email_msg = quopri.decodestring(str(msg.get_payload(0)))
  File "/usr/local/lib/python3.8/email/message.py", line 257, in get_payload
    raise TypeError('Expected list, got %s' % type(self._payload))
TypeError: Expected list, got <class 'str'>

Running B17 which otherwise has been fine.

Can you see if it persists in b20?

Sure. Feel like i tried this yesterday and b20 didn’t work but going back to 17 did. Oddly the camera image updates, just not the associated sensors.

Actually I found a bug, b21 should be out soon :stuck_out_tongue:

Edit: Disregard, it’s early :stuck_out_tongue:

Well b20 didn’t fix it for me. So no b21 to look for atm?

Not yet, give me a couple mins, should have something for this error shortly tho.

EDIT: b21 posted.

This works for Amazon. Thanks. When does it update? For example the picture showing is yesterday’s delivery.

It updates when a new email pops in with an image.
It’s a very early feature that was tossed in. :stuck_out_tongue: