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

@firstof9 Is the automation a work around because the image name is stored as an attribute and the camera component cannot load the image when it is changed?

1 Like

I wouldn’t call it a work around but more of THE best way to get the localfile camera to update the image.

1 Like

Alright, so the camera was working. It gave me the no mail.gif in the lovelace card. but I got a scanned image of mail from USPS today, everything worked right except the camera card in lovelace is now blank, and the “here is the mail” notification that should have the image is blank. I
tried searching for the .gif in my config but could not find it. Also, where can I go to buy @firstof9 and @moralmunky a cup of coffee.

Keep in mind the paths in my automation are for a “core” install. If you are using docker it should be something like /config/www/mail_and_packages. The paths should match what you configured for the integration. :slight_smile:

1 Like

Yeah, i have a standard install as far as I am aware (ie unless i screwed something up)

Post your system health from the info tab in dev-tools, should look similar to this:

image

Then we’ll know for sure how you’re installed.

1 Like

/home/homeassistant/.homeassistant/images/mail_and_packages

And this is the path I have in the integration configuration

Ok you’re using a docker install, so your path would be /config/www/mail_and_packages in both the integration config and in the automation.

1 Like

Copy that, much appreciated. Ok, I now see the correct image in the correct file.

1 Like

I am having issues with the Template in my config.

When I copy and paste it I get a bunch of errors with my other sensors.

I have tried changing the spacing around and it still will not work

here it is with fixed spacing and I still do not see anything in my front end

I know I am missing something as I am still learning

You need to put the template bits under your already defined template bits above your tautulli entry.

Thank you @firstof9

I now have it like this

After a reboot I am still not seeing a change in my lovelace card

Are there other ways to determine if this all working correctly?

I am using imap.google.com and during setup it could see my folders in my email.

If you saw the folder list then your credentials worked. Do you have an informed delivery email from the USPS today?

No I do not have an informed delivery email today. I signed up for it last night.

I do have multiple amazon packages coming through ups and fedex. I have had those accounts setup longer as well.

UPS and FedEx packages only show up the day of delivery.

Got it okay! Well I will wait and see.

Thank you for your assistance! you have been very helpful

1 Like

Thank you all who have worked on this component. I’ve tried following along and have read thru various replies but am not sure what/where to go next. I’d like to get the .jpg or .gif file to display as shown on “markmghali” recent post.
This…
image

Here’s my setup.

Here’s an entities card: (I have two updates as I have two email alias’s)
It shows one package from Amazon which I’ve received a message from Amazon that a shipment is in transit.

Here’s an error from the log:

I installed HACS and followed the instructions from “moralmunky” on github.
I see the mail_and_packages in my /config/custom_components

I have the .jpg and .gif images in /config/www/mail_and_packages. (image-no-mailpieces700.jpg" and mail_none.gif")
image

I’m confused at this point and don’t know where/what to try next.
Any help is appreciated.

UPDATE:
The file path below was pointing to /home/homeassistatn/.homeassistant so I was able to change and the log error has cleared itself but I still do not see the mail card image.

action:
  - service: local_file.update_file_path

- service: config/images

    data_template:
      entity_id: camera.mail_usps
      file_path: >
        {% if state_attr('sensor.mail_usps_mail','image') == None  %}
        /config/custom_components/mail_and_packages/mail_none.gif
        {% else %}
        /config/www/mail_and_packages/{{ state_attr('sensor.mail_usps_mail','image') }}
        {% endif %}

Did you setup the camera?

camera:
 - platform: local_file
   file_path: /config/custom_components/mail_and_packages/mail_none.gif
   name: mail_usps

If you have that then the only thing you need in lovelace is a picture entity pointing to the camera:

aspect_ratio: 50%
camera_image: camera.mail_usps
camera_view: live
entity: camera.mail_usps
show_name: false
show_state: false
type: picture-entity

Thanks!
I had the camera pointing to the wrong location…
wrong path… file_path: /config/images/mail_and_packages/mail_today.gif

Once I changed that and added the picture entity that solves it.

Lastly I’ve been seeing this error but don’t know what/how to deal with it.