USPS - No Element Found


I am trying to configure USPS connector. This is the entry in configuration.yaml:

  - platform: usps
    username: !secret usps_username
    password: !secret usps_password
    name: USPS

When I restart my HA, I receive the following:


Home Assistant

Path to configuration.yaml: /home/homeassistant/.homeassistant

Developed by a bunch of awesome people.

Published under the Apache 2.0 license
Source: server — frontend-ui

Built using Python 3, Polymer 1.9.2, Icons by Google and

The following errors have been logged this session:
2017-07-29 14:51:02 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/", line 233, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/", line 381, in async_process_entity
    new_entity, self, update_before_add=update_before_add
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/", line 212, in async_add_entity
    yield from self.hass.async_add_job(entity.update)
  File "/usr/lib/python3.4/asyncio/", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/sensor/", line 124, in update
    self._state = len(myusps.get_mail(self._session))
  File "/home/homeassistant/.homeassistant/deps/myusps/", line 176, in wrapped
    return function(*args)
  File "/home/homeassistant/.homeassistant/deps/myusps/", line 229, in get_mail
    container = _require_elem(response, INFORMED_DELIVERY_TAG, INFORMED_DELIVERY_ATTRS)
  File "/home/homeassistant/.homeassistant/deps/myusps/", line 89, in _require_elem
    raise ValueError('No element found')
ValueError: No element found

Can someone help with this?
If I remove USPS from configuration, I do not have any errors at all.

Have you signed up for informed delivery?

Yes, I have. When I login to USPS website, I see there is one package is coming.

Informed Delivery is for mail, not packages.

Thank you, I missed that part. Now, when I opt-in for Informed delivery, I have the following errors. There are a few of them, but basically all the same. I am sure that user name and password are correct.

 File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/sensor/", line 78, in update 
  for package in myusps.get_packages(self._session):
 File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/myusps/", line 179, in wrapped 
 File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/myusps/", line 156, in _login
   raise USPSError('authentication failed')
 myusps.USPSError: authentication failed

Suddenly it started working. Not sure why. Well…

Thank you.