Coder Social home page Coder Social logo

Comments (7)

codypet avatar codypet commented on August 28, 2024

I upgraded to 0.94.3 and Python 3.7 and my errors look like this now.
Error while setting up platform mail_and_packages Traceback (most recent call last): File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform SLOW_SETUP_MAX_WAIT) File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for return fut.result() File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/home/homeassistant/.homeassistant/custom_components/mail_and_packages/sensor.py", line 85, in setup_platform add_devices([MailCheck(),USPS_Mail(),USPS_Delivering(),USPS_Delivered(),UPS_Delivering(),UPS_Delivered(),FEDEX_Delivering(),FEDEX_Delivered()]) File "/home/homeassistant/.homeassistant/custom_components/mail_and_packages/sensor.py", line 137, in __init__ self.update() File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/util/__init__.py", line 224, in wrapper result = method(*args, **kwargs) File "/home/homeassistant/.homeassistant/custom_components/mail_and_packages/sensor.py", line 159, in update account = login() File "/home/homeassistant/.homeassistant/custom_components/mail_and_packages/sensor.py", line 360, in login account = imaplib.IMAP4_SSL(host, port) File "/usr/lib/python3.7/imaplib.py", line 1288, in __init__ IMAP4.__init__(self, host, port) File "/usr/lib/python3.7/imaplib.py", line 201, in __init__ self._connect() File "/usr/lib/python3.7/imaplib.py", line 249, in _connect raise self.error(self.welcome) imaplib.IMAP4.error: None

Also I noticed the Lovelace resource points to that mail_card folder. Should it be the mail_and_packages folder?

from home-assistant-mail-and-packages.

moralmunky avatar moralmunky commented on August 28, 2024

Double check that you have changed all of the required configuration information inside the sensor.py file as indicated in the instructions. Putting the settings in the configuration file are not implemented yet. Yes, the Lovelace resource should point to mail_and_packages, this instruction has been updated.

There is a known asyncio issue.

from home-assistant-mail-and-packages.

codypet avatar codypet commented on August 28, 2024

So this morning it started working for mail, but not packages from USPS. I'm not sure if this is the case for everyone's email, but I get my "informed delivery daily digest" which states what mail is coming and a tracking number from whatever package is being delivered today from [email protected] which is consistent with the documentation. The package information itself (info about it actually being delivered, or what day its expected when it originates) comes from [email protected]. I didn't see that in the documentation. Perhaps I'm missing it? Is this common on everyone elses emails?

from home-assistant-mail-and-packages.

moralmunky avatar moralmunky commented on August 28, 2024

Are you referring to documentation as the readme in the repository? Does this answer your question?

The only function that reads the content is the USPS Mail, only the image attachments. Everything else goes off of the subject lines, not the content. Below are the possible subject lines. I only have it set up to look for the current day notifications (if they are provided by the shipper) Out for Delivery and Delivered.

Here are examples of email subject lines and additional info contained in the body if it is not present in the subject line.

FedEx Subject Lines

  • Package is received by FedeEx: Your delivery is scheduled for Tuesday, 07/09 by 10:30 am
  • Morning of delivery: Your delivery is scheduled for today, 07/09 by 10:30 am
  • Delivered: FedEx Shipment 106125175432: Your package has been delivered, date and time in email body
  • Pickup Ready: Your package is ready for pickup at FedEx Office

UPS Subject Lines

  • Package is received by UPS: UPS Ship Notification, Tracking number ##############, Scheduled Delivery Date in email body
  • Day before notification: UPS Update: Package Scheduled for Delivery Tomorrow, estimated date and time in email body
  • Morning of delivery: Your delivery is scheduled for today, 07/09 by 10:30 am
  • Out for delivery: UPS Update: Follow Your Delivery on a Live Map
  • Delivered: Your UPS Package was delivered, date and time in email body
  • Pickup Ready: Your package is ready for pickup at FedEx Office

USPS Mail

  • From the informed delivery, number of images = number of pieces to expect

USPS Packages

  • Two days before: USPS® Expected Delivery on Monday, July 8, 2019 arriving by 8:00pm ###########
  • Updated delivery day: USPS® Expected Delivery on Monday, July 8, 2019 arriving by 8:00pm ###########
  • Day of delivery: USPS® Expected Delivery on Monday, July 8, 2019 arriving by 8:00pm ###########
  • Out for delivery: USPS® Expected Delivery on Tuesday, May 14, 2019 arriving by 8:00pm 9361269903503785025706, email body specifies out for delivery
  • Delivered: USPS® Item Delivered, Front Desk/Reception/Mail Room ##############

from home-assistant-mail-and-packages.

codypet avatar codypet commented on August 28, 2024

My mistake. I'm still learning the lingo, but when I were referring to "documentation" I was referring to whats included in sensor.py.

I saw this in sensor.py and like you're saying it goes by subject line, but I wasn't sure if the email it has ahead of it made a difference.

USPS_Email = '[email protected]' USPS_Mail_Subject = 'Informed Delivery Daily Digest' USPS_Delivering_Subject = 'Expected Delivery on' USPS_Delivered_Subject = 'Item Delivered'
Since I was getting the mail portion working, but not the package portion I thought maybe it had something to do with the fact that they're coming from two different emails. This image is a screengrab of the emails I received this morning from the post office related to it.
email

from home-assistant-mail-and-packages.

moralmunky avatar moralmunky commented on August 28, 2024

I see what you are saying. Another USPS email address variable needs to be created for the packages. I had the following to mine.

`USPS_Mail_Email = '[email protected]'
USPS_Packages_Email = '[email protected]''

I am going to updated the code in my repository after I look through your add-config branch. This will include the changes I made to the functions where the email checking is pulled out of the entities into it's own separate function.

from home-assistant-mail-and-packages.

moralmunky avatar moralmunky commented on August 28, 2024

Adding the previous variable corrected the issue.

from home-assistant-mail-and-packages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.