Skip to main content

Internet Health Monitor Core

The measurement engine behind the Internet Health Monitor Home Assistant integration, usable on its own. It finds the gateway and the first three hops toward the internet, then reports per-hop latency, jitter and packet loss, plus DNS latency. It has no Home Assistant dependency.

Runs on Linux and Windows. On Linux it calls ip, ping and traceroute. On Windows it calls the IP Helper API directly, so it needs no extra tools and no admin rights; Windows reports round-trip times in whole milliseconds, so a sub-millisecond gateway reads 0 or 1 ms.

Command line

pip install solentlabs-internet-health-monitor-core

internet-health-monitor                 # one poll, one JSON line
internet-health-monitor --interval 60   # one JSON line per poll until stopped
internet-health-monitor --speed-test cloudflare   # one speed test, one JSON line
Option Default Meaning
--dns-server auto DNS server to time; auto reads /etc/resolv.conf
--ping-count 3 Pings per target per poll (1 to 10)
--internet-reference 1.1.1.1 Public IPv4 address pinged each poll as a reading past your ISP, like a hop, or off
--interval none Seconds between polls (up to 3600, and at least as long as a poll can take: 5 s per ping per target). Without it, one poll and exit. The HA integration uses 60
--hop-ownership off Add each public hop's network operator; sends those hop addresses to Team Cymru
--speed-test none Run one speed test with cloudflare, mlab or librespeed, print it, and exit. The service sees your public IP address
--data-limit 500 Most MB one speed test may use, both directions together (100 to 10000); each direction stops at half
--mlab-consent off Required with --speed-test mlab: M-Lab publishes every result with your public IP address, permanently

M-Lab asks each client for at most 40 tests a day, and at most 4 automated ones at random times. Run from cron or a script (no terminal on standard input), --speed-test mlab counts as automated and first waits a random time of up to an hour; runs past either limit are refused. Runs are recorded in internet-health-monitor/mlab_runs.json in your state directory (~/.local/state, or %LOCALAPPDATA% on Windows).

Jitter is the mean change between consecutive ping round trips within a poll, so it needs --ping-count of 2 or more. Speed test services and their terms: docs/SPEED_TEST_BACKENDS.md.

Library

from solentlabs.internet_health_monitor_core.network_diagnostics import (
    NetworkDiagnostics,
)

result = await NetworkDiagnostics().run_diagnostics()
print(result.to_dict())

# Speed test: pass your own aiohttp session; failures raise SpeedTestError.
import aiohttp
from solentlabs.internet_health_monitor_core.data_plan import automatic_limit
from solentlabs.internet_health_monitor_core.speed_test import DataLimit
from solentlabs.internet_health_monitor_core.speed_test_runner import run_speed_test

async with aiohttp.ClientSession() as session:
    speed = await run_speed_test("cloudflare", session, DataLimit.even(500))  # 250 MB each way
    # The next test sized from this one, as Home Assistant's automatic limit is:
    again = await run_speed_test("cloudflare", session, automatic_limit(speed))
print(speed.bufferbloat_grade, speed.download_ended_by, speed.upload_ended_by)

A result also gives each direction's latency increase under load and a bufferbloat grade on Waveform's scale (bufferbloat.py); data_plan.py holds the rules that size a test and space automatic ones.

License: MIT.

Metadata

Release files for solentlabs-internet-health-monitor-core 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for solentlabs-internet-health-monitor-core 0.3.0
File Size Uploaded Provenance Actions
solentlabs_internet_health_monitor_core-0.3.0.tar.gz 71.1 kB With provenance Details for solentlabs_internet_health_monitor_core-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for solentlabs-internet-health-monitor-core 0.3.0
File Interpreter ABI Platform Actions
solentlabs_internet_health_monitor_core-0.3.0-py3-none-any.whl Python 3 none any Details for solentlabs_internet_health_monitor_core-0.3.0-py3-none-any.whl

Total release size: 122.5 kB

Release files / solentlabs_internet_health_monitor_core-0.3.0.tar.gz

Download URL solentlabs_internet_health_monitor_core-0.3.0.tar.gz
Size 71.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7c18ee1bdbf1b5c9e34373c235c197966c4f3e7568d67c4cfa9be03b5a6f1914
BLAKE2b-256 checksum
How to use checksums
c9cafa495eef7067b2c8f9bf0666071c5c06169ab59e96c6ab63721a886729ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / solentlabs_internet_health_monitor_core-0.3.0-py3-none-any.whl

Download URL solentlabs_internet_health_monitor_core-0.3.0-py3-none-any.whl
Size 51.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6cfb90dd9ed610d606ec41aa951fca7a399a6a0ec528765d403d135342ede0a3
BLAKE2b-256 checksum
How to use checksums
7913771ce60716a7f4d91ce19faac8a12e78c2f780ff78b7c41b4fab9bcbfe62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Security for solentlabs-internet-health-monitor-core 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for solentlabs_internet_health_monitor_core-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page