moralmunky / Home-Assistant-Mail-And-Packages

Home Assistant integration providing day of package counts and USPS informed delivery images.
MIT License
636 stars 78 forks source link

[Feature Request] Support for an Amazon one time password sensor. #896

Open julianrinaldi opened 5 months ago

julianrinaldi commented 5 months ago

Is your feature request related to a problem? Please describe. Amazon has started requiring that delivery drivers need to be given a one time password for certain more expensive orders. Even though I have a package delivery box that they use 95% of the time now (finally), certain orders still require the one time password. I've had to have a few deliveries redelivered due to not being able to give them the code when I'm away. Amazon says you need to give the code in person, but the drivers don't care. So I've been putting the code on the screen on my doorbell and directing them that the code is there with a TTS notification, and it works great. It would be nice if the integration could grab this code and store it as a sensor so it can automatically update my doorbell.

Here is an example of the email with the one time password: CleanShot 2024-05-30 at 20 21 48@2x

I suppose there could be times where you have more than one delivery requiring a one time password in a day, so putting them all in the same sensor, or having individual sensors could work.

Thanks!

firstof9 commented 5 months ago

Is there a plain text version of the email sent as well?

julianrinaldi commented 5 months ago

Not that I know of. I can forward you the email I got if it would help.

firstof9 commented 5 months ago

Are you using gmail?

julianrinaldi commented 5 months ago

No a personal domain.

firstof9 commented 5 months ago

If you can somehow check the raw message, it'll tell you something like multipart message, then have an html version and a plain text version.

Are you using an email client or is it webmail based?

julianrinaldi commented 5 months ago

Yes, it does have a plain text version.

CleanShot 2024-06-03 at 08 43 19@2x

firstof9 commented 5 months ago

Excellent, that's what I needed. I'll see what I can do.

julianrinaldi commented 5 months ago

Thanks so much!

firstof9 commented 5 months ago

@julianrinaldi what's the subject on these OTP emails? Also is there a specific email address the come from?

Thanks!

julianrinaldi commented 5 months ago

Arriving Today: A one-time password is required for your Amazon deliveryRegards,Julian @.On Jun 9, 2024, at 7:42 PM, Chris @.> wrote: @julianrinaldi what's the subject on these OTP emails?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

firstof9 commented 5 months ago

Excellent, would you be able to provide a raw email with your email address redacted and the amazon URLs mangled so I can add it to to tests, that would be great. you can send it to firstof9@gmail.com

Thanks again!