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

Well, I’m completely stumped. I’m not getting the images with this configuration:

type: 'custom:mail-and-packages-card'
name: Mail Summary
updated: sensor.mail_updated
details: true
image: true
gif_sensor: sensor.mail_image_url
camera: false
fedex_packages: sensor.mail_fedex_packages
ups_packages: sensor.mail_ups_packages
usps_packages: sensor.mail_usps_packages
amazon_packages: sensor.mail_amazon_packages
usps_mail: sensor.mail_usps_mail
packages_delivered: sensor.mail_amazon_packages_delivered
packages_in_transit: sensor.mail_ups_delivering
camera_entity: sensor.mail_image_url

I’ve also tried substituting sensor.mail_image_system_path for sensor.mail_image_url and no change.

I tried using the camera instead, but more of the same, just not working. Also, using v0.3.1 on the integration, v0.06 on the frontend.

Lastly, I tried the external selection, and there’s no change. BTW, the GIF containing the USPS images is in the /config/www/mail_and_packages folder.

Maybe my question wasn’t clear. I tried the automation above and I did not understand the “system_path”. Am I to substitute the system path in the automation with the “true system path” i.e. /config/www/mail_and_packages/? I have read the new docs and see that the example camera setup still points to mail_today.gif. Since the name was changed to random, I never see this file in my mail_and_packages directory. I must be missing a step.

You can simplify the automation to change the image. Just add both triggers to the same automation. It should trigger if either are true.

1 Like

No, per the example:

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

This will use the new sensor to update the camera image.

I made a small edit to that section to point to the ‘No Mail’ image, which is how I have my camera setup on my Home Assistant.

Not using camera and all is working again. I removed the camera from my yaml (had camera false). I let you know tomorrow if it changes.

1 Like

Would you mind sharing your config? Since the update, I’m also struggling. I have the gif method configured and cannot for the life of me get the image back in the card.

I only have the lovelace card and the integration configured, no automation. Is it required, or is that only for the camera to refresh the image?

The automation is only to have the camera refresh the image.

Thanks, that’s what I understood, but I wanted to be certain.

My card looks like this, but the image is blank. I found the gif is in the /config/www/mail_and_packages folder and it’s new for today. It’s still the random string of characters, but it’s the only gif in there, so it should display:

type: 'custom:mail-and-packages-card'
name: Mail Summary
updated: sensor.mail_updated
details: true
image: true
gif_sensor: sensor.mail_image_url
camera: false
fedex_packages: sensor.mail_fedex_packages
ups_packages: sensor.mail_ups_packages
usps_packages: sensor.mail_usps_packages
amazon_packages: sensor.mail_amazon_packages
usps_mail: sensor.mail_usps_mail
packages_delivered: sensor.mail_amazon_packages_delivered
packages_in_transit: sensor.mail_ups_delivering
camera_entity: sensor.mail_image_url

What you have should be sufficient for the GIF. If you were attempting the camera entity, you must create one like the previous posts describe. You are currently providing it a sensor, not a camera.

Browser cache can sometimes be a pain.

I did clear the cache, as well as attempt on other browsers. Still no luck.

Should I have the external image use checkbox ticked? If I don’t, could I use the mail_image_system_path sensor instead, or is the mail_image_url required?

Should I have the external image use checkbox ticked?

To use the GIF in the card, yes. To use the GIF in certain notification services, yes. To use a Camera entity, no.

If I don’t, could I use the mail_image_system_path sensor instead, or is the mail_image_url required?

  • Using the GIF in the card requires a URL, sensor.mail_image_url is required for the gif_sensor. You use also have either (or both) Internal_URL or External_URL configured in the general section.

  • Using the camera requires you set up a local file camera which requires a local file path, sensor.mail_image_system_path is required for the camera entity

Please read through the new section for the USPS Informed Delivery for additional details.

We currently only have one notification example. How are you using notification? Are you using something other than the iOS Companion App?

Please open up a feature request issue and share your example to be included in the WIKI.

Thanks @moralmunky, you are a gentleman and a scholar. I really appreciate your patience with me/us on this and your clear explanations. I’ll continue toying with it.

EDIT: I think i found something. When I pull the external url, it’s resolving to https://myhassioinstance.duckdns.org/local/mail_and_packages/7f65f614-8264-4e19-af1f-4f1f289b3ae6.gif. When I navigate to this location, it does not resolve. However, when I add the port# of my instance https://myhassioinstance.duckdns.org:8123/local/mail_and_packages/7f65f614-8264-4e19-af1f-4f1f289b3ae6.gif, then I get the images.

I do need to enter the port when I login to my hass instance on my browser - could this be the issue?

Got it figured out. My firewall rules in my router were wrong. Internal 8123, external 443. Duh. Anyway, it’s all working perfectly now.

How can I determine what revision of the Mail-and-Packages integration I have installed?

The easy way via HACS is to click Integrations.
image
Then hit the overflow menu (the 3 dots).
Click Reinstall
image
You will then see the current installed version.

1 Like

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?