Skip to main content

Speedtest.net & Cloudflare smart home integration, free and open source

Speedtest.net & Cloudflare integration for Gladys Assistant

Measure your internet speed on a schedule with Speedtest.net or Cloudflare.

Measure your internet connection on a schedule, straight from Gladys, using the worldwide network of Speedtest.net servers or Cloudflare's speed test. Every run feeds four sensors you can chart on your dashboard and use in scenes:

SensorUnitWhat it tells you
DownloadMbit/sHow fast data reaches your home
UploadMbit/sHow fast data leaves your home
PingmsReaction time of the connection (lower is better)
JittermsStability of that reaction time (lower is better)

Typical uses: keep an eye on what your ISP actually delivers, get notified by a scene when the download rate drops below what you pay for, or detect that a backup line (4G failover…) has taken over.

How a test works​

The integration talks directly to Speedtest.net infrastructure — no account, no API key, no Ookla software installed. By default it probes the closest servers, keeps the healthiest one, then measures latency, download and upload (about 25 seconds in total). You can pin a specific server instead: press List nearby servers to see IDs, and paste one into the Speedtest.net server ID field.

Choosing the engine​

The Test engine field picks who you measure against. Both engines feed the same four sensors, with the same schedule, parallel connections and measurement time: switching keeps your device, its history and your scenes.

  • Speedtest.net (default): a nearby server of the Speedtest.net network, picked automatically or pinned by its ID.
  • Cloudflare: the closest point of presence of Cloudflare's network, the one behind speed.cloudflare.com. No server to choose, no account. The widget shows it as Cloudflare followed by the airport code of its city (CDG for Paris, FRA for Frankfurt…).

The Cloudflare engine can also show your public IP address, as Cloudflare sees it: turn on Show my public IP (Cloudflare). It then appears in the widget and in the result of the manual test, and is kept with the last result in the integration's storage. It is never written to the logs. Off by default.

Cloudflare measures latency on an empty request, minus the processing time its server reports, and keeps the best of 20 samples; jitter is the mean gap between successive samples, as with Speedtest.net. Figures from the two engines are close but not identical: compare a line with itself, on one engine.

Things to know​

  • A test saturates your connection while it runs. Results are also slightly conservative on very fast lines, since the measurement shares CPU with the sandbox limits Gladys applies to integrations.
  • A test transfers real data — several hundred MB per run on a fast line, whatever the engine (on a gigabit line, up to about 1.5 GB per direction with the default settings). If your plan has a data cap, increase the interval between tests or disable automatic tests and use the manual button only.
  • Cloudflare limits heavy use. After a lot of traffic in a short time (two gigabit tests a few minutes apart, in our trials), it refuses large downloads for a while with an HTTP 429 error: the test then fails with a message that says so, and the next scheduled one tries again. An automatic test can never run more often than every 10 minutes.
  • Scheduled tests follow the Interval between tests setting (default: one test per hour). The Run a speed test now button works at any time.

Dashboard widget​

With Gladys 5.1 or later, the integration adds an Internet speed widget to the dashboard editor (Add a widget → Speedtest.net & Cloudflare). It shows:

  • two tiles, download and upload, side by side: whole Mb/s, or Gb/s with one decimal beyond 1,000 Mb/s (1.2 Gb/s);
  • a history area chart of two sensors: Chart picks Download and upload (default) or Ping and jitter, History window the last 24 hours, the last week (default) or the last month;
  • the ping and jitter of the last test, when it ran and the server it used (Speedtest.net: operator and city; Cloudflare: Cloudflare · CDG), your public IP when you asked for it, and Test in progress while one runs;
  • a Run a test button. The result shows as a notification when the test ends (about half a minute). Tapping it while a test already runs does not start another one.

Display shortens the widget: Full (default) is the layout above; Speeds, ping and chart keeps three tiles (download, upload, ping) and the chart; Speeds and ping keeps the three tiles alone. The two shorter ones have no status rows nor button: a test still runs from the integration's configuration.

"Run a test" button: By the display (default: in the full layout only), Always or Never, for each widget.

