Discord Transport Adaptor¶
Motivation¶
Provides a native SuperNotify transport for Discord through the Home Assistant discord integration. Through the generic transport only plain text reaches Discord; the native transport adds markdown title composition, rich embeds, camera snapshot upload, remote image URLs and an optional priority emoji prefix.
Features¶
- Title composed into the message body as Discord markdown (
**title**+ newline + message), skipped automatically when adiscord_embedcarries its owntitle. - Rich embeds passed through to the service (
title,description,color,url,fields,footer,author,thumbnail,image— Home Assistant core schema). - Camera snapshot attachment via
envelope.grab_image()(discord_attach_image: true), waiting for camera PTZ to complete before sending. - Remote image URLs forwarded as
urls, with optional SSL verification control. - Opt-in emoji prefix derived from the SuperNotify priority (critical, high, low/minimum).
- Message content truncated to the Discord hard limit of 2000 characters, so a long message is delivered rather than rejected.
Configuration¶
The discord integration is set up in Home Assistant with a bot token. The bot must be invited to the server with the Send Messages permission. The action name depends on the config entry (notify.discord, notify.discord_2, …), so any notify.* action is accepted.
Targets are numeric Discord channel or user IDs (Developer Mode → Copy ID). A target is required: non-numeric entries are dropped and a delivery with no valid target is skipped.
From Home Assistant 2026.11, a channel or user can also be added to the integration, which creates a notify entity for it. Targeting that entity selects this delivery ahead of the generic Notify Entity one, and the title is composed into the message as above, since the entity ignores a title. The entity only takes text, so the embed, images and urls only go to targets given as IDs.
delivery:
discord_alerts:
transport: discord
action: notify.discord
target:
- "123456789012345678"
data:
discord_priority_prefix: true
inclusion: explicit
For camera snapshots (discord_attach_image) the discord integration checks local paths with is_allowed_path, so the SuperNotify media path must be listed:
For discord_image_urls every URL must be covered by allowlist_external_urls; the integration downloads at most 8MB per attachment.
Discord Data Keys¶
discord_embed— embed mapping passed through asdata.embed.coloris an integer (0xFF0000in YAML is16711680); hex strings are passed through unchanged and may be rejected downstream.discord_attach_image— attach the camera snapshot as a local file indata.images(defaultfalse)discord_image_urls— list of image URLs forwarded asdata.urls(a single string is wrapped)discord_verify_ssl— SSL verification for URL downloads (only forwarded when set)discord_priority_prefix— prefix the message with a priority emoji (defaultfalse)
Example call with an embed and a snapshot:
action: supernotify.notify
data:
title: "Alarm"
message: "Motion detected"
priority: critical
delivery:
discord_alerts:
data:
discord_attach_image: true
discord_embed:
title: "Garden camera"
description: "Motion at 22:41"
color: 15158332
Discovery¶
Delivery (default selection). If the discord integration is already configured and no discord delivery is defined, a discord delivery is generated automatically (discovering whichever notify.discord* service slug your bot's config entry registered). The channel/user ID itself can't be auto-detected from a bare, unqualified value, but discord_channel is a dedicated target category no other transport uses, so a target explicitly qualified with it (target: {discord_channel: "123456789012345678"}) reaches this delivery automatically, the same way an email address reaches the email delivery — no need to name discord in delivery: or a scenario. With nothing qualified as discord_channel given, the delivery is simply skipped.
Notes¶
- Discord has no native message priority: the emoji prefix is the only mapping offered.
- Unknown residual
datakeys are not forwarded to the service (they would be ignored downstream anyway); a debug log lists what was dropped.