post your config
I was basically just copying and pasting from the wiki:
- platform: template
sensors:
mail_deliveries_message:
friendly_name: "Deliveries Summary"
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()}}
it comes in without any indents on the ā- platformā part. I get the error above. If I highlight the entire thing, then hit ātabā, it indents everything accordingly, but it still gives the error above.
This sits below other sensors that Iāve defined.
You have this under your sensors:
setup then right?
Itās under the sensor: setup (without the āsā)
Youād need to put it under any other location youāve placed the template sensors in your file.
Ah, that was it - thank you!
I tried searching the thread, but wasnt able to find an answer, not to mention it being hard with almost 900 posts, but Iām having trouble getting the image to display on the lovelace card, running HassOS 5.4. Any potential solutions? Iāve tried several different image paths and reset browser cache.
Your mail GIF location likely needs to match the location of where itās set to in the Integration.
Awesome, got it working!
Iāve noticed a lot of errors on startup related to sensors not yet loaded. I saw it mentioned before but the only solution seemed to be to just ignore them? Is that still the case? Thanks in advance!
Those are warnings not errors, you can ignore them, but for mail_and_packages my sensors load in about 8.4 seconds thatās decent for something logging into email and doing a search
Ugh, My USPS digest email just came from a new address [email protected]
, because it didnāt match my filters. Why canāt they just leave well-enough alone?
Yes I just pushed a PR to fix that.
Our procedures were reversed. I posted here, then I saw your GH issue/PR
Answers why my USPS stopped working. Assume itās different as never compared. Itās been a hot minute since Iāve had to change anything on this. Where do you change the email addresses it looks for?
NOTE: Found it in the const.py. Now to know if itās just that address or the prior one will come on the weekdays or something weird like that. Guessing you canāt comma separate values.
Thanks.
JR
You donāt have to change anything, the latest version fixes it
After updating to 118.0 it appears that the Mail and Packages module is now using Time (UTC) and longer using local time as the mail_updated sensor is now 5 hours ahead though my other time sensors are showing the correct time. Is there a simple thing I can do to correct this?
Also, it is no longer showing correct mail status showing no mail even though my USPS email shows there will be mail today.
Looks like an issue in HA, please refer to the 0.118 blog thread. Thereās been quite a few posts regarding it.
If you are running just the docker container try adding:
- /etc/localtime:/etc/localtime:ro
to you devices mappings, this should import your local time and timezone into the container.
Full example:
volumes:
- /home/docker/home-assistant:/config
- /var/run/docker.sock:/var/run/docker.sock
- /etc/localtime:/etc/localtime:ro
Perhaps itās discussed in this thread and missed it but are we supposed to remove our entity_id values and be done with it for our templates? I am getting an error/warning in my logs and imagine from what I read Iām supposed to remove the whole entity_id and the indented items from my sensor like below?
Thanks.
JR
Yes you can remove them, theyāre no longer required to be there.
Just updated with the latest beta I believe and all my entities are gone.
Noticed a lot of the jobs and stuff are now _2 and all the entnties seem lilke they may have all be replaced with _2 variants. What happened?