Repository navigation
Description
PostNL integration version
5.0.0
Home Assistant version
2026.11.2
What happened?
When a parcel is out_for_delivery, PostNL continuously updates routeInformation.expectedDeliveryTime (raw.expected_datetime) based on live courier progress, while keeping routeInformation.plannedDeliveryTimeWindow (raw.planned_from / raw.planned_to) fixed at the original 2-hour window.
When the courier runs ahead of schedule, expectedDeliveryTime legitimately moves earlier than plannedDeliveryTimeWindow.startDateTime. However, _delivery_window_start() in custom_components/postnl/parcels.py (lines 432–453) discards expected_datetime whenever it falls outside [start, end]:
if start is None or end is None or not start <= expected <= end:
return planned_from
return parcel["expected_datetime"]As a result, Home Assistant (planned_from, next_delivery, calendar, and cards like ha-parcel-card) stops updating and falls back to the stale original window start, even though the PostNL app and the raw API response already show the updated earlier ETA.
Observed live progression on the same parcel today (original window 18:25–20:25):
- 13:19 —
raw.expected_datetimewas18:37(inside18:25–20:25) → top-levelplanned_from&next_deliveryupdated to18:37. - 14:06 — courier ran ahead of schedule;
raw.expected_datetimemoved to18:15(10 min before18:25) → rejected bystart <= expected <= end, soplanned_fromreverted to18:25. - 14:16 (after pressing Refresh) —
raw.expected_datetimemoved further to18:08→ still rejected;planned_fromremains stuck at18:25.
Expected behaviour:
expected_datetime should still be trusted when the courier runs ahead of schedule (or slightly past planned_to when delayed — note that if expected > planned_to, planned_window() would currently swap reversed bounds unless planned_to is adjusted accordingly).
Steps to reproduce
- Have an active incoming PostNL parcel with status
out_for_delivery(J05) and a 2-hourplannedDeliveryTimeWindow(e.g.18:25–20:25). - Wait until the courier runs ahead of schedule so PostNL returns
routeInformation.expectedDeliveryTimeearlier thanplannedDeliveryTimeWindow.startDateTime(e.g.18:15or18:08whileplanned_fromstays18:25). - Observe that
raw.expected_datetimeupdates on every poll/refresh, while top-levelplanned_fromandsensor.postnl_*_next_deliveryrevert to and stay stuck on18:25.
Relevant logs
{
"status": "out_for_delivery",
"raw_status": "Bezorger is onderweg",
"planned_from": "2026-11-24T18:25:00+01:00",
"planned_to": "2026-11-24T20:25:00+01:00",
"raw": {
"status_message": "Bezorger is onderweg",
"delivered": false,
"delivery_address_type": "Recipient",
"planned_date": "2026-11-24T19:25:00+01:00",
"planned_from": "2026-11-24T18:25:00+01:00",
"planned_to": "2026-11-24T20:25:00+01:00",
"expected_datetime": "2026-11-24T18:08:00+01:00"
}
}
Activity
fix: follow PostNL's ETA when the courier runs ahead or late (#54)
peter-mdf commentedon Nov 24, 2026
Thanks again @misteriks ! Fixed in the next release :)