Saltar al contenido principal

Integración domótica plivo-telnyx, gratuita y de código abierto

Integración plivo-telnyx para Gladys Assistant

Unofficial: send SMS from your scenes through Plivo or Telnyx (your choice).

info

La documentación de esta integración la escribe su autor y, por ahora, solo está disponible en inglés.

Unofficial, not affiliated with Plivo nor Telnyx. Never tested with a real Plivo or Telnyx account: the API format comes from their public documentation (Plivo Message API, Telnyx Messaging API v2, read on 3 December 2026); the tests run against fake servers built from it.

This integration sends SMS from your Gladys scenes through your own account at one of two providers, chosen in the configuration: Plivo or Telnyx. Each message is paid from that account.

  • Send only: nothing is received, no reply is read.
  • One provider at a time: only the credentials of the provider chosen are read and sent; the fields of the other one are ignored, whatever they hold.
  • A message leaves only from the scene action "Send an SMS (Plivo / Telnyx)" or a click on the "Send a test SMS" button. Nothing at start, on a reconnection, nor when you save the configuration.
  • Messages go only to the allowed numbers typed in the configuration.

Before you start​

Plivo: in the Plivo console, copy the Auth ID and the Auth Token of the overview page. You need a sender: a Plivo number of your account, or an alphanumeric sender id where the destination country allows it.

Telnyx: in the Telnyx portal, create an API key (API Keys). You need a sender (a Telnyx number with messaging enabled), or a messaging profile (its id, a UUID): with a profile and no sender, Telnyx picks a number of the profile's number pool; an alphanumeric sender id needs a profile.

Then in Gladys: install the integration, choose the provider, type its credentials, the sender and the allowed numbers, save. Click Check the account: the provider says whether it accepts the credentials and gives the balance (no message sent). If you like, click Send a test SMS (one paid SMS, counted in the cap).

Configuration​

