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

Thanks, I’m running 0.3.1

In the future, if there is a new release, I just need to follow the above procedure, and then click “install” in the lower right and my integration will be updated to the latest?

FWIW when I ran thru the UI to create the automation:

  - alias: "Update USPS Mail Camera Path on Hass Restart"
    trigger:
      - platform: state
        entity_id: sensor.mail_updated
      - platform: homeassistant
        event: start
    action:
      - service: local_file.update_file_path
        data_template:
          entity_id: camera.mail_usps
          file_path: "{{ states('sensor.mail_image_system_path') }}"

For some reason the UI wouldn’t let me select camera.mail_usps and had no entries, however I set it anyways and image looks to be working fine now with the image.

EDIT: Yes I had created the local_file camera too.

1 Like

You’ll see something like this when there’s an update, and you just hit ‘Update’ after clicking it.
image

1 Like

This morning the mail and package card showed the pictures of the three items being delivered. I just checked now and it shows the NO Mail picture. I understood that this updated at 12 Midnight. It is 5:45PM EST. Not sure what caused this, but it was not me as I was out all day and did not look at Home Assistant until just now.

Any chance your instance restarted? The email was deleted or moved out of the folder you were watching? Does the USPS Mail sensor still show 3 mail pieces?

I did another empty cache and now the image is back. Sorry. It is there. Maybe I need to empty cache daily? Hope not, but maybe this is my issue.

Trying to figure out why my Mail card doesn’t display “no mail”… I have two automations, one runs on “startup” and the other runs everytime “sensor.mail_updated” is triggered.

alias: Update USPS Mail Camera
description: ‘’
trigger:

  • platform: state
    entity_id: sensor.mail_updated
    condition: []
    action:
  • service: local_file.update_file_path
    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 %}
    mode: single

I can see the mail_none.gif in the correct folder, IE: /config/custom_components/mail_and_packages/
currently there isn’t any image stored at /config/www/mail_and_packages/, since I have not received any email from USPS today.

I have this entry in my config.yaml camera:

  • platform: local_file
    file_path: /config/images/mail_and_packages/mail_today.gif
    name: mail_usps

This is my mail card:

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

and it’s blank display:

Tried clearing cache and rebooting several times.
Release 0.3.1 Also tried updating the repository.

Using Developers Tools, and looking at camera.mail_usps, I can see: file_path: /config/www/mail_and_packages/b22e8653-8bbf-4fd4-9f4e-0db1cc1d8dff.gif

But there is no file in that directory by that name.

I’m seeing this info in the logs:

My new image of the mail card does not show in the custom card unless I empty cache and hard reset. Is there a setting that I can change that loads the new image daily? I went back to the PC and the image had changed back to no mail image. Reset cache and back to the proper image.

The wiki has been updated to assist with getting the camera working with the latest verison.

1 Like

Which web browser are you using? Almost sounds like Safari.

Chrome. On 2 pcs, 2 tablets and chrome OS.

Have you tried just hitting F5?

I know I have it the refresh button on the PC and tablet. I don’t remember if I hit F5. If it doesn’t show tomorrow I’ll try it and answer back.

I have been using this great set of features for a few months. Recently, it all stopped working and all the sensors have an ‘unavailable’ state. I have reinstalled, reconfigured, checked all the wiki pages and cannot correct the issue. Was there something that fundamentally changed to result in what I am experiencing?

The custom_components.mail_and_packages: debug doesn’t work as logger.set_level isn’t recognized.

I had the same happen to me this morning too. I did a hard reboot of the host system and it seemed to fix it. Also check if your sensors changed. Sometimes I get _2 sensors.

Hard boot didn’t help. All sensors still unavailable.

Maybe the answer is to go back to using the custom camera? Using the setup for the image just seems so much easier to use. What do you think?

@moralmunky Have you thought of adding tracking number support? I use ljmerza/ha-email-sensor: Email Sensor for collecting tracking numbers from over 25 providers. (github.com), but then I have two integrations hitting my mail. I noticed on your integration, you scrape amazon order numbers. then, using a little markdown you can display links to the order. Be awesome to add UPS, USPS, etc since you already scrape:

type: markdown
content: >-
  {% for item in states.sensor.mail_amazon_packages.attributes.order %} 

  {{item}} <a
  href='https://www.amazon.com/progress-tracker/package/ref=ppx_yo_mob_b_track_package_o0?_encoding=UTF8&itemId=jllnttlrtiqoqo&orderId={{item}}&vt='>Amazon</a>

  {% endfor %}
1 Like

And this morning it worked again. I updated to the beta channel for HA. Maybe something changed on the front that fixed my issue? I’ll try to not change anything on the card and integration for a while and let you know the status when I receive a new email from USPS .

You can give it a try, the image not refreshing is really a frontend/browser issue that we have no control over.