USPS Mail Camera

Sorry, I have no idea.

Maybe @mezz64 can shed some light on this.

Have you checked out this page?

Yes, I know how to send attachments, but not sure best way to get each image separately to send, right now it’s just a camera component that changes every so many seconds

@BurnsHA I’m not sure this is possible. Only thing I could think of is using something external to take captures of the camera feed based on the interval you define to save each image. You could use the value of the sensor to know how many captures to take. Then send those images in the push notification.

What image are you are running? I tried this on the hassbian image and it does not work.

I wrote that for the Python vEnv install. If you can show me the output of sudo find / -name usps.py on your system I could probably modify it to work for you.

Looks like it should work for HASSBian as well.

pi@HASSBian:/ $ sudo -s
root@HASSBian:/# find / -name usps.py
/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/sensor/usps.py
/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/camera/usps.py
/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/usps.py

UPDATE: I got it working correctly I believe now.

For those who want to keep a clean config and the USPS info in another file this is what I did.
In the configuration.yaml
usps: !include sensors/usps.yaml

In the usps.yaml
username: XXXXXXX
password: XXXXXXX

@mezz64

Just noticed the following errors, USPS images are loaded .

2017-07-31 20:53:32 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.usps_mail fails
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.4/site-packages/myusps/__init__.py", line 176, in wrapped
    return function(*args)
  File "/srv/homeassistant/lib/python3.4/site-packages/myusps/__init__.py", line 229, in get_mail
    container = _require_elem(response, INFORMED_DELIVERY_TAG, INFORMED_DELIVERY_ATTRS)
  File "/srv/homeassistant/lib/python3.4/site-packages/myusps/__init__.py", line 86, in _require_elem
    raise USPSError('Not logged in')
myusps.USPSError: Not logged in

This unfortunately appears to be the same issue that has plagued many in the past. Have you stoped Home Assistant, removed the usps_cookies.pickle file and restarted?

Yes, tried a couple times.

Did you recently update? I updated and had a similar issue. I ended up having to redo the usps mail plug in. After doing that it started working correctly again.

Yes, upgraded to 0.50.1 then noticed the errors.

Rerun the patches that @mezz64 has made and all worked well for me.

Anyone still having login/authentication issues please try the file set on the pending PR for these changes. (#8679) It points to a new version of the myusps library that has a change merged in that fixed all the login problems in my local testing.

1 Like

Are these changes in your github branch?

Yes. It’s the same files, the PR is based on my usps_cam branch. You want to make sure you are on version 1.1.3 of the myusps library.

Can anyone tell my why this won’t trigger?

  • id: no_mail_alert
    alias: No Mail Alert
    trigger:
    platform: numeric_state
    entity_id: sensor.usps_mail
    below: 1
    action:
    • service: notify.alert
      data:
      message: Today, there will be no mail delivered! Yay! No bills!

Is sensor.usps_mail an int? (Does it matter?)

I think it’s because the sensors didn’t specify unit of measurement values and as a result were not interpreted as numbers. I just pushed another commit to fix this, give it a try.

so do i just need to go download the latest versions of the files?