HTML5 Browser Push Transport Adaptor¶
| Transport ID | Source | Requirements | Optional |
|---|---|---|---|
html5 | html5.py | HTML5 Push Notifications Integration | - |
Motivation¶
Provides a native SuperNotify transport for browser web push through the Home Assistant html5 integration. The transport calls the modern html5.send_message entity service rather than the legacy notify.html5 platform: the legacy platform reads ttl and priority from keyword arguments the notify bridge never populates, so urgency would silently always be "normal". With the entity service, urgency is mapped natively from the SuperNotify priority.
Features¶
- Urgency mapped from priority — critical/high →
high, medium →normal, low/minimum →low, overridable withhtml5_urgency. - Tags and renotify, so a repeated alert replaces the previous one instead of piling up.
- Action buttons (
html5_actions); clicks firehtml5_notification.clickedevents carrying the action value, ready for actionable-notification automations. Supernotify's own ad-hoc actions and action groups aren't turned into browser buttons, only a notification level action'suri, as the click URL. langis set to the Home Assistant language.- Camera snapshot as the notification image (
html5_attach_image: true) using the shared media pipeline — the URL must be reachable by the browser, so an HTTPSexternal_url(or Home Assistant Cloud) is usually required. silentandvibrateare mutually exclusive in the core schema (vol.Exclusive): the transport never sends both, and logs a warning when it has to drop one.
Configuration¶
Targets are the notify.* entities created by browser registrations (html5 config entry with VAPID keys). Non-matching targets are dropped; a delivery with no valid target is skipped.
A delivery with its own fixed targets, like this one, needs inclusion: explicit if it should only be used when asked for, since otherwise its targets select it for every notification.
delivery:
browser_push:
transport: html5
target:
- notify.chrome_laptop
- notify.firefox_phone
data:
html5_tag: supernotify
html5_renotify: true
inclusion: explicit
HTML5 Data Keys¶
html5_urgency—low|normal|high(default mapped from priority)html5_tag— notifications sharing a tag replace each otherhtml5_actions— list of{action, title, icon}buttonshtml5_attach_image— camera snapshot asimageURL (defaultfalse)html5_icon,html5_badge— icon / badge URLshtml5_url— URL opened on click (sent asdata.url), defaults to theuriof a notification level actionhtml5_require_interaction— keep on screen until the user interactshtml5_renotify— alert again when a new notification replaces an existing taghtml5_silent— suppress sound/vibration (exclusive withhtml5_vibrate)html5_vibrate— vibration pattern in ms, e.g.[200, 100, 200], or a single numberhtml5_ttl— time-to-live in seconds or an HA duration mappinghtml5_data— extra keys merged into the customdatafield (html5_urlwins onurl)
Discovery¶
Delivery (default selection). If the html5 integration's config entry exists, at least one browser has registered, and no html5 delivery is defined, an html5 delivery is generated automatically. It's selected whenever a notification targets one of the integration's own notify.* entities, without naming the delivery, ahead of the generic notify_entity transport.
Notes¶
- The
html5.send_messageschema is a strict whitelist: unknown top-level keys fail the whole call, so residual generic data keys are not forwarded (debug log);html5_datais the explicit passthrough. titleis required by the schema; without a title, "Notification" in the Home Assistant language is used.- Expired push subscriptions (410 GONE) are handled by the core, which unregisters the browser and raises: the delivery is then reported as failed.