Good to know:

  • The chart reads the device sensors: add the device to Gladys (Integrations → Speedtest.net & Cloudflare → Discovery) for it to fill.
  • The widget only rounds what it shows: Gladys keeps the measured values, decimals included, in the sensors and their history.
  • The last result is kept by the integration across restarts. Before the first test, the tiles show a dash and the widget says no result is known yet.
  • Chart intervals and the long-term history follow your Gladys settings for device history (data retention).

Scenes​

  • Trigger Automatic speed test failed: an automatic test could not run, often because Internet is down. Variables: the error and the number of failures in a row. Tests run every hour by default (10 minutes at the least): a short outage between two tests is not seen.
  • Action Run a speed test: waits for the result (about 30 s) and gives the next actions Test succeeded, the download, upload, ping and jitter, or the error. A failed test does not fail the action: Test succeeded says it, in a message for instance. The test also updates the device sensors, which a condition can check. A test a scene asked for never fires the trigger above.

Example: when the ping goes above 300 ms (trigger on the device value), send a notification, wait 2 minutes, run a speed test, and continue only if the ping is still high.

Troubleshooting​

  • Results lower than the official app: increase Parallel connections (fast lines fill better with 6–8) or Measurement time.
  • Test fails: the closest server may be down — pin a different Speedtest.net server ID, or clear the field to let auto-selection skip unhealthy servers. With the Cloudflare engine, an HTTP 429 error means Cloudflare is limiting your address for a while: lengthen the interval, or lower the measurement time.
  • The server ID does nothing: it only applies to the Speedtest.net engine.
  • Logs: at the default level the integration logs its start, your manual tests and the first failure of the automatic test (then once when it works again). To see every test, its server and its result, set the environment variable LOG_LEVEL=debug on the container.

This integration is an independent community project, not affiliated with or endorsed by Ookla or Cloudflare. Speedtest® is a trademark of Ookla, LLC; Cloudflare® is a trademark of Cloudflare, Inc.

Configuration settings​

These are the settings Speedtest.net & Cloudflare asks for in its configuration screen in Gladys.

SettingTypeRequiredDescription
How it workssectionNoA test saturates your connection for about 25 seconds and can transfer several hundred MB per run, whatever the engine: mind your data cap when choosing the interval. Results are stored as four sensors (download, upload, ping, jitter) you can chart and use in scenes.
Test engineselectNoSpeedtest.net measures against a nearby server; Cloudflare against its closest point of presence, without choosing a server.
Run tests automaticallybooleanNoWhen disabled, tests only run through the manual button below.
Interval between tests (s)numberNoSeconds between automatic tests. 3600 = one test per hour.
Speedtest.net server ID (optional)stringNoLeave empty to auto-select the closest healthy server. Use the "List nearby servers" button to find IDs.
Show my public IP (Cloudflare)booleanNoCloudflare engine only: keeps the public IP address it sees and shows it in the widget and the test result. Never written to the logs.
Parallel connectionsnumberNoTCP connections per direction. More connections fill fast links better.
Measurement time per direction (s)numberNoLonger measurements are steadier but transfer more data.

How to install Speedtest.net & Cloudflare in Gladys​

  1. In Gladys, open Integrations: Speedtest.net & Cloudflare appears in the catalog, next to the native integrations, with a community badge.
  2. Click Install. Gladys pulls the Docker image (ghcr.io/guim31/gladys-speedtest:1.6.1), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration).
  3. Open the Configuration screen of the integration, fill in the settings, and save.
  4. You can also install it directly from its repository URL: https://github.com/guim31/gladys-speedtest.

Speedtest.net & Cloudflare requires Gladys >=5.1.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.

Not running Gladys yet? It is free and open source: follow the installation guide to get started.

About external integrations​

Speedtest.net & Cloudflare is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by guim31, not by the Gladys core team.

Subscribe to the Gladys Assistant newsletter

A few emails per month about new releases and project news. Sent by Pierre-Gilles Leymarie, founder of the project. Unsubscribe anytime 🙂