USPS sensor HALF working

I am getting a LOT of errors in my log regarding the USPS sensor. Additionally, the package badge shows up on my control panel but the Mail badge does not.


2017-09-21 16:25:16 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.usps_mail fails
Traceback (most recent call last):
File “/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/helpers/”, line 225, in async_update_ha_state
yield from self.hass.async_add_job(self.update)
File “/usr/lib/python3.5/asyncio/”, line 380, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.5/asyncio/”, line 304, in _wakeup
File “/usr/lib/python3.5/asyncio/”, line 293, in result
raise self._exception
File “/usr/lib/python3.5/concurrent/futures/”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/sensor/”, line 107, in update
File “/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/util/”, line 306, in wrapper
result = method(*args, **kwargs)
File “/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/”, line 80, in update
self.packages = myusps.get_packages(self.session)
File “/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/myusps/”, line 177, in wrapped
return function(*args)
File “/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/myusps/”, line 208, in get_packages
dashboard = _require_elem(response, DASHBOARD_TAG, DASHBOARD_ATTRS)
File “/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/myusps/”, line 89, in _require_elem
raise ValueError(‘No element found’)
ValueError: No element found

I tried removing the .pickle file but still having the same problem.

I’m experiencing the same issue now and then.
The only way for me to get all things working again is to restart HA - sometimes I need to do it 2 or 3 times.

My usps setup was working some what ok till I upgraded to 0.54 today. Now Its showing " Components and platforms could not be set up:"

  • camera.usps
  • usps
    Please check your config

yeah… mine is completely broken as well now. I knew .54 had a breaking change for the USPS component, but I thought the docs would be upgraded with the fix as well.

I don’t think it has anything to do with .54 and I didn’t see any breaking changes for the USPS Sensor.
I’m still on 53.1 and have the same errors which started on the 21st.

sorry… didn’t mean breaking change, but I could have sworn there was something about an upgrade or fix for USPS in the PR, but can’t seem to find it now when I look at it in the release noted for .54 on github

maybe here:

I’m having issues too. I deleted the usps_cookies.pickle file to try to troubleshoot the USPS issue after upgrading to 0.54 - restarted Home Assistant and the cookies file did not reappear. I think there’s an issue related to the upgrade of sqlalchemy and maybe a permissions issue associated with the USPS sensor using an absolute path for the cookies database, this one:

I’ve got a similar problem, but with a different error message:

2017-09-24 10:06:57 ERROR (MainThread) [homeassistant.setup] Error during setup of component usps
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/", line 194, in _async_setup_component
    component.setup, hass, processed_config)
  File "/usr/lib/python3.5/asyncio/", line 361, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/", line 296, in _wakeup
  File "/usr/lib/python3.5/asyncio/", line 274, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/", line 48, in setup
    session = myusps.get_session(username, password, cookie_path=cookie)
  File "/etc/homeassistant/deps/lib/python3.5/site-packages/myusps/", line 288, in get_session
  File "/etc/homeassistant/deps/lib/python3.5/site-packages/requests_cache/", line 68, in __init__
    self.cache = backends.create_backend(backend, cache_name, backend_options)
  File "/etc/homeassistant/deps/lib/python3.5/site-packages/requests_cache/backends/", line 50, in create_backend
    return registry[backend_name](cache_name, **options)
  File "/etc/homeassistant/deps/lib/python3.5/site-packages/requests_cache/backends/", line 28, in __init__
    self.responses = DbPickleDict(location + extension, 'responses', fast_save=fast_save)
  File "/etc/homeassistant/deps/lib/python3.5/site-packages/requests_cache/backends/storage/", line 58, in __init__
    with self.connection() as con:
  File "/usr/lib/python3.5/", line 59, in __enter__
    return next(self.gen)
  File "/etc/homeassistant/deps/lib/python3.5/site-packages/requests_cache/backends/storage/", line 70, in connection
    con = sqlite.connect(self.filename)
sqlite3.OperationalError: unable to open database file

Not sure which database it’s referring to, all other devices can r/w to the db just fine. seems to fix the USPS bugs.

Sorry about all the hassle guys. USPS changed their site; and a few extra features were added to the dependency. Took a try or two to get it all working for everyone. Hopefully we should be all set as of 0.54.1

1 Like