-
Notifications
You must be signed in to change notification settings - Fork 93
USPS Sensor picking up unexpected deliveries for the following day #883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Did you get 2 emails from USPS about a delivery? |
No. Just the one USPS about the package getting delivered. Then after, emails about package pickup request, expected delivery, shipping label created l. Nothing I believe that should have interfered with the USPS delivery. The other expected delivery emails have dates afyer the 26th. |
Here are the searches we feed into IMAP to search for the USPS emails, try giving it a go in gmail see if it hit an extra email. |
I have no matching emails with the same expected delivery date of the 26th. I did get two that said expecteddelivwr for the 27th, but from my understanding that sgouldnt have added to the count fot the 26th. So im still unsure what's going wrong.
[attachments removed due to tracking numbers]
…On Wed, Mar 27, 2024, 10:44 AM Chris ***@***.***> wrote:
Here are the searches we feed into IMAP
<https://github.com/moralmunky/Home-Assistant-Mail-And-Packages/blob/dev/custom_components/mail_and_packages/const.py#L171-L174>
to search for the USPS emails, try giving it a go in gmail see if it hit an
extra email.
—
Reply to this email directly, view it on GitHub
<#883 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARQFDKG2IA2Q7PLBJJOK7STY2MAQPAVCNFSM6AAAAABFKDDQBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRTGQYDONBZGE>
.
You are receiving this because you were assigned.Message ID:
***@***.***
com>
|
I've turned it on. Is there a way to retrieve a backlog or do I wait for
the issue to occur again?
…On Wed, Mar 27, 2024, 3:53 PM Chris ***@***.***> wrote:
Can you do the debug logging and post your log here?
image.png (view on web)
<https://github.com/moralmunky/Home-Assistant-Mail-And-Packages/assets/1105672/2a50da74-dec7-4823-a2bf-bb7523976a8e>
That button in HA.
—
Reply to this email directly, view it on GitHub
<#883 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARQFDKDFFXTFSIFDN6MMPVLY2NEV7AVCNFSM6AAAAABFKDDQBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRUGEYTMNBTGM>
.
You are receiving this because you were assigned.Message ID:
***@***.***
com>
|
Ah I misread the time from the initial issue posting. HA won't back check like that. |
Will do. Thanks. So just a question, what all sensors gets added to mail
packages delivering and mail packages delivered? I thought Amazon packages
would be counted I this, but it doesn't appear it did yesterday.
Also, is there a Walmart Delivering sensor in the works? Right now I only
see Walmart exception and mailman delivered.
…On Wed, Mar 27, 2024, 4:52 PM Chris ***@***.***> wrote:
Ah I misread the time from the initial issue posting. HA won't back check
like that.
If you happen to see the issue occur again, please get a log for it.
—
Reply to this email directly, view it on GitHub
<#883 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARQFDKEFC2OPHLV36RTQAV3Y2NLVRAVCNFSM6AAAAABFKDDQBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRUGE3DONJRGI>
.
You are receiving this because you were assigned.Message ID:
***@***.***
com>
|
Amazon packages do not count towards the There's 2 walmart sensors as defined here, delivered and exceptions. |
Thanks, I need to read more. I think I'll try to add a Walmart Delivering
sensor when I get some time to dig through your code.
…On Wed, Mar 27, 2024, 5:15 PM Chris ***@***.***> wrote:
Amazon packages do not count towards the Mail Packages Delivered or Mail
Packages In Transit sensors as they *could* be handled by UPS/FedEx/etc.
That would cause a single package to count as 2 in that case, this is explained
in the wiki
<https://github.com/moralmunky/Home-Assistant-Mail-And-Packages/wiki#amazon>
.
There's 2 walmart sensors as defined here
<https://github.com/moralmunky/Home-Assistant-Mail-And-Packages/blob/dev/custom_components/mail_and_packages/const.py#L1000-L1012>,
delivered and exceptions.
—
Reply to this email directly, view it on GitHub
<#883 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARQFDKGX6P6IZ6ZVDDNXHYTY2NOINAVCNFSM6AAAAABFKDDQBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRUGE4DIOBUGY>
.
You are receiving this because you were assigned.Message ID:
***@***.***
com>
|
What all files must be updated to add a Walmart Delivering sensor other then the const.py? I'd like to dig into it. |
That's all, just the |
Awesome, I'm going to play around with it when I get more free time. Thanks
a lot!
…On Thu, Mar 28, 2024, 7:19 AM Chris ***@***.***> wrote:
What all files must be updated to add a Walmart Delivering sensor other
then the const.py?
That's all, just the const.py you'd add where the current walmart stuff
is. We've tried to make adding additional stuff as easy as possible.
—
Reply to this email directly, view it on GitHub
<#883 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARQFDKCD7KJGKKCDE4H4QFLY2QRHPAVCNFSM6AAAAABFKDDQBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRVGMYDIOBXHE>
.
You are receiving this because you were assigned.Message ID:
***@***.***
com>
|
I am unsure, it was a PR submitted by someone else. |
It works after adding the subject to the array in const.py. That's was so
easy its awesome.
…On Fri, Mar 29, 2024, 10:02 AM Chris ***@***.***> wrote:
Just a question for clarification, the Walmart sensor is for Walmart
grocery delivery etc correct?
I am unsure, it was a PR submitted by someone else.
—
Reply to this email directly, view it on GitHub
<#883 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARQFDKEQJJSJNJWUOSH3LRDY2WNB3AVCNFSM6AAAAABFKDDQBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRXGQ4TEOBTGA>
.
You are receiving this because you were assigned.Message ID:
***@***.***
com>
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Ok, so its an issue just with the USPS as far as I can see. Everything was fine, 1 packages out for delivery, then 1 package delviered. But later, I get this email subject, "USPS® Expected Delivery on Saturday, April 13, 2024 arriving by 9:00pm 2612998696033FAKE48085" and its being counted in mail USPS delivering and Mail USPS packages. Although it shouldn't be in the query until tomorrow. sensor.mail_usps_delivered and sensor.mail_usps_delivering both include both tracking numbers: the one that was actually delivered, and this one that isnt excepted until tomorrow. I hope this helps. 2024-04-12 16:49:32.745 DEBUG (SyncWorker_59) [custom_components.mail_and_packages.helpers] Found html email processing... |
Perhaps the issue is the today's date in the email body? Just a guess. If so, is there a quick way I can update the code to make the regex search for the last occurrence of a date without breaking anything? I don't know exactly how to do it, but I'm sure I can figure it out eventually. Hello , Your item departed our USPS facility in SPOKANE WA DISTRIBUTION CENTER on April 12, 2024 at 2:14 pm. The item is currently in transit to the destination. Tracking Number: 9261290339644808549876 Expected Delivery On 13 Apr By 9:00pm By 9:00pm Tracking & Delivery Options |
Here is a log I took after re configuring that: 2024-04-12 17:21:34.684 DEBUG (SyncWorker_1) [custom_components.mail_and_packages.helpers] Removing USPS announcement images. |
Thank you, this is very helpful.
Likely we'll need to adjust the subject search here to clear this up. Edit: actually the body match should come into play as well. I'll have to look into this further. |
The one that was counted correctly also has a similar subject: "USPS® Expected Delivery on Friday, April 12, 2024 arriving by 2:45pm 9400109105464013116765" That's the good delivery, the one I expected to be counted. Is there a way to use the date in the subject to determine if it should be counted? |
Can you verify the phrase: "Your item is out for delivery" isn't in the email for the 13th? |
Thats correct.
…On Fri, Apr 12, 2024, 6:49 PM Chris ***@***.***> wrote:
Can you verify the phrase: "Your item is out for delivery" isn't in the
email for the 13th?
—
Reply to this email directly, view it on GitHub
<#883 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARQFDKFZOVKE7Z3TPDOOFYTY5CFKTAVCNFSM6AAAAABFKDDQBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJSHE2DGMRWGQ>
.
You are receiving this because you were assigned.Message ID:
***@***.***
com>
|
It's weird it shouldn't be picking up these as the subject doesn't match the pattern. |
I wonder if your timezone in Home Assistant may be incorrect or something. |
Yes, it is incorrect. Docker -v /etc/timezone and also TZ don't work,
neither does setting time_zone in config yaml.
So yes, it's off by one hour according to home assistant settings. But this
got picked up over 6 hours early, which the one hour time difference
doesn't explain.
I've manually changed the timezone in the home assistant settings to the
correct time. I'll let you know if the it changes anything.
…On Tue, May 14, 2024, 6:32 AM Chris ***@***.***> wrote:
I wonder if your timezone in Home Assistant may be incorrect or something.
—
Reply to this email directly, view it on GitHub
<#883 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARQFDKDYPD54XJRWXIS3QETZCIG7VAVCNFSM6AAAAABFKDDQBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJQGI2TQMJYGQ>
.
You are receiving this because you were assigned.Message ID:
***@***.***
com>
|
If you run |
If it shows UTC as the timezone try adding the volume like below: volumes:
- /etc/localtime:/etc/localtime:ro This is how I have my container localtime mapped in. |
Yes, thats what I meant. Apparently I was wrong, the time is and was
correct before I messed with it. Sever time and HA time are correct. So
still not sure why next day deliveries are sometime picked up.
…On Tue, May 14, 2024, 10:24 AM Chris ***@***.***> wrote:
If it shows UTC as the timezone try adding the volume like below:
volumes:
- /etc/localtime:/etc/localtime:ro
This is how I have my container localtime mapped in.
—
Reply to this email directly, view it on GitHub
<#883 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARQFDKDKFT3GEM5KPGAAO4TZCJCFPAVCNFSM6AAAAABFKDDQBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJQG42TONZSGY>
.
You are receiving this because you were assigned.Message ID:
***@***.***
com>
|
Describe the bug
This morning I got my first Amazon sensor activity. I also had 1 USPS package coming. The sensor started as:
Mail Amazon Packages 1
Mail Amazon Packages Delvered 0
Mail Packages Delivered 0
Mail Packages in Transit 1
Mail USPS Delivered 0
Mail USPS Delivering 1
Mail USPS Packages 1
I thought this was odd, as I expected the Mail Paclages in Transit to include both the Mail USPS Packages count as well as the Mail Amazom packages count.
The USPS package was delivered. My sensors states were now as follows:
Mail Amazon Packages 1
Mail Amazon Packages Delvered 0
Mail Packages Delivered 1
Mail Packages in Transit 0
Mail USPS Delivered 1
Mail USPS Delivering 0
Mail USPS Packages 1
The suspected bug shows itself when my Amazon order is delivered. The sensor are now as follows:
Mail Amazon Packages 1
Mail Amazon Packages Delivered 1
Mail Packages Delivered 1
Mail Packages in Transit 1
Mail USPS Delivered 1
Mail USPS Delivering 1
Mail USPS Packages 2
As you can see, once the Amazom order gets marked as delivered, it updates the following sensors:
Mail Amazon Packages Delivered ++
Mail Packages in Transit ++
Mail USPS Delivering ++
Mail USPS Packages ++
It this a bug or is this the expected behavior?
Environment (please complete the following information):
Firmware: 0.3.23
Logs
Nothing to log.
Screenshots

.
Additional context
The text was updated successfully, but these errors were encountered: