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

I added a Gmail integration no problem but now when adding one for my Hotmail address I get the error “user input malformed” on the second step. What am I doing wrong? Thanks!

Make sure you’re running the latest beta version, or enter "" into the Amazon Forwards option.

1 Like

If I get it through HACS is it already the beta version? Or do I need to get the beta somewhere else?

You only see betas in HACS if you turn on the “Show beta” option.

Ok now I have it all set up…I’m searching through this thread but hard to find how to set up images with the delivery notification. I see that for USPS it is mail_today.gif. How about for UPS, Fedex, Amazon? I don’t see how to know what to enter for those. Any tutorial for this? Thanks!

Only USPS and Amazon have camera entities.

Thank you. What would the Amazon gif name be?

It’s a camera entity.

Ok so is this used more often as a lovelace card or can it be used as a phone notification with an image? I’m a fairlly new HA user so trying to learn! Thanks!

You can do either, there’s a sensor that gives you the image URL and image path,
sensor.mail_image_url and sensor.mail_image_system_path

Using integration 0.3.3
I noticed I am not getting mail notification on my phone IOS 15.1
I checked automation and when I trigger it manually I get the notification on the phone just fine.
I have the notify service setup to send to my phone but I don’t get anything at all.
What do I need to look for?

Check your trigger, check the automation trace.

here is the config. Is there anything I need to change?

alias: Mail Notif - Mail Delieveries
trigger:
  - platform: state
    entity_id: sensor.mail_usps_mail
  - platform: state
    entity_id: sensor.mail_usps_delivering
  - platform: state
    entity_id: sensor.mail_fedex_packages
  - platform: state
    entity_id: sensor.mail_ups_packages
  - platform: state
    entity_id: sensor.mail_amazon_packages
condition:
  - condition: or
    conditions:
      - condition: template
        value_template: >-
          {{ ((as_timestamp(now()) -
          as_timestamp(states.sensor.mail_usps_mail.last_changed)) < 15 and
          states('sensor.mail_usps_mail') > 0) }}
      - condition: template
        value_template: >-
          {{ ((as_timestamp(now()) -
          as_timestamp(states.sensor.mail_packages_in_transit.last_changed)) <
          15 and states('sensor.mail_packages_in_transit') > 0) }}
      - condition: template
        value_template: >-
          {{ ((as_timestamp(now()) -
          as_timestamp(states.sensor.mail_ups_packages.last_changed)) < 15 and
          states('sensor.mail_ups_packages') > 0) }}
      - condition: template
        value_template: >-
          {{ ((as_timestamp(now()) -
          as_timestamp(states.sensor.mail_fedex_packages.last_changed)) < 15 and
          states('sensor.mail_fedex_packages') > 0) }}
      - condition: template
        value_template: >-
          {{ ((as_timestamp(now()) -
          as_timestamp(states.sensor.mail_amazon_packages.last_changed)) < 15
          and states('sensor.mail_amazon_packages') > 0) }}
action:
  - service: notify.mobile_app_iphone_12_pro_max
    data_template:
      title: '*Today''s Mail and Packages*'
      message: '{{ states(''sensor.mail_deliveries_message'')}}'
  - service: notify.mobile_app_iphone_12_pro_max
    data:
      message: Here is Today's coming Mail
      data:
        document:
          file: /config/www/images/mail_and_packages/mail_today.gif```

The image isn’t called mail_today.gif. The sensor sensor.mail_image_system_path will provide the correct image/path.

file: /config/www/images/mail_and_packages/sensor.mail_image_system_path

like this?

file: {{ states('sensor.mail_image_system_path') }}

Thank you for your patience with me :sweat_smile:
what about triggers do I need to change anything?

The triggers look fine, but since the image doesn’t exist that’s likely why it’s not firing off to your phone.
I bet you have a log entry stating as much as well.

I tried the automation and the data entry changed to this
‘document:
file:
‘[object Object]’: null’

is this normal? I am showing a mail image in the lovelace card though

Double check the wiki I believe @moralmunky has updated iOS notifications examples.

1 Like