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

Who knew it was the little things :slight_smile: - now to figure out changing URL color thanks again for all your help and the great component.

All the credit should really go to @moralmunky :smiley:

1 Like

Hey @firstof9 quick question - on your hassio setup do you get the mail images? I was gonna try the suggestion a few threads up by @moralmunky, but I wanted to ask beforehand.

I was theyā€™ve recently stopped. Iā€™ll have to check the debugs over the weekend.

Is there something I am missing that would cause it to not show up in integrations?

Did you put the files into the custom_components directory in your configuration folder?

yes they are in thereā€¦ the new ones with the config_flow.py etcā€¦

I still had the include from the old version in thereā€¦ should I remove that?

You can itā€™s not needed anymore to include the package version.

So I waited awhile, made sure everything was deleted and installed the component again today and it is working. The problem I have is I couldnā€™t get the mail-card to show up, I realized the sensor names had changed from the example but I also noticed I am missing sensor.mail_deliveries_today and sensor.mail_deliveries_message and Iā€™m not seeing a similar sensor that would be the proper one. Should those sensors be there? Or is it just the outdated example of the custom card that is throwing me off?

Make a template sensor, this is what I use:

- platform: template
  sensors:
    mail_deliveries_message:
      friendly_name: "Deliveries Summary"
      entity_id: 
        - sensor.mail_usps_mail
        - sensor.packages_in_transit
      value_template: > 
        {# Deliveries Sentence #}
          {% macro deliveries_sentence() -%}
                {%- if states("sensor.mail_usps_mail")|int == 0 -%}
                  No
                {%- else -%}
                  {{states("sensor.mail_usps_mail")|int}}
                {%- endif -%}
              {{' '}} 
                {%- if states("sensor.mail_usps_mail")|int <= 1 -%}
                  mail
                {%- else -%}
                  pieces of mail
                {%- endif -%}
              {{' '}}will be delivered.{{' '}} 
                {%- if states("sensor.packages_in_transit")|int == 0 -%}
                  No
                {%- else -%}
                  {{states("sensor.packages_in_transit")|int}}
                {%- endif -%}
              {{' '}} 
                {%- if states("sensor.packages_in_transit")|int == 1 -%}
                  package is
                {%- else -%}
                  packages are
                {%- endif -%}
              {{' '}}in transit.{{' '}}
          {%- endmacro %}
        {{deliveries_sentence()}}

Ok sorry I guess I just thought it was automatically generated with the integration.

Iā€™ve been absent. Finally had some time this week to upgrade HASS to 0.103.5 and to see what @firstof9 has been adding to ā€˜Mail and Deliveriesā€™. The integration setup is sweet! Iā€™m getting an error during from the email search that Iā€™m trouble shooting. Iā€™ve logged it on Github and will have time this weekend to fiddle with it.

That for the great strides in getting this modernized @firstof9. Iā€™m thrilled with what you have been able to add from where I left off.

1 Like

I got your integration working today. Thank you guys for putting the time into creating this for us. The only thing that doesnā€™t seem to work so far is the gif. All I see is the ā€œno mailā€ picture even though I can see the pictures in the actual email. The count does have the correct number I just canā€™t see the scans. Is it broken or did I miss something?

How are you running Hass?

Iā€™m running HassOS in a virtualbox

Ah ok. Iā€™m not sure on hassos but I know for docker I had to manually install imagemagick for the images to work.

Thanks, I just tried that by successfully installing imagemagick through SSH but it didnā€™t seem to work unfortunately.

Needs to be installed in the image I think so you need to get into the image. But again Iā€™m not am expert on hassos so idk is itā€™s needed or how youā€™d do it

So I switched to hass.io in a Ubuntu docker and installed imagemagick into the container itself to see if I can get this to work but now my path is different and I keep getting errors that the path doesnā€™t exist.

So if my path is /usr/share/hassio/homeassistant/www/mail_and_packages/ do I use that or just /homeassistant/www/mail_and_packages/ ? I seem to be getting errors with both.

When you click developer tools in hass and get the info page, what does it say the path to config.yaml is?