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.

Log:

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/entity.py”, line 225, in async_update_ha_state
yield from self.hass.async_add_job(self.update)
File “/usr/lib/python3.5/asyncio/futures.py”, line 380, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.5/asyncio/tasks.py”, line 304, in _wakeup
future.result()
File “/usr/lib/python3.5/asyncio/futures.py”, line 293, in result
raise self._exception
File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/sensor/usps.py”, line 107, in update
self._usps.update()
File “/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/util/init.py”, line 306, in wrapper
result = method(*args, **kwargs)
File “/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/usps.py”, line 80, in update
self.packages = myusps.get_packages(self.session)
File “/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/myusps/init.py”, line 177, in wrapped
return function(*args)
File “/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/myusps/init.py”, line 208, in get_packages
dashboard = _require_elem(response, DASHBOARD_TAG, DASHBOARD_ATTRS)
File “/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/myusps/init.py”, 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:
https://github.com/home-assistant/home-assistant/pull/9540

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:

https://github.com/home-assistant/home-assistant/pull/5358

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/setup.py", line 194, in _async_setup_component
    component.setup, hass, processed_config)
  File "/usr/lib/python3.5/asyncio/futures.py", line 361, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/usps.py", line 48, in setup
    session = myusps.get_session(username, password, cookie_path=cookie)
  File "/etc/homeassistant/deps/lib/python3.5/site-packages/myusps/__init__.py", line 288, in get_session
    expire_after=cache_expiry)
  File "/etc/homeassistant/deps/lib/python3.5/site-packages/requests_cache/core.py", 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/__init__.py", line 50, in create_backend
    return registry[backend_name](cache_name, **options)
  File "/etc/homeassistant/deps/lib/python3.5/site-packages/requests_cache/backends/sqlite.py", 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/dbdict.py", line 58, in __init__
    with self.connection() as con:
  File "/usr/lib/python3.5/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "/etc/homeassistant/deps/lib/python3.5/site-packages/requests_cache/backends/storage/dbdict.py", 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.

https://github.com/home-assistant/home-assistant/pull/9557 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