SettingRole
ProviderPlivo (default) or Telnyx. Only the fields of this provider are read.
Plivo Auth IDPlivo only: letters and digits; it is also in the path of the Plivo URLs.
Plivo Auth TokenPlivo only. Kept by Gladys in its database, never shown again, sent only to Plivo (Authorization header of https://api.plivo.com, Basic).
Telnyx API keyTelnyx only. Kept by Gladys in its database, never shown again, sent only to Telnyx (Authorization header of https://api.telnyx.com).
Telnyx messaging profile idTelnyx only, optional: a UUID. Needed with an alphanumeric sender; without a sender, the number pool of the profile.
SenderA number of your account (+ or 00) or an alphanumeric sender id (3 to 11 letters or digits, at least one letter). Required for Plivo.
Allowed numbersRequired. The only numbers messages may go to, international format, separated by commas, 10 at most.
Maximum SMS per 24 hoursSafety cap, 1 to 200 (20 by default), whatever the provider. See below.
Maximum parts per message1 to 10 (3 by default): beyond, the text is cut and ends with "...".
Accents"Keep them" (default) or "Simplify" (see below).

Numbers accepted​

Only the international format: + or 00, then the country code and the number (8 to 15 digits), for example +33 6 12 34 56 78, 0044 7700 900123. A national number (06 12 34 56 78) is refused: the module serves every country and cannot guess which one. Spaces, dots, dashes and brackets are ignored.

A number is never written whole in the logs nor in the messages: only the first 3 and the last 2 digits show (+336******78).

The scene action​

"Send an SMS (Plivo / Telnyx)" has two fields:

  • Text (required): Gladys replaces the scene variables in it.
  • Numbers (optional): some of the allowed numbers, separated by commas; empty, all of them. A number outside the list, or a value that is not text (a list, a number), refuses the whole action (nothing is sent).

Outputs, for the following actions of the scene:

  • sent: SMS accepted by the provider;
  • not_sent: recipients not reached (refused, not tried, or without confirmation);
  • message_ids: the provider's ids of the accepted messages, separated by commas;
  • truncated: true when the text was cut.

When nothing is accepted, the action fails with the reason in the scene log ("Nothing sent: the cap of SMS per 24 hours is reached", …); the scene goes on. Recipients are served one after the other, one request each: a number refused as invalid (400, Telnyx 422) does not stop the next one; refused credentials, a 403, a pause, a failure or a timeout stop the next ones.

Gladys gives an action one minute, its own wait for the connection included; the module takes 40 seconds of it. A request lasts 10 seconds at most; a recipient with less than 16.5 seconds left (the request and the two /data writes around it) is not tried.

The safeguards​

  • Allowed numbers only: a number outside the list is refused before any request. The list, the provider and its credentials are read again just before each request: a number removed while its message waits is not sent.
  • Daily cap (rolling 24 hours, one count for both providers): a send that would bring the SMS billed over the last 24 hours above the setting is refused (a 2-part text counts 2, each recipient counts). The number of parts is the one the module computes; when Telnyx announces more in its answer, the count is raised afterwards (Plivo does not say it). A message is counted and written to /data before its request leaves; it is given back only when the provider surely did not take it: server not found, connection refused, a 429, or an error documented as answered before anything is queued (Plivo: 400, 401, 404; Telnyx: 400, 401, 403, 404, 422). Any other 4xx error (402, a Plivo 403 or 422, 408, 409, 413…) counts as "may have left". A restart therefore does not reset the count. At start, a send waits for /data to be read (3 seconds at most); a damaged entry of /data counts as a message sent at that moment. When /data is unreadable, too slow, or cannot be written (the status says so in each case), a spare budget counted in memory applies: 2 SMS per 24 hours at most; past it, nothing leaves until /data reads and writes again. A restart in that state starts this spare budget again. A /data that does not exist yet (first start) gives the normal cap.
  • Never tried again when a message may have left (timeout, connection cut, 5xx error, a 4xx not listed above, an answer that does not read or with a status this module does not know, such as a Telnyx sending_failed): a second try could be a second paid message. The result says "sent without confirmation". With Telnyx, each message also carries its own Idempotency-Key.
  • One request at a time; at most 20 jobs wait for their turn, more are refused.
  • Pause: after a 429 (the provider asks to slow down), the time it gives (Retry-After), between 60 s and 6 h; after a 5xx error, 60 s, doubled on each new error, 6 h at most. Nothing is sent during the pause, buttons included; it is kept in /data.
  • Credentials refused for sending (401 on sending a message): no scene uses them any more. Two short fingerprints (8 bits each, salted) of the provider and its credentials are kept in /data, never a credential. The refusal is lifted by changing the provider or its credentials (new ones are tried; after a restart, unless both fingerprints match by chance, 1 in 65,536), or by a success of either button. A 401 of the "Check the account" button (balance API) does not block sending.
  • 403 at a send (Telnyx): the status says so; the next send is tried all the same (the provider decides).

Text, accents and cost​

An SMS holds 160 characters of the SMS alphabet (GSM 7-bit), or 153 per part beyond. This alphabet has é, è, à, ù, ì, ò, Ç but not ê, â, î, ô, û, ë, ï, ç, œ, ’, « », nor emojis: one of them turns the whole text into Unicode, 70 characters per SMS (67 per part). The characters € [ ] { } ^ ~ | \ count twice. 10 parts at most stay under the limits of both providers (Plivo: 1,600 GSM or 737 Unicode characters).

"Simplify" replaces ê with e, ç with c, œ with oe, ’ with ', « » with ", – with -, … with ..., the no-break space with a space. An emoji stays as it is.

Control and invisible characters are removed, line breaks are kept.

Status​

The status of the integration tells: ready (with the provider and the cap), provider, credentials, sender, profile or allowed numbers missing or unreadable, credentials refused, pause in progress and its end time (UTC), 403 at the last send, configuration not read yet (new try after 5 s, 10 s, 30 s, 1 min, then every 5 min), /data unreadable or too slow, /data not written.

Data​

  • Sent to Plivo: the Auth ID (path and header) and the Auth Token (header), and src, dst, text, type: "sms". Sent to Telnyx: the API key (header), and from (when set), to, text, type: "SMS", messaging_profile_id (when set).
  • Kept in /data/plivo-telnyx-state.json: the time and the number of parts of the messages of the last 24 hours, the pause in progress, the salt and the two 8-bit fingerprints of refused credentials. No credential, no number, no text.
  • Logs: masked numbers, the number of parts, a Telnyx error code (digits), never the text nor a credential.

Limits​

  • This is not a Gladys messaging channel: the Gladys "Send a message" action does not go through it. On purpose: a channel would also get the Gladys system messages, as many paid messages sent without a scene action.
  • Delivery reports are not followed: "accepted" means the provider queued the message, not that it arrived.
  • Plivo Powerpacks (powerpack_uuid) are not offered in this first version: a Plivo sender is needed.

Parámetros de configuración​

Estos son los parámetros que plivo-telnyx te pide en su pantalla de configuración en Gladys.

ParámetroTipoObligatorioDescripción
SMS through Plivo or TelnyxsectionNoUnofficial connector, not affiliated with Plivo nor Telnyx. Your scenes send SMS with the "Send an SMS (Plivo / Telnyx)" action through your own account at the provider chosen below: each message is paid from that account. One provider at a time: only its credentials are used. Messages go only to the allowed numbers below, within the cap per 24 hours below. Nothing is ever sent at another time (nothing at start, nor when you save this page), and nothing is received.
ProviderselectSíThe SMS provider used. Only the fields of this provider are read; those of the other one are ignored.
Plivo Auth IDstringNoPlivo only: the Auth ID shown on the overview page of the Plivo console (letters and digits).
Plivo Auth TokensecretNoPlivo only. Kept by Gladys in its database, never shown again, sent only to Plivo (Authorization header).
Telnyx API keysecretNoTelnyx only: an API key of the Telnyx portal (API Keys). Kept by Gladys in its database, never shown again, sent only to Telnyx (Authorization header).
Telnyx messaging profile id (optional)stringNoTelnyx only: the id (a UUID) of a messaging profile. Needed with an alphanumeric sender; without a sender, Telnyx picks a number of the profile's number pool.
SenderstringNoA number of your account at the provider, in the international format (+ or 00), or an alphanumeric sender id (3 to 11 letters or digits, at least one letter) where the country allows it. Required for Plivo; for Telnyx, it may stay empty with a messaging profile.
Allowed numbersstringSíThe only numbers messages may go to, in the international format (+ or 00 then the country code), separated by commas, 10 at most. A scene action without numbers sends to all of them.
Maximum SMS per 24 hoursnumberNoSafety cap against a runaway scene: the SMS billed over the last 24 hours (a long text counts as several), 1 to 200. Beyond it, nothing is sent and the scene action fails.
Maximum parts per messagenumberNoAn SMS longer than 160 characters (70 with a character outside the SMS alphabet, like ê or an emoji) is billed as several. Beyond this number (1 to 10), the text is cut and ends with "...".
AccentsselectNo"Simplify" replaces the letters outside the SMS alphabet (ê, ç, ô, œ…) and the typographic signs (’ « » …) by the closest ones (e, c, o, oe, ' " ...), so a text keeps 160 characters per SMS.

Cómo instalar plivo-telnyx en Gladys​

  1. En Gladys, abre Integraciones: plivo-telnyx aparece en el catálogo junto a las integraciones nativas, con una insignia de comunidad.
  2. Haz clic en Instalar. Gladys descarga la imagen Docker (ghcr.io/lm1lc3n7/gladys-plivo-telnyx:0.1.1), la ejecuta en un entorno aislado del núcleo y genera la interfaz de la integración (dispositivos, descubrimiento y configuración).
  3. Abre la pantalla de Configuración de la integración, rellena los parámetros y guarda.
  4. También puedes instalarla directamente desde la URL de su repositorio: https://github.com/LM1LC3N7/gladys-plivo-telnyx.

plivo-telnyx requiere Gladys >=5.1.0. El catálogo de Gladys se actualiza cada hora, así que una nueva versión está disponible como máximo una hora después de publicarse.

¿Todavía no usas Gladys? Es gratuito y de código abierto: sigue la guía de instalación para empezar.

Sobre las integraciones externas​

plivo-telnyx es una integración externa: una integración comunitaria empaquetada como contenedor Docker y publicada en GitHub. Gladys la instala con un clic y la ejecuta en un entorno aislado del núcleo. La publica y mantiene LM1LC3N7, no el equipo principal de Gladys.

Suscríbete a la newsletter de Gladys Assistant

Unos pocos correos al mes sobre nuevas versiones y novedades del proyecto. Enviados por Pierre-Gilles Leymarie, fundador del proyecto. Puedes darte de baja cuando quieras 🙂