Home-Assistant-Mail-And-Packages icon indicating copy to clipboard operation
Home-Assistant-Mail-And-Packages copied to clipboard

[Feature Request] add amazon.es to amazon domains

Open tretabyte opened this issue 2 years ago • 29 comments

Is your feature request related to a problem? Please describe. Looking at amazon domains already supported I can't find amazon.es hence the request

Describe the solution you'd like n/a

Describe alternatives you've considered n/a

Additional context I can help with examples of emails sent by amazon.es for parcel deliveries

tretabyte avatar Jul 27 '22 23:07 tretabyte

Yes please provide some example emails, thank you.

firstof9 avatar Jul 29 '22 15:07 firstof9

Hi Chris,

I’m attaching 2 email samples. Amazon.es provides service in both spanish (for Spain) and Portuguese (for Portugal) so I’m attaching both if you want to add both ☺

Regards,

From: Chris @.*** Sent: 29 de julho de 2022 16:54 To: moralmunky/Home-Assistant-Mail-And-Packages @.> Cc: tretabyte @.>; Author @.***> Subject: Re: [moralmunky/Home-Assistant-Mail-And-Packages] [Feature Request] add amazon.es to amazon domains (Issue #698)

Yes please provide some example emails, thank you.

— Reply to this email directly, view it on GitHubhttps://github.com/moralmunky/Home-Assistant-Mail-And-Packages/issues/698#issuecomment-1199599185, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOPJ5ZMRSRMO7PAZ5QDKMWDVWP5BNANCNFSM543LVVZA. You are receiving this because you authored the thread.Message ID: @.@.>>

tretabyte avatar Jul 29 '22 16:07 tretabyte

You have to do it from github's website.

firstof9 avatar Jul 29 '22 16:07 firstof9

sorry my bad, let's see if I can attach them here then .

tretabyte avatar Aug 01 '22 13:08 tretabyte

Sorry these are some kind of binary format, and I can't open them.

firstof9 avatar Aug 01 '22 16:08 firstof9

you can't open what's inside the zip? I zipped 2 emails saved from outlook, let's try like this image image

tretabyte avatar Aug 01 '22 16:08 tretabyte

I might be able to do something with this. What does the subject line look like when a package has been delivered?

firstof9 avatar Aug 01 '22 16:08 firstof9

We never get an email confirming it got delivered, at least not from amazon

tretabyte avatar Aug 01 '22 16:08 tretabyte

Yikes ok

firstof9 avatar Aug 01 '22 16:08 firstof9

Please test out 0.3.5-b6 it should pickup your amazon emails now.

firstof9 avatar Aug 01 '22 17:08 firstof9

Hi @firstof9 been testing version 0.3.5-b6 but with no luck, just to make sure everything was up to date I deleted and force downloaded the beta version, redid all configurations but nothing seems to be picked up. right now I have 3 emails that should be picked up but nothing shows as per screenshot image

tretabyte avatar Aug 02 '22 11:08 tretabyte

Please enable debugging so we can see what's going on.

firstof9 avatar Aug 02 '22 15:08 firstof9

I think I found the issue, I'm attaching the debug log but looks like your are tracking [email protected], [email protected] and [email protected] but amazon.es sends everything under only 2 email addresses ([email protected]) when you do the order and ([email protected]) when the order gets sent. mail_debug.log

tretabyte avatar Aug 02 '22 16:08 tretabyte

btw I'm getting extra errors on things I didn't turn on, for example usps camera mail2_debug.log .

tretabyte avatar Aug 02 '22 16:08 tretabyte

0.3.5-b7 should catch the email now.

firstof9 avatar Aug 03 '22 03:08 firstof9

Hi @firstof9 thanks for the quick turnback but looks like there's something wrong with the dates that gets captured, I've attached the debug logs.

2022-08-03 11:01:53 DEBUG (SyncWorker_2) [custom_components.mail_and_packages.helpers] Arrive Date: Sexta-feira, Agosto 5

Acompanhar
2022-08-03 11:01:53 DEBUG (SyncWorker_2) [custom_components.mail_and_packages.helpers] International dates not supported. (time data 'Sexta-feira, Agosto 5\n\nAcompanhar' does not match format '%A, %B %d')

mail_new_debug.log

tretabyte avatar Aug 03 '22 10:08 tretabyte

This should be sorted in the latest beta. Let me know.

firstof9 avatar Aug 03 '22 18:08 firstof9

Hi,

still getting the same data error from above although it's already running with 0.3.5.-b8

tretabyte avatar Aug 03 '22 20:08 tretabyte

Seems like it's in Portuguese, I'll add that as a lang.

firstof9 avatar Aug 03 '22 20:08 firstof9

0.3.5-b9 should have this working now.

firstof9 avatar Aug 03 '22 22:08 firstof9

you must be starting to hate me lol but seems that something is still not picking the date right

2022-08-04 01:46:14.190 DEBUG (SyncWorker_4) [custom_components.mail_and_packages.helpers] Arrive Date: Sexta-feira, Agosto 5

Acompanhar
2022-08-04 01:46:14.213 DEBUG (SyncWorker_4) [custom_components.mail_and_packages.helpers] International dates not supported. (time data 'Sexta-feira, Agosto 5\n\nAcompanhar' does not match format '%A, %B %d')

tretabyte avatar Aug 04 '22 00:08 tretabyte

Odd that it's grabbing after the date as well. Oh duh, I know why. Jeez I'm blind lol I'll get another beta for you shortly.

firstof9 avatar Aug 04 '22 01:08 firstof9

you really are going to start calling me names or to pt_PT but..

2022-08-04 13:57:30.336 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Amazon emails found: 0
2022-08-04 13:57:30.336 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Amazon email search address: ['[email protected]', '[email protected]', '[email protected]']
2022-08-04 13:57:30.337 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] DEBUG subject: None
2022-08-04 13:57:30.337 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] DEBUG imap_search: (OR OR FROM "[email protected]" FROM "[email protected]" FROM "[email protected]" SINCE 28-Jul-2022)
2022-08-04 13:57:30.688 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] DEBUG email_search value: ('OK', [b'1000 1001 1002'])
2022-08-04 13:57:30.689 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Amazon emails found: 3
2022-08-04 13:57:31.564 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Email Multipart: True
2022-08-04 13:57:31.573 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Content Type: multipart/alternative
2022-08-04 13:57:31.573 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Amazon Subject: O seu pedido Amazon.es de "Mando a Distancia de..." foi enviado!
2022-08-04 13:57:31.574 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Looking for: will arrive:
2022-08-04 13:57:31.585 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Looking for: estimated delivery date is:
2022-08-04 13:57:31.586 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Looking for: guaranteed delivery date is:
2022-08-04 13:57:31.586 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Looking for: Arriving:
2022-08-04 13:57:31.586 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Looking for: Arriverà:
2022-08-04 13:57:31.586 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Looking for: arriving:
2022-08-04 13:57:31.586 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Looking for: Dostawa:
2022-08-04 13:57:31.586 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Looking for: Zustellung:
2022-08-04 13:57:31.586 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Looking for: Entrega:
2022-08-04 13:57:31.586 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Looking for: A chegar:
2022-08-04 13:57:31.586 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] First pass: Sexta-feira, Agosto 5
2022-08-04 13:57:31.586 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Arrive Date: Sexta-feira, Agosto 5
2022-08-04 13:57:31.587 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] International dates not supported. (time data 'Sexta-feira, Agosto 5' does not match format '%A, %B %d')
2022-08-04 13:57:31.588 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Arrive Date: Sexta-feira, Agosto 5
2022-08-04 13:57:31.607 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] International dates not supported. (time data 'Sexta-feira, Agosto 5' does not match format '%A, %B %d')
2022-08-04 13:57:31.607 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Arrive Date: Sexta-feira, Agosto 5
2022-08-04 13:57:31.622 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] International dates not supported. (time data 'Sexta-feira, Agosto 5' does not match format '%A, %B %d')
2022-08-04 13:57:31.622 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Arrive Date: Sexta-feira, Agosto 5
2022-08-04 13:57:31.623 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] International dates not supported. (time data 'Sexta-feira, Agosto 5' does not match format '%A, %B %d')
2022-08-04 13:57:31.623 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Arrive Date: Sexta-feira, Agosto 5
2022-08-04 13:57:31.628 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] International dates not supported. (time data 'Sexta-feira, Agosto 5' does not match format '%A, %B %d')
2022-08-04 13:57:31.628 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Arrive Date: Sexta-feira, Agosto 5
2022-08-04 13:57:31.629 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] International dates not supported. (time data 'Sexta-feira, Agosto 5' does not match format '%A, %B %d')
2022-08-04 13:57:31.629 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Arrive Date: Sexta-feira, Agosto 5
2022-08-04 13:57:31.630 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] International dates not supported. (time data 'Sexta-feira, Agosto 5' does not match format '%A, %B %d')
2022-08-04 13:57:31.630 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Arrive Date: Sexta-feira, Agosto 5
2022-08-04 13:57:31.630 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] International dates not supported. (time data 'Sexta-feira, Agosto 5' does not match format '%A, %B %d')
2022-08-04 13:57:31.630 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Arrive Date: Sexta-feira, Agosto 5
2022-08-04 13:57:31.645 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] International dates not supported. (time data 'Sexta-feira, Agosto 5' does not match format '%A, %B %d')
2022-08-04 13:57:31.646 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Arrive Date: Sexta-feira, Agosto 5
2022-08-04 13:57:31.647 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] International dates not supported. (time data 'Sexta-feira, Agosto 5' does not match format '%A, %B %d')
2022-08-04 13:57:31.647 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Arrive Date: Sexta-feira, Agosto 5
2022-08-04 13:57:31.664 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] International dates not supported. (time data 'Sexta-feira, Agosto 5' does not match format '%A, %B %d')
2022-08-04 13:57:31.664 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Arrive Date: Sexta-feira, Agosto 5
2022-08-04 13:57:31.665 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] International dates not supported. (time data 'Sexta-feira, Agosto 5' does not match format '%A, %B %d')
2022-08-04 13:57:31.665 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Arrive Date: Sexta-feira, Agosto 5
2022-08-04 13:57:31.666 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] International dates not supported. (time data 'Sexta-feira, Agosto 5' does not match format '%A, %B %d')
2022-08-04 13:57:32.381 DEBUG (SyncWorker_5) [custom_components.mail_and_packages.helpers] Email Multipart: True

