Skip to content

Add ntfy.publish action to ntfy integration #38725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: next
Choose a base branch
from
Open
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions source/_integrations/ntfy.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,59 @@ data:

{% enddetails %}

## Actions

### Publish notification

For more customizable notifications, use the `ntfy.publish` action instead of `notify.send_message`. With `ntfy.publish`, you can take full advantage of the **ntfy** service's capabilities. These include setting a priority, adding links, attachments, tags, and emojis.

#### Parameters

- `title`: Title for your notification message.
- `message`: Your notification message.
- `markdown`: Enable Markdown formatting for the message body (Web app only). See the Markdown guide for syntax details: [https://www.markdownguide.org/basic-syntax/](https://www.markdownguide.org/basic-syntax/).
- `tags`: Add tags or emojis to the notification. Emojis (using shortcodes like `smile`) will appear in the notification title or message. Other tags will be displayed below the notification content.
- `priority`: All messages have a priority, which defines how urgently your phone notifies you, depending on the configured vibration patterns, notification sounds, and visibility in the notification drawer or pop-over.
- `click`: URL that is opened when the notification is clicked.
- `delay`: Set a delay for message delivery. The minimum delay is 10 seconds, and the maximum delay is 3 days.
- `attach`: Attach images or other files by URL.
- `email`: Specify the address to forward the notification to, for example `[email protected]`.
- `call`: Phone number to call and read the message out loud using text-to-speech. Requires ntfy Pro and prior phone number verification.
- `icon`: Include an icon that will appear next to the text of the notification. Only JPEG and PNG images are supported.

{% details "Example YAML configuration" %}

{% raw %}

```yaml
action: ntfy.publish
data:
title: "Server Alert"
message: "CPU usage exceeded 90%."
priority: "5"
click: "https://homeassistant.local"
tags:
- rotating_light
target:
entity_id: notify.mytopic
```

{% endraw %}

{% enddetails %}

{% note %}

All parameters are optional. If `message` is left empty, the notification will use the default text: `triggered`. If `priority` is not specified the default priority (3) will be used.

{% endnote %}

{% tip %}

Check out the [emoji reference](https://docs.ntfy.sh/emojis/) for a full list of supported emoji shortcodes.

{% endtip %}

## Removing the integration

This integration can be removed by following these steps:
Expand Down