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

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.

Tracking numbers are already in. They show as attributes for sensor.mail_<shipper>_delivering sensors.

This looks like the integration isnā€™t loading due to an error.

Do you see anything in your Home Assistant log?

The wiki tells you all the steps to enable debugging/logging.

Thanks. Never noticed that. That seems to be only for delivering today sensors. Iā€™ll just use the other solution.

When do the tracking numbers leave the sensor that you mentioned?

I think they stay until you delete or read the email, depending on how it is setup. Not very hands off.