image

I also don't know why it keeps pulling the USPS camera since I never picked that option

tretabyte avatar Aug 04 '22 13:08 tretabyte

This looks correct, I guess I should add a debug message to when the date's taken correctly. You won't see any count until the 5th.

The cameras are always there, for now.

firstof9 avatar Aug 04 '22 13:08 firstof9

but shouldn't it pick up the package which has the delivery date on the Aug 5th?

tretabyte avatar Aug 04 '22 13:08 tretabyte

Not until the current date is the 5th.

firstof9 avatar Aug 04 '22 14:08 firstof9

Hi,

I'm attaching the full debug log because I think there's several things that might not be working as expected. today's the 5th so at least 1 package should be listed for delivery but I'm not getting any results shown, there's also still the lang error showing specially on the new email I got with delivery date on the 11th, snippet below (you can see everything in the full log)

2022-08-05 12:52:10.304 DEBUG (SyncWorker_4) [custom_components.mail_and_packages.helpers] Arrive Date: Quinta-feira, Agosto 11


O
2022-08-05 12:52:10.322 DEBUG (SyncWorker_4) [custom_components.mail_and_packages.helpers] Invalid date format found for language pt_PT. (time data 'Quinta-feira, Agosto 11\n\n\nO' does not match format '%A, %B %d')
2022-08-05 12:52:10.322 DEBUG (SyncWorker_4) [custom_components.mail_and_packages.helpers] Arrive Date: Quinta-feira, Agosto 11


