Repository navigation
Public Transport Alerts
MMM-PublicTransportHub
can turn normalized transit data into global PTH_SERVICE_ALERT notifications.
MessageCenter acts only as the presentation layer: PublicTransportHub decides
whether a transit event is meaningful, and MessageCenter displays, updates, and
clears the resulting message.

PublicTransportHub can emit notifications for:
- Cancelled departures
- Delays meeting a configured threshold
- Service remarks, when enabled
- No reachable departures, when enabled
Availability depends on the selected provider and the data it supplies. MessageCenter does not inspect raw transit feeds or attempt to infer disruptions itself.
Enable outgoing notifications in the PublicTransportHub module configuration:
outgoingNotifications: {
enabled: true,
includeCancellations: true,
includeDelays: true,
delayThresholdMinutes: 10,
includeRemarks: false,
includeNoDepartures: false
}includeRemarks: false is a calm starting point because some providers return
routine informational remarks as well as genuine service disruptions. Enable
it if the selected provider supplies useful warning text.
The MessageCenter adapter is enabled by default. This explicit configuration is equivalent and can make the integration easier to recognize later:
internalNotifications: {
publicTransportHub: {
enabled: true
}
}Set enabled: false for this provider to ignore transit alerts without
disabling MessageCenter's other internal notification sources.
The first active service event becomes an attention message and creates a toast. PublicTransportHub supplies a stable event ID, so later changes update the existing message instead of creating duplicate history. Those updates are silent and preserve whether the message has already been read.
When PublicTransportHub sends the same ID with active: false, MessageCenter
removes the message and clears its contribution to the attention state. An
expiration timestamp provides an additional safety net.
PublicTransportHub owns the transit-specific title and body. MessageCenter preserves that wording and adds a translated Public Transport source label. Concise, self-contained titles work especially well in line mode; compact and full-page modes can display the longer body text.

Line mode keeps service alerts useful in a standard MagicMirror region without
turning the region into a second inbox. It shows the alert title and time, plus
one truncated detail line when lineShowBody: true. The complete body remains
available in compact or full-page mode.
Both modules remain independent. PublicTransportHub can broadcast service events without MessageCenter, and MessageCenter continues to work when PublicTransportHub is absent.