Both Entity and friendly name’s are the same.
Only noticed within the last hour.
I’m sure it would be rectified shortly, as he was able to come up with this awesome component
For anyone else wondering, the folder is located in the following location.
/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components
Camera entity naming is fixed now in my repo. I was hoping for a way to display the date, but it doesn’t look possible at the moment. Maybe something to work into a rev2.
I’m going to resist any more changes unless someone reports something else broken. If all is well by end of the day tomorrow i’ll put in a PR to get this merged into hass.
Cool.
Will it auto update the images tomorrow?
It should, however I have noticed issues with the myusps library not returning updated data (this exists with the existing component as well in my tests). I did make a change to explicitly pass in the date to the request function, but I won’t know until tomorrow morning rolls around if it cleared up the issue.
Please post here how it works for you.
Will do.
Thanks.
Images have been updated.
I’m having some trouble making this work. I am running HASS 49.1 on Ubuntu x86 in a Python venv. Here is the process I used to deploy the 3 scripts:
sudo -s
cd $(ls -d1v /srv/homeassistant/lib/python* | tail -n1)/site-packages/homeassistant/components
wget https://raw.githubusercontent.com/mezz64/home-assistant/usps_cam/homeassistant/components/usps.py
chown homeassistant:homeassistant usps.py
chmod 664 usps.py
cd sensor
rm usps.py
wget https://raw.githubusercontent.com/mezz64/home-assistant/usps_cam/homeassistant/components/sensor/usps.py
chown homeassistant:homeassistant usps.py
chmod 664 usps.py
cd ../camera
wget https://raw.githubusercontent.com/mezz64/home-assistant/usps_cam/homeassistant/components/camera/usps.py
chown homeassistant:homeassistant usps.py
chmod 664 usps.py
In my configuration.yaml
I’ve commented out the usps sensor and added the following lines:
usps:
username: <user>
password: <password>
name: Incoming Mail
interval: 10
I do have mail images for today’s mail on the usps.gov dashboard, but I don’t see any images in the card. Have I deployed this correctly? Am I just looking in the wrong spot?
What is the state under dev-state for sensor.usps_mail?
Do you have camera.usps_mail as an entity?
entity: sensor.incoming_mail_mail
state: 3
attributes:
date: 2017-07-27
attribution: Information provided by www.usps.com
friendly_name: Incoming Mail mail
icon: mdi:mailbox
entity: sensor.incoming_mail_packages
state: 4
attributes:
undeliverable_as_addressed: 1
departed_shipping_partner_facility: 2
out_for_delivery: 1
attribution: Information provided by www.usps.com
friendly_name: Incoming Mail packages
icon: mdi:package-variant-closed
The only camera entity I have is my existing (actual) camera. Should one be created somewhere or do I need to define it somehow?
It should have been created.
grep -i "camera" home-assistant.log
2017-07-27 11:10:29 ERROR (MainThread) [homeassistant.components.camera] Error while setting up platform usps
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/camera/usps.py", line 27, in setup_platform
add_devices([USPSCamera(hass, usps)])
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/camera/usps.py", line 52, in __init__
FileNotFoundError: [Errno 2] No such file or directory: '/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/camera/nomail.jpg'
Looks like it’s missing a nomail.jpg
, which I don’t find in the github repo. I’ll put a dummy file in there and see how it goes.
See post above.
https://github.com/mezz64/home-assistant/blob/usps_cam/homeassistant/components/camera/nomail.jpg
What is the reason for needing to pass the date explicitly to the myusps library?
My sensor showing the number of mail items is correct and does update accordingly, but the images fail to load. I’m just curious what might be causing this.
That fixed it! For anyone following along at home, here is the install procedure that resulted in a working configuration:
sudo -s
cd $(ls -d1v /srv/homeassistant/lib/python* | tail -n1)/site-packages/homeassistant/components
wget https://raw.githubusercontent.com/mezz64/home-assistant/usps_cam/homeassistant/components/usps.py
chown homeassistant:homeassistant usps.py
chmod 664 usps.py
cd sensor
rm usps.py
wget https://raw.githubusercontent.com/mezz64/home-assistant/usps_cam/homeassistant/components/sensor/usps.py
chown homeassistant:homeassistant usps.py
chmod 664 usps.py
cd ../camera
wget https://raw.githubusercontent.com/mezz64/home-assistant/usps_cam/homeassistant/components/camera/usps.py
chown homeassistant:homeassistant usps.py
chmod 664 usps.py
wget https://raw.githubusercontent.com/mezz64/home-assistant/usps_cam/homeassistant/components/camera/nomail.jpg
chown homeassistant:homeassistant nomail.jpg
chmod 664 nomail.jpg
I was getting unreliable results allowing the myusps library to update the date. I don’t know why exactly as it should work just fine, but explicitly passing in the date from hass has made things update correctly for me.
For your images problem, enable debug logging on the usps camera component. I create a log entry when images are fetched, make sure that is happening.
What would be the best way to go about sending a notification with the number of items being delivered and the image of each one? I was going to try and just use my existing notify component I have setup but not sure best way to get all the images with the number changing every day. Any thoughts?
Once you “Opt-In” to Informed Delivery on USPS Site, you should be receiving an email with all the images.
Well I would like to do something like an iOS push notification with the images in it instead of the email, what would it take to be able to send each of them images or have them stored locally?