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)
--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, 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.0b3

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.0b3
File Size Uploaded Provenance Actions
solentlabs_internet_health_monitor_core-0.1.0b3.tar.gz 69.3 kB With provenance Details for solentlabs_internet_health_monitor_core-0.1.0b3.tar.gz

Built distribution (wheel)

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

Total release size: 119.8 kB

Release files / solentlabs_internet_health_monitor_core-0.1.0b3.tar.gz

Download URL solentlabs_internet_health_monitor_core-0.1.0b3.tar.gz
Size 69.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6296fca1f3ab5f586ccdcbcfe4b34357155f656bb5303a7d1f50835f6d45d204
BLAKE2b-256 checksum
How to use checksums
d1c92d31c1beae7bc4692cb7c15b80baa4a748fa12902ee2f276bdd1ad4571e0
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 23, 2026.

Transparency log

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

Download URL solentlabs_internet_health_monitor_core-0.1.0b3-py3-none-any.whl
Size 50.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2c45b2878a5a3847a6efb8adf1b4774b3ba5d3e281bd02d73b675030fb950287
BLAKE2b-256 checksum
How to use checksums
1d8eeda66d504b5d522a20eb501d52e244c19380e441bb94fd7f8d082746ea69
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 23, 2026.

Transparency log

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

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.0b3.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 23, 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