USPS authentication failed

I have been trying to setup the USPS Component and no matter how i set it up i am getting “authentication failed” both my username and password are alpha-numeric (no symbols or special characters). I can copy paste the information in the secrets file directly to the usps site in a incognito window and it logs me in just fine. Anyone encounter this issue?

Configuration is fairly basic:

usps:
username: !secret myun
password: !secret uspspass

Error log:

2017-10-26 23:53:49 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=181 from 2017-10-27 04:53:17.439795)
2017-10-26 23:53:51 ERROR (SyncWorker_21) [homeassistant.components.usps] Could not connect to My USPS
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/components/usps.py", line 51, in setup
    cookie_path=cookie, cache_path=cache)
  File "/usr/local/lib/python3.6/site-packages/myusps/__init__.py", line 296, in get_session
    _login(session)
  File "/usr/local/lib/python3.6/site-packages/myusps/__init__.py", line 169, in _login
    raise USPSError('authentication failed')
myusps.USPSError: authentication failed
2017-10-26 23:53:51 ERROR (MainThread) [homeassistant.setup] Setup failed for usps: Component failed to initialize.
2017-10-26 23:53:51 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of sensor.usps. Setup failed for dependencies: usps
2017-10-26 23:53:51 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform sensor.usps: Could not setup all dependencies.
1 Like

+1 same here… I’ll be poking around to try and find a solution.

Ditto. Wonder if it got broken. :confused:

Same here, seems it stopped working a couple days ago.

2017-10-26 23:11:43 ERROR (SyncWorker_16) [homeassistant.components.usps] Could not connect to My USPS
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/components/usps.py", line 51, in setup
    cookie_path=cookie, cache_path=cache)
  File "/usr/lib/python3.6/site-packages/myusps/__init__.py", line 296, in get_session
    _login(session)
  File "/usr/lib/python3.6/site-packages/myusps/__init__.py", line 169, in _login
    raise USPSError('authentication failed')
myusps.USPSError: authentication failed
2017-10-26 23:11:43 INFO (MainThread) [homeassistant.setup] Setup of domain usps took 4.9 seconds.
2017-10-26 23:11:43 ERROR (MainThread) [homeassistant.setup] Setup failed for usps: Component failed to initialize.
2017-10-26 23:11:43 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of camera.usps. Setup failed for dependencies: usps
2017-10-26 23:11:43 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform camera.usps: Could not setup all dependencies.

Just tried to sign in manually via chrome, and USPS said the updated their login page and I should clear my cache…
I assume that broke the component.

Same issue here

I’m having the same issue. I’ve tried multiple different ways and copied and pasted my creds into their site just to verify. It still says could to connect.

they changed things, the author of the usps plugin has been alerted and last i knew was trying to update this. for now gonna have to disable.

1 Like

Is there some place we can track this?

Informed delivery website today: looks they are going thru some changes.

Has an issue been opened on GitHub? If so I would like to up-vote it.

@happyleaves the component maintainer has also an open issue here
https://github.com/happyleavesaoc/python-myusps/issues/9.

Same issue here. Hopefully it get’s fixed soon :slight_smile:

Since this has been broken for over a month, and there doesn’t appear to be any progress on it… Is there a way to put a warning on the component pages?

yeah the way i’ve gathered this component is dead, author apparntly couldn’t figure out anything. shame that they don’t think about stuff like this IMO and build out proper API’s for accessing stuff, this is the information age after all LOL.

The component author has put in a lot of effort trying to authenticate to the USPS site, but unfortunately USPS seems to be doing something pretty screwy with their login process.

I wrote a work around which leverages the daily emails which Informed Delivery sends and injects the counts via a command line sensor (it intentionally uses the same names as the USPS component, so any existing automation or scripts should pick it up). I should emphasize that this is a quick and dirty work around, and you should definitely use the component if it ever gets fixed.

You can find the code here, simply configure your IMAP settings at the beginning of the script and add the sensors to HASS:

Where do you place the check-mail.py after adding the IMAP?

It can be placed anywhere, you just have to specify the location in the command parameter of the command_line sensor. That being said, the example sensors are configured to look for the command at /data/scripts/usps/check-mail.py

I have the following in my sensors.yaml and added the check-mail.py file to my www(local) folder under a usps sub folder however, I am not seeing them in dev-states under entities. Any Idea what I might be doing wrong?

- platform: command_line
  name: 'USPS Mail'
  command: '/local/usps/check-mail.py letters'
  scan_interval: 3600
- platform: command_line
  name: 'USPS Packages'
  command: '/local/usps/check-mail.py packages'
  scan_interval: 3600