Zum Hauptinhalt springen

ntfy Smart-Home-Integration, kostenlos und Open Source

ntfy-Integration für Gladys Assistant

Send push notifications through ntfy (ntfy.sh or self-hosted).

Info

Die Dokumentation dieser Integration wird von ihrem Autor geschrieben und ist bisher nur auf Englisch verfügbar.

Overview​

This integration lets Gladys Assistant send push notifications through ntfy, a simple notification service. When a scene sends a message to you, it is pushed to your phone through the ntfy app.

It works with the free public server https://ntfy.sh as well as with your own self-hosted ntfy server.

This is a send-only channel: Gladys only sends notifications, it does not receive messages back. Each Gladys user configures their own ntfy topic in their account, so everyone gets their notifications on their own phone.

Prerequisites​

  • The ntfy app installed on your phone (Android / iOS), or any ntfy client.
  • Internet access from your Gladys instance (to reach https://ntfy.sh), or a reachable self-hosted ntfy server.
  • A topic. A topic is a channel: pick a long, hard-to-guess name, with only letters, digits, - and _.
  • An access token (tk_…) allowed to publish to that topic, if your server or topic is protected. It is optional for a topic open to anyone, such as a public topic on ntfy.sh.

Configuration​

The configuration has two parts:

1. Integration settings (shared, set once)​

  • ntfy server URL — https://ntfy.sh by default, or your self-hosted server;
  • Default priority — the priority of the notifications Gladys sends;
  • Default notification title — the title shown on those notifications.

2. My account (per user)​

Each Gladys user opens the integration and fills their own account block:

  • Your ntfy topic — the topic your notifications are sent to;
  • Access token (optional) — an ntfy access token (tk_…) allowed to publish to that topic. Leave it empty if the topic is open to anyone.

Then subscribe to that topic in the ntfy app on your phone so the notifications reach you.

Sending notifications​

Use a Gladys scene with a "Send a message" action, choose this integration and the user to notify: the message is published to that user's ntfy topic and pushed to their phone.

The "Send a camera image" action works too: the image comes as an attachment of the notification, shown in the ntfy app. If the ntfy server does not accept attachments (disabled on some self-hosted servers, or an image too large), the text is still sent, without the image.

Troubleshooting​

The integration checks that the ntfy server answers at startup and on every settings change. When it does not, or when a notification is refused, the Configuration screen shows it with the reason and what to fix. The status goes back to normal as soon as a notification gets through. The same message is written in the Logs tab of the integration.

  • Unable to reach the ntfy server — the server URL is wrong, or Gladys cannot reach the network or the server.
  • Access token refused (401) — the token is invalid, expired or deleted. An ntfy token starts with tk_.
  • Not allowed to publish (403) — the topic requires a token, or the token cannot write to this topic; fix its permissions on your ntfy server.
  • Invalid topic — a topic only accepts letters, digits, - and _ (64 characters at most), with no spaces or accents.
  • Limit reached (429) — the server limits the number of notifications; wait, or use your own server.
  • A user gets no notification, with no error — check that the ntfy app on their phone is subscribed to the same topic and server as their "My account" block.
  • Notifications arrive without a title — set the Default notification title in the integration settings.

Konfigurationseinstellungen​

Diese Einstellungen fragt ntfy in seinem Konfigurationsbildschirm in Gladys ab.

EinstellungTypPflichtfeldBeschreibung
ntfy server URLstringJaThe base URL of the ntfy server, shared by everyone. Use the public https://ntfy.sh or your own self-hosted server.
Default priorityselectNeinPriority applied to the notifications sent by Gladys.
Default notification titlestringNeinTitle shown on the notifications sent by Gladys.

So installierst du ntfy in Gladys​

  1. Öffne in Gladys Integrationen: ntfy erscheint im Katalog neben den nativen Integrationen, mit einem Community-Badge.
  2. Klicke auf Installieren. Gladys lädt das Docker-Image (ghcr.io/callemand/gladys-ntfy:1.2.0) herunter, startet es in einer vom Kern isolierten Sandbox und erzeugt die Oberfläche der Integration (Geräte, Erkennung und Konfiguration).
  3. Öffne den Bildschirm Konfiguration der Integration, fülle die Einstellungen aus und speichere.
  4. Du kannst sie auch direkt über die URL ihres Repositorys installieren: https://github.com/callemand/gladys-ntfy.

ntfy benötigt Gladys >=4.62.0. Der Katalog in Gladys wird stündlich aktualisiert, eine neue Version ist also spätestens eine Stunde nach ihrer Veröffentlichung verfügbar.

Du nutzt Gladys noch nicht? Es ist kostenlos und Open Source: folge der Installationsanleitung, um loszulegen.

Über externe Integrationen​

ntfy ist eine externe Integration: eine Community-Integration, die als Docker-Container verpackt und auf GitHub veröffentlicht wird. Gladys installiert sie mit einem Klick und führt sie in einer vom Kern isolierten Sandbox aus. Sie wird von callemand veröffentlicht und gepflegt, nicht vom Gladys-Kernteam.

Abonniere den Newsletter von Gladys Assistant

Ein paar E-Mails im Monat zu neuen Releases und Neuigkeiten aus dem Projekt. Verschickt von Pierre-Gilles Leymarie, dem Gründer des Projekts. Jederzeit abbestellbar 🙂