Thanks for following up. I followed the instructions on your github, and used the example code.
Here is the config from configuration.yaml:
sensor:
- platform: template
sensors:
mail_deliveries_message:
friendly_name: "Deliveries Summary"
entity_id:
- sensor.mail_usps_mail
- sensor.mail_usps_delivering
- sensor.mail_fedex_delivering
- sensor.mail_ups_delivering
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 -%}
pieces of mail
{%- else -%}
pieces of mail
{%- endif -%}
{{' '}}will be delivered.{{' '}}
{%- if states("sensor.mail_usps_delivering")|int == 0 -%}
No
{%- else -%}
{{states("sensor.mail_usps_delivering")|int}}
{%- endif -%}
{{' '}}
{%- if states("sensor.mail_usps_delivering")|int == 1 -%}
USPS package is
{%- else -%}
USPS packages are
{%- endif -%}
{{' '}}in transit.{{' '}}
{%- if states("sensor.mail_fedex_delivering")|int == 0 -%}
No
{%- else -%}
{{states("sensor.mail_fedex_delivering")|int}}
{%- endif -%}
{{' '}}
{%- if states("sensor.mail_fedex_delivering")|int == 1 -%}
FedEx package is
{%- else -%}
Fedex packages are
{%- endif -%}
{{' '}}in transit.{{' '}}
{%- if states("sensor.mail_ups_delivering")|int == 0 -%}
No
{%- else -%}
{{states("sensor.mail_ups_delivering")|int}}
{%- endif -%}
{{' '}}
{%- if states("sensor.mail_ups_delivering")|int == 1 -%}
UPS package is
{%- else -%}
UPS packages are
{%- endif -%}
{{' '}}in transit.{{' '}}
{%- if states("sensor.mail_amazon_packages")|int == 0 -%}
No
{%- else -%}
{{states("sensor.mail_amazon_packages")|int}}
{%- endif -%}
{{' '}}
{%- if states("sensor.mail_amazon_packages")|int == 1 -%}
Amazon package is
{%- else -%}
Amazon packages are
{%- endif -%}
{{' '}}in transit.{{' '}}
{%- endmacro %}
{{deliveries_sentence()}}
And this is what I have in my automations.yaml (currently commented out):
#- alias: Mail Notif - Mail Delieveries
# initial_state: 'on'
# trigger:
# - platform: state
# entity_id: sensor.mail_usps_mail
# - platform: state
# entity_id: sensor.mail_usps_delivering
# condition:
# - condition: or
# conditions:
# - condition: template
# value_template: '{{ states(''sensor.mail_usps_mail'') | int > 0 }}'
# - condition: template
# value_template: '{{ states(''sensor.mail_usps_delivering'') | int > 0 }}'
# action:
# - service: notify.notify
# data_template:
# title: '*Today''s Mail and Packages*'
# message: '{{ states(''sensor.mail_deliveries_message'')}}'
# - service: notify.notify
# data:
# message: Here is the mail
# data:
# document:
# file: /config/images/mail_and_packages/mail_today.gif