Home Assistant Email Sensor with Tracking Numbers

Home Assistant Email Sensor

Gets emails from IMAP and parses out any tracking numbers. Goes well with the tracking-number-card for lovelace!

Supported Emails

  • Adam & Eve
  • Amazon
  • Ali Express
  • B&H Photo
  • Bespoke Post
  • Best Buy
  • Chewy
  • DHL
  • Dollar Shave Club
  • DSW
  • eBay
  • FedEx
  • Georgia Power
  • Google Express
  • Groupon
  • Manta Sleep
  • Monoprice
  • NewEgg
  • Nuleaf
  • Paypal
  • Philips Hue
  • Prusa
  • Reolink
  • Rockauto
  • Swiss Post
  • Target
  • Timeless
  • UPS
  • USPS
  • Wyze
  • Zazzle

If you want support for tracking, forward me the email (ljmerza at gmail) and open an issue.


GitHub Release
License

Project Maintenance
GitHub Activity

Installation

  • Add the email folder in your custom_components folder
sensor:
  - platform: email
    email: !secret my_email
    password: !secret my_email_password
  • If the component doesn’t load this might be due to Home Assistant not installing the requirements automatically through the manifests file. You can install them manaually by running pip install beautifulsoup4==4.7.1 imapclient==2.1.0 mail-parser==3.9.3
  • If you use 2 factor authentication for Google you’ll need to create an app password. See more details here

Options

Name Type Requirement default Description
email string Required email address
password string Required email password
imap_server string Optional imap.gmail.com IMAP server address>
imap_port number Optional 993 IMAP port
folder string Optional INBOX Which folder to pull emails from
ssl boolean Optional true enable or disable SSL when using IMAP
days_old number Optional 30 how many days of emails to retrieve

Enjoy my card? Help me out for a couple of :beers: or a :coffee:!

coffee

1 Like

Trying to set this up but I dont see the Node-red part… Is node-red needed?

nope, node-red is not needed. The ticker number parsers are in the email sensor itself.

OK, I saved the email folder in my custom_components folder and created the sensor but am getting the error below. Any idea what the issue may be? I am running Hassio .91.4

Fri Apr 26 2019 13:53:09 GMT-0500 (Central Daylight Time)
Error while setting up platform email
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/email/sensor.py", line 43, in setup_platform
    from imapclient import IMAPClient
ModuleNotFoundError: No module named 'imapclient'

for some reason ha isn’t installing the python libraries. the sensor needs: beautifulsoup4 imapclient mail-parser

you can install then manually

where did you find that error?

under Developer tools/info.

Hassio doesn’t allow to manually install the needed (or any other) python libraries (simply, there’s no pip or pip3 since it is running in a container). So, unfortunately, the integration is not working in Hassio. Or, maybe, there is any workaround?

Thanks for this great component!
Feature request: I would also like to be able to add tracking numbers manually :smiley:

Anyone use yahoo imap with success instead of gmail??