Hi Everyone,
So i just installed the Mail & Packages integration and it’s great and everything is working fine. That said, HA is now throwing me a whole bunch of errors even though my config is claiming to be okay. I noticed this issue when I went to restart HA through server controls… it wouldn’t let me do that OR validate my configuration. I think it has something to do with the fact that I am running two instances of Mail & Packages and that maybe I setup the platform templates incorrectly, but I can’t pin it down with the limited amount of HA knowledge that I have. Any help here from someone who actually knows what they’re doing would be greatly appreciated! Thanks.
Here is my config.yaml:
##DUCKDNS.ORG##
http:
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
# Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
##THEMES##
frontend:
themes: !include_dir_merge_named themes
##LIGHTS##
lutron_caseta:
host: xxxxxxx
keyfile: /ssl/lutron/caseta.key
certfile: /ssl/lutron/caseta.crt
ca_certs: /ssl/lutron/caseta-bridge.crt
###Sensors###
#Waze#
sensor:
- platform: waze_travel_time
name: "Seth to Home"
origin: device_tracker.seth_iphone
destination: 'xxxx'
region: 'US'
- platform: waze_travel_time
name: "Amanda to Home"
origin: device_tracker.amanda_iphone
destination: 'xxxxx'
region: 'US'
- platform: waze_travel_time
name: "Old Navy"
origin: 'xxxxx'
destination: 'xxxxx'
region: 'US'
- platform: waze_travel_time
name: "Ariat"
origin: 'xxxxx'
destination: 'xxxxx'
region: 'US'
- platform: waze_travel_time
name: "Rocklin"
origin: 'xxxxx
destination: 'xxxxx'
region: 'US'
- platform: waze_travel_time
name: "Heber, UT"
origin: 'xxxxx'
destination: 'xxxxx'
region: 'US'
##Mail and Packages##
- platform: template
sensors:
mail_deliveries_message:
name: "Deliveries Summary Amanda"
value_template: >
{# Deliveries Sentence #}
{% macro deliveries_sentence() -%}
{%- if states("sensor.mail_usps_mail_2")|int == 0 -%}
No
{%- else -%}
{{states("sensor.mail_usps_mail_2")|int}}
{%- endif -%}
{{' '}}
{%- if states("sensor.mail_usps_mail_2")|int <= 1 -%}
pieces of mail
{%- else -%}
pieces of mail
{%- endif -%}
{{' '}}will be delivered.{{' '}}
{%- if states("sensor.mail_usps_delivering_2")|int == 0 -%}
No
{%- else -%}
{{states("sensor.mail_usps_delivering_2")|int}}
{%- endif -%}
{{' '}}
{%- if states("sensor.mail_usps_delivering_2")|int == 1 -%}
USPS package is
{%- else -%}
USPS packages are
{%- endif -%}
{{' '}}in transit.{{' '}}
{%- if states("sensor.mail_fedex_delivering_2")|int == 0 -%}
No
{%- else -%}
{{states("sensor.mail_fedex_delivering_2")|int}}
{%- endif -%}
{{' '}}
{%- if states("sensor.mail_fedex_delivering_2")|int == 1 -%}
FedEx package is
{%- else -%}
Fedex packages are
{%- endif -%}
{{' '}}in transit.{{' '}}
{%- if states("sensor.mail_ups_delivering_2")|int == 0 -%}
No
{%- else -%}
{{states("sensor.mail_ups_delivering_2")|int}}
{%- endif -%}
{{' '}}
{%- if states("sensor.mail_ups_delivering_2")|int == 1 -%}
UPS package is
{%- else -%}
UPS packages are
{%- endif -%}
{{' '}}in transit.{{' '}}
{%- if states("sensor.mail_amazon_packages_2")|int == 0 -%}
No
{%- else -%}
{{states("sensor.mail_amazon_packages_2")|int}}
{%- endif -%}
{{' '}}
{%- if states("sensor.mail_amazon_packages_2")|int == 1 -%}
Amazon package is
{%- else -%}
Amazon packages are
{%- endif -%}
{{' '}}in transit.{{' '}}
{%- endmacro %}
{{deliveries_sentence()}}
mail_deliveries_message2:
name: "Deliveries Summary Seth"
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()}}
##SPOTIFY##
spotify:
client_id: xxxx
client_secret: xxxx
##SPOTCAST##
spotcast:
sp_dc: xxx
sp_key: xxx
##Google Calendar##
google:
client_id: !secret google_client_id_calendar
client_secret: !secret google_client_secret_calendar
##Stream##
stream:
##Camera##
camera:
- platform: local_file
file_path: /config/images/amanda/mail_and_packages/
name: mail_usps_2
- platform: local_file
file_path: /config/images/mail_and_packages/
name: mail_usps
Here are the error logs it’s throwing:
Logger: homeassistant.config
Source: helpers/config_validation.py:755
First occurred: 10:26:59 AM (1 occurrences)
Last logged: 10:26:59 AM
Unknown error validating config for template platform for sensor component with PLATFORM_SCHEMA
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config.py”, line 831, in async_process_component_config
p_validated = platform.PLATFORM_SCHEMA(p_config) # type: ignore
File “/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py”, line 272, in call
return self._compiled([], data)
File “/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py”, line 594, in validate_dict
return base_validate(path, iteritems(data), out)
File “/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py”, line 386, in validate_mapping
cval = cvalue(key_path, value)
File “/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py”, line 817, in validate_callable
return schema(data)
File “/usr/src/homeassistant/homeassistant/helpers/config_validation.py”, line 470, in verify
return cast(Dict, schema(value))
File “/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py”, line 272, in call
return self._compiled([], data)
File “/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py”, line 594, in validate_dict
return base_validate(path, iteritems(data), out)
File “/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py”, line 386, in validate_mapping
cval = cvalue(key_path, value)
File “/usr/local/lib/python3.8/site-packages/voluptuous/validators.py”, line 215, in _run
return self._exec(self._compiled, value, path)
File “/usr/local/lib/python3.8/site-packages/voluptuous/validators.py”, line 338, in _exec
v = func(path, v)
File “/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py”, line 817, in validate_callable
return schema(data)
File “/usr/src/homeassistant/homeassistant/helpers/config_validation.py”, line 755, in validator
if key in config:
TypeError: argument of type ‘NoneType’ is not iterable