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

I’m back, sorry. Everything is still work; however, in the log I’m getting this:

(SyncWorker_1) [homeassistant.components.local_file.camera] Could not read camera mail_usps image from file: /config/www/mail_and_packages/mail_today.gif

The last one yesterday was about 6:30pm and then I got another at about 9:00 this morning. Not another since. Not sure this is a sign I have other problems or if this is normal.

This is the camera component you set up outside the integration. Either the path to the image file is incorrect, you have a permissions issue, or you have the random image file name turned on in the integration.

1 Like

Here is how both are set up:

camera:
  - platform: local_file
    file_path: /config/www/mail_and_packages/mail_today.gif
    name: mail_usps

What is confusing is that it is working, I just get this error periodically the last time was more than 10 hours after a restart.

The integration only deals with the creation of the file and where the file is saved. If the integration is saving a new file as expected after the USPS informed delivery email is received and the integration scans your email box, you may want to search the forum for the Home Assistants camera component errors.

It could perhaps be when the file is in process of being saved and therefore the component cannot read yet?

@ZombiEd Where you trying to install the custom card and getting the ‘master not compliant’ error? How were you trying to install it?

I tried to install it as a custom repository using HACS pretty much the same way I installed the integration and other custom cards I did change the category to Lovelace. I posted a jpeg of the how I tried to load it previously on this thread. I entered the url both with and without https:// with the same results.

The custom cards is not in HACS. Please refer to the github page for installation.

Is there another place besides where you go when you click on the link you provided because I did read through it but saw no installation instructions for the card, just the Lovelace GUI set up which I did do. I’ve not used github much so I may be missing a link to the instructions. I thought maybe it was installed with the integration but I don’t have the JavaScript module on my system so I get custom element does not exist. So I’m guessing Since it’s not in HACS I need to manually download and install the code.

I was going to verify that at least one of the sensors were more than 0 as part of the condition check but tried something else instead.

    - condition: and
      conditions:
        - condition: time
          after: '01:00:00'
        - condition: time
          before: '23:00:00'
        - condition: or
          conditions:
            - condition: template
              value_template: "{{ (as_timestamp(now()) - as_timestamp(states.sensor.mail_usps_mail.last_changed)) < 15 }}"
            - condition: template
              value_template: "{{ (as_timestamp(now()) - as_timestamp(states.sensor.mail_usps_delivering.last_changed)) < 15 }}"

Seems like it’s working.

One other item and doesn’t seem to be an issue. I have the mail check set to run once an hour. Whenever it does run I get:

2020-07-20 08:02:31 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.mail_updated is taking over 10 seconds

In the logs. Any way to avoid this or set the update for this particular item to more than 10 seconds? Assuming checking for mail just takes a while?

Yes, that’s not a “how often to check” message it’s just a “how long is this process taking.” It’s harmless so you can ignore.

If you’d like I can check into the repo formatting for you to allow HACS installation.

Edit: PR submitted :slight_smile:

If you are running on rPi you’ll see this more frequently. It’s safe to ignore.

I’ll be adjusting the automation on the wiki example shortly :slight_smile:

Edit: Updated so that it only triggers if the count is greater than 0.

Didn’t notice this until I looked closer, need to tweak that. The automation only triggers with the mail, so if you get packages but no mail for any given day it wouldn’t trigger.

The conditional is or so if mail >0 OR packages > 0.

Anyone have this working with Apple iCloud email? If so what settings did you use?

Thanks.

I had (have) the same issue. Yes, I understand that the code is not in HACS. HACS has an option for you to load custom repositories. I can do it with the main component, but not with the card. HACS does not like “something” about the card repository structure.

The advantage of “adding” it to HACS is that HACS will then notify me that there is an updated version vs. having to keep checking ghithub and then manually pull down the new code.

I’ve put in a PR for the card to re-org the repo for HACS usage.

Just updated to latest version and now all the DHL sensors are not available; not a loss as I rarely get package deliveries from them. Have these sensors been removed?

I did get an email from amazon this morning for delivery tomorrow; is this supposed to show today? The sensor is showing 0 so does the sensor only reflected it if it is out for delivery?