Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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)
--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, 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.1.0b2

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.1.0b2
File Size Uploaded Provenance Actions
solentlabs_internet_health_monitor_core-0.1.0b2.tar.gz 66.2 kB With provenance Details for solentlabs_internet_health_monitor_core-0.1.0b2.tar.gz

Built distribution (wheel)

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

Total release size: 115.5 kB

Release files / solentlabs_internet_health_monitor_core-0.1.0b2.tar.gz

Download URL solentlabs_internet_health_monitor_core-0.1.0b2.tar.gz
Size 66.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f9b45176d6f2b47f1ffc7d851a9f08c29501e76c5ad6a67d191b9a27f605942f
BLAKE2b-256 checksum
How to use checksums
2f74d99e9b11ba62030063613550f022306fb876beea22a4e75b1bbb8f7be052
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 Nov 21, 2026.

Transparency log

Release files / solentlabs_internet_health_monitor_core-0.1.0b2-py3-none-any.whl

Download URL solentlabs_internet_health_monitor_core-0.1.0b2-py3-none-any.whl
Size 49.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
19a736e77c3cdea56cb0307f8978e6efc39d3a9d14b6cd4c7de98faed46ced43
BLAKE2b-256 checksum
How to use checksums
3a48ec10b294885a3820a8a7003eea37193d832c4808793b51588e6287a7dc0a
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 Nov 21, 2026.

Transparency log

Security for solentlabs-internet-health-monitor-core 0.1.0b2

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.1.0b2.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 Nov 21, 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