O
2022-08-05 12:52:10.323 DEBUG (SyncWorker_4) [custom_components.mail_and_packages.helpers] Invalid date format found for language pt_PT.UTF-8. (time data 'Quinta-feira, Agosto 11\n\n\nO' does not match format '%A, %B %d')
2022-08-05 12:52:10.323 DEBUG (SyncWorker_4) [custom_components.mail_and_packages.helpers] Arrive Date: Quinta-feira, Agosto 11


O
2022-08-05 12:52:10.324 DEBUG (SyncWorker_4) [custom_components.mail_and_packages.helpers] Invalid date format found for language pt_BR. (time data 'Quinta-feira, Agosto 11\n\n\nO' does not match format '%A, %B %d')
2022-08-05 12:52:10.324 DEBUG (SyncWorker_4) [custom_components.mail_and_packages.helpers] Arrive Date: Quinta-feira, Agosto 11


O
2022-08-05 12:52:10.336 DEBUG (SyncWorker_4) [custom_components.mail_and_packages.helpers] Invalid date format found for language pt_BR.UTF-8. (time data 'Quinta-feira, Agosto 11\n\n\nO' does not match format '%A, %B %d')
2022-08-05 12:52:10.337 DEBUG (SyncWorker_4) [custom_components.mail_and_packages.helpers] Arrive Date: Quinta-feira, Agosto 11


O
2022-08-05 12:52:10.340 DEBUG (SyncWorker_4) [custom_components.mail_and_packages.helpers] Invalid date format found for language . (time data 'Quinta-feira, Agosto 11\n\n\nO' does not match format '%A, %B %d')

mail_debug.log

I'm also noticing a lot of unavailable errors with this latest b12 version image

tretabyte avatar Aug 05 '22 12:08 tretabyte

Unavailable should only show up if the emails can't be parsed. The log you've attached doesn't show this occurring.

As for the date, it might be due to the day not having a zero in front of the 5. I'm going to try a few things.

firstof9 avatar Aug 05 '22 13:08 firstof9

Based on the documentation it should be working, so I'm not sure why it's not parsing the date.

firstof9 avatar Aug 05 '22 14:08 firstof9

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] avatar Aug 16 '22 03:08 github-actions[bot]