USPS authentication failed

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

Have you included sensors.yaml in your configuration.yaml?

Yes and all other sensors are working

What do you get if you run /local/usps/check-mail.py letters in a terminal?

No such file or directory. just to clarify I have placed the .py file in my main home assistant config under the www folder

In a terminal, go into the directory you’ve placed the check-mail.py file, and type pwd, then use that as the base path for the command parameter in the sensor.

Not sure what the issue was but tried again today and all is working! Awesome work around thank you!

It appears copying the raw data and pasting it did not format right possibly as saving your file directly to my folder location then changing the username and password made it respond in terminal but still does not show in dev-states

Great Job Added and worked right away… except yahoo expected INBOX to be Inbox… I see in your code you have scanned images… Is that able to be retrieved?

It’s possible to pull them out of the email, but I’m not sure how to make them available to HASS via a command line sensor.