Check windows — wakes every 2 minutes within these times

☀️ Morning · BRI→PAD / SUR→WAT / NBT→WAT / SUR→CLJ / NNG→LCN / WAT→GLD / BOA→BHM / RDG→PAD / GLD→WAT

05:00 – 08:40
Checks trains departing 06:30–08:40

🌆 Afternoon · PAD→BRI / WAT→SUR / WAT→NBT / CLJ→SUR / LCN→NNG / GLD→WAT / BHM→BOA / PAD→RDG / WAT→GLD

14:00 – 18:00
Checks trains departing 14:30–18:00

All times Europe/London — BST (summer) and GMT (winter) handled automatically

What each check looks for

❌ Cancelled

API flag isCancelled = true
OR estimated departure = "Cancelled"
Always alert, no threshold

⏰ Delayed

If status = "Delayed" (no time yet) → held for 4 mins then alert if still unresolved (avoids noise from transient status flips)
If new time given:
≥ 8 mins late → alert
< 8 mins late → ignore
ℹ️Delay is measured against scheduled departure time — not arrival. A train delayed at the platform triggers the alert before you leave home.

📢 Station Alert

Free-text bulletin from National Rail
Filtered per route: Alex check for "Bristol Temple Meads" or "London Paddington"; Chris& Fredrowntree& Joemkcarr check for "London Waterloo" or "Surbiton"; Esha& Mani check for "London Waterloo" or "Norbiton"; Jenny check for "Clapham Junction" or "Surbiton"; Lydia Sarah Hughes check for "Lincoln Central" or "Newark Northgate"; Mrpandapopking& Stephen check for "Guildford" or "London Waterloo"; Rafael Joseph check for "Birmingham New Street" or "Bradford-On-Avon"; Ricky Tanner check for "London Paddington" or "Reading"
Other lines/routes → ignored

Example scenarios — morning check at various times

✅ Scenario 1 — All clear, no alert sent
Check runs at 05:40 · Looking at upcoming SUR→WAT departures
ScheduledStatusAction
06:32On timeno action
06:47On timeno action
07:00On timeno action
07:15On timeno action
07:30On timeno action
08:00On timeno action
😴 Nothing to report. Goes back to sleep for 2 minutes.
🔕 Scenario 2 — Delay under 8 mins, ignored
Check runs at 06:10 · 07:00 train is running slightly late
ScheduledStatusAction
06:32On timeno action
06:47On timeno action
07:00Exp 07:05 (+5 mins)below 8 min threshold
07:15On timeno action
07:30On timeno action
😴 5 minute delay is below the 8 minute threshold — no alert sent. Back to sleep.
🚨 Scenario 3 — Significant delay, alert sent
Check runs at 06:20 · 07:00 train is running 19 minutes late
ScheduledStatusAction
06:32On timeno action
06:47On timeno action
07:00Exp 07:19 (+19 mins)🚨 ALERT
07:15On timeno action
07:30On timeno action
📧📱 Email + text sent. Remembers: { "07:00": "delayed" }
🔁 Scenario 4 — Same disruption 2 mins later, no repeat alert
Check runs at 06:22 · 07:00 train still delayed (same disruption as Scenario 3)
ScheduledStatusAction
06:32On timeno action
06:47On timeno action
07:00Exp 07:19 (+19 mins)already alerted
07:15On timeno action
😴 07:00 was already reported — not sending again.
🆕 Scenario 5 — New disruption appears, second alert sent
Check runs at 06:40 · 07:00 still delayed (known) + 07:15 now also cancelled (new)
ScheduledStatusAction
06:32On timeno action
06:47On timeno action
07:00Exp 07:19 (+19 mins)already alerted
07:15CANCELLEDNEW🚨 ALERT
07:30On timeno action
📧📱 Second alert sent for the cancellation only. Remembers: { "07:00": "delayed", "07:15": "cancelled" }
⏳ Scenario 6 — New train disrupted, but cooldown is active
Check runs at 07:20 · Alert was last sent at 06:40 (only 40 mins ago · cooldown = 120 mins)
ScheduledStatusAction
07:00Exp 07:19 (+19 mins)already alerted
07:15CANCELLEDalready alerted
07:30CANCELLEDNEW cooldown — 20 mins remaining
😴 No alert sent. Even though 07:30 is a new disruption, the 120-minute cooldown is still active.
🚨 Scenario 7 — Cooldown expired, new disruption fires
Check runs at 07:40 · Alert was last sent at 06:40 (120 mins ago — cooldown lifted)
ScheduledStatusAction
07:00Exp 07:19 (+19 mins)already alerted
07:15CANCELLEDalready alerted
07:30CANCELLEDNEW 🚨 ALERT
07:45CANCELLEDNEW 🚨 ALERT
📧📱 Alert sent covering both new cancellations. Cooldown resets for another 120 minutes.
⏸️ Scenario 8a — Unspecified "Delayed" — held, then resolves (no alert)
Check runs at 07:10 · 07:30 train shows "Delayed" with no estimated time
ScheduledStatusAction
07:15On timeno action
07:30Delayed (no time given)⏸ hold-off started
😶 Status logged as pending. No alert yet — transient "Delayed" notices often resolve within minutes.
Check runs at 07:12 · 07:30 train now shows a specific time
ScheduledStatusAction
07:30Exp 07:34 (+4 mins)below 8 min threshold
😴 Resolved to a minor clock-time delay — pending entry dropped, no alert ever sent.
🚨 Scenario 8b — Unspecified "Delayed" — persists ≥ 4 mins, alert fires
Check runs at 07:10 · 07:30 train shows "Delayed" with no estimated time
ScheduledStatusAction
07:30Delayed (no time given)⏸ hold-off started
😶 No alert yet. Waiting to see if the status resolves.
Check runs at 07:12 · Still "Delayed" (no time) — 2 mins in, still under the 4-min hold-off
ScheduledStatusAction
07:30Delayed (no time given)⏸ still in hold-off
Check runs at 07:14 · Still "Delayed" (no time) — 4 mins elapsed, hold-off expired
ScheduledStatusAction
07:30Delayed (no time given)🚨 ALERT
📧📱 Alert sent. Unspecified delay confirmed as persistent after 4 minutes.