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

Anyone wanting to test with their docker/HassOS version grab the files from my updated branch.

https://github.com/firstof9/Home-Assistant-Mail-And-Packages/tree/documentation_update

You shouldn’t need to install Imagemagick anymore.

Post your results :smiley:

So far so good! Looks like the sensors and image were updated today, no errors in log!

THANK YOU SO MUCH!

Good to hear, @thenorthernsmiths

@FunPsycho feel free to give it a go as well. I’ve also updated the documentation a touch, let me know if something seems unclear on it.

@BurnsHA you might need to update your video soon, sorry :stuck_out_tongue:

Can you share your modified card? Probably should update the github version.

Feel free to submit a PR for your modifications to the card :slight_smile:

Oh nice! I’ll give this a go today!.

For now I created a vertical stack card with an entity-filter card to hide when there’s no mail/packages (but still show last updated). Not 100% sure it’ll keep working or if I won’t keep tweaking but here’s what I have.

    - type: vertical-stack
      title: Mail Today
      cards:
        - type: picture
          image: /local/mail_and_packages/mail_today.gif
        - type: entity-filter
          state_filter:
            - operator: ">"
              value: 0
          entities:
           - entity: sensor.mail_usps_mail
             name: USPS Mail
           - entity: sensor.mail_usps_packages
             name: USPS Packages
           - entity: sensor.fedex_packages
             name: FedEx Packages
           - sensor.ups_packages
           - sensor.packages_in_transit
           - sensor.packages_delivered
           - entity: sensor.mail_updated
             state_filter:
               - operator: "regex"
                 value: 20

Here is mine using vertical stack in card:

cards:
  - cards: null
    entities:
      - entity: sensor.mail_usps_mail
        name: Todays USPS Mail
      - entity: sensor.packages_in_transit
        name: Todays Package Delivery
    type: entities
  - cards: null
    entities:
      - entity: sensor.mail_usps_delivering
        icon: 'mdi:package-variant-closed'
        name: USPS
      - entity: sensor.mail_fedex_delivering
        icon: 'mdi:package-variant-closed'
        name: FedEx
      - entity: sensor.mail_ups_delivering
        icon: 'mdi:package-variant-closed'
        name: UPS
    show_header_toggle: false
    type: glance
  - aspect_ratio: 0%
    camera_image: camera.mail_usps
    entities: []
    type: picture-glance
  - cards: null
    entities:
      - entity: sensor.mail_updated
    type: entities
title: Mail & Package Tracking
type: 'custom:vertical-stack-in-card'

Just FYI guys I noticed some of the sensors were missing the mail_ prefix like sensor.packages_in_transit I’ve fixed that so they’re easier to identify in the states.

Example:
Old: sensor.packages_in_transit
Fixed: sensor.mail_packages_in_transit

Nice updates, thanks!!!

They are live, I haven’t tested the HACS install of it just yet, but I’ll give it a shot later tonight.

I’ll try the hacs install.

HACS install puts the custom_components folder in, but does not put the www folder in. It is not in the www folder and is not in the www/hacs folder either.

I get an error when it is not installed saying it cannot find the images, which makes sense since the image is not there.

When I manually put the folder there it works fine.

Should the path be different when installing with HACS? It has it’s own www folder, and the path now would suggest that you need to place it in the parent folder or at the same level as HACS

I’ll add checks to have the component make the directory if it doesn’t exist.
Few tweaks here and there and it’ll be working properly out of the box from HACS :slight_smile:

Sounds great! Just installing the sensors and stuff now. I’ll let you know what happens. Is there no need to install imageMagick anymore?

Correct, no need for imagemagick anymore.

And @firstof9 the www folder was my concern with HACS, didn’t see a way to force it to install.

So no mail or packages email today so I don’t know if the sensor is working correctly.

This one:

  - type: 'custom:mail-and-packages'
    deliver_today: sensor.mail_deliveries_today
    fedex: sensor.mail_fedex_packages
    in_transit: sensor.mail_packages_in_transit
    last_update: sensor.mail_updated
    mail: sensor.mail_usps_mail
    summary: sensor.mail_deliveries_message
    ups: sensor.mail_ups_packages
    usps: sensor.mail_usps_packages

Does not work though, I am trying to see if I just added it wrong or not.

It has an error

Thanks for the info!

Yes, the custom card is now broken because the packages folder has been removed. If you scroll up you’ll see @thenorthernsmiths and my alternate card designs. I like the custom vertical stack card idea so I took it an tweaked it a bit with the entity-filter card.

Looks like this with no mail:

image

And this if you had mail (just turned off the filtering for demo purposes.

Code:

    - type: custom:vertical-stack-in-card
      title: Mail & Package Tracking
      cards:
        - type: picture-glance
          camera_image: camera.mail_usps
          entities: []
        - type: entity-filter
          state_filter:
            - operator: ">"
              value: '0'
          entities:
           - entity: sensor.mail_usps_mail
             name: "Today's Mail"
           - entity: sensor.mail_packages_in_transit
             name: "Today's Package Delivery"
           - entity: sensor.mail_usps_delivering
             icon: 'mdi:package-variant-closed'
             name: USPS
           - entity: sensor.mail_fedex_delivering
             icon: 'mdi:package-variant-closed'
             name: FedEx
           - entity: sensor.mail_ups_delivering
             icon: 'mdi:package-variant-closed'
             name: UPS
           - entity: sensor.mail_updated
             state_filter:
               - operator: "regex"
                 value: 20