Skip to main content

EE SmartHub Client

PyPI Python License: MIT

Python async client library for interacting with EE SmartHub routers using the USP protocol over MQTT WebSocket.

Why This Library?

The EE SmartHub web interface is React-based and dynamically loads data via JavaScript, making traditional web scraping impractical. This library uses the router's native USP (User Services Platform) protocol providing:

  • Reliable data access — won't break with UI changes
  • Efficient communication — direct protocol access, not HTML parsing
  • Structured data — clean, typed Python objects

Installation

pip install ee-smarthub

Usage

The client requires an aiohttp.ClientSession, allowing callers to manage session lifecycle. An optional timeout= argument (seconds, default 10) bounds each network operation.

import asyncio
import aiohttp
from ee_smarthub import SmartHubClient

async def main():
    async with aiohttp.ClientSession() as session:
        client = SmartHubClient("192.168.1.1", "your-password", session)
        hosts = await client.get_hosts()
        for host in hosts:
            print(f"{host.name:30s} {host.ip_address:15s} {host.mac_address}")

asyncio.run(main())

Validating Credentials

To check that the router is reachable and the password is correct without fetching device data:

async with aiohttp.ClientSession() as session:
    client = SmartHubClient("192.168.1.1", "your-password", session)
    serial = await client.validate_connection()  # raises on failure

It returns the router's serial number.

This performs an HTTP fetch and MQTT connect/disconnect. It raises AuthenticationError if the router rejects the password, CommunicationError if it can't be reached or times out, and ProtocolError if config.json is malformed.

Host Fields

Each Host object contains:

Field Type Description
mac_address str Physical (MAC) address
ip_address str IP address
hostname str DHCP hostname
user_friendly_name str User-assigned name (BT vendor extension)
name str (property) Best available name (user-friendly > hostname > MAC)
active bool Currently connected
interface_type str Connection type (e.g. "Wi-Fi", "Ethernet")
frequency_band str | None Wi-Fi band (e.g. "2.4GHz", "5GHz")
bytes_sent int Total bytes sent
bytes_received int Total bytes received

How It Works

The library implements the User Services Platform (USP) protocol defined by the Broadband Forum:

  1. Fetch serial number - HTTPS GET to {ROUTER_URL}/config.json
  2. Connect to MQTT - WebSocket connection to router on port 443
  3. Authenticate with router password
  4. Send USP request - Protobuf-encoded Get request for Device.Hosts.Host.*
  5. Parse response - Extract device parameters from protobuf response
  6. Disconnect - Close connection (short-lived connection model)

The connection is short-lived by design - simple, reliable, and efficient for typical polling intervals.

Development

Regenerating Protobuf Code

If the USP protocol specification is updated, regenerate the Python protobuf code:

./scripts/generate_proto.sh

This downloads the .proto files from the Broadband Forum repository and generates Python code using betterproto2 into src/ee_smarthub/proto/. By default it uses USP 1.4 from the v1.4.2 tag; pass a different proto file version and git tag as arguments if needed, e.g. ./scripts/generate_proto.sh 1-4 v1.4.2.

Security Considerations

The EE SmartHub uses a self-signed SSL certificate. This library disables certificate verification for HTTPS and WebSocket connections to communicate with the router, which means TLS connections are not fully verified.

Since the router is on your local network, exposure is limited. Ensure your local network is secure.

Compatibility

  • Python: 3.11+
  • Router: EE SmartHub
  • Protocol: USP

License

This project is licensed under the MIT License - see the LICENSE file for details.

Resources


Note: This is an unofficial client library and is not affiliated with or endorsed by EE Limited.

Metadata

Release files for ee-smarthub 0.5.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 ee-smarthub 0.5.0
File Size Uploaded Provenance Actions
ee_smarthub-0.5.0.tar.gz 23.1 kB With provenance Details for ee_smarthub-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ee-smarthub 0.5.0
File Interpreter ABI Platform Actions
ee_smarthub-0.5.0-py3-none-any.whl Python 3 none any Details for ee_smarthub-0.5.0-py3-none-any.whl

Total release size: 40.6 kB

Release files / ee_smarthub-0.5.0.tar.gz

Download URL ee_smarthub-0.5.0.tar.gz
Size 23.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f66017ce047947acaeefb98bf472f3cff7c444d6fb822ba4494bf524d449d1d8
BLAKE2b-256 checksum
How to use checksums
5b41a5a9c3c1228a221f1727f716c85cbb66f936a7d2c49e7c0a1636a62782d8
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 4, 2026.

Transparency log

Release files / ee_smarthub-0.5.0-py3-none-any.whl

Download URL ee_smarthub-0.5.0-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
061c94dbdcffbe215099e034cc015ac3ba999a5108a3e5a86899570a2aa17f61
BLAKE2b-256 checksum
How to use checksums
d39338b4ee7c7f5214fd34fc964d8fbbc63e9b93b7d63ecc06868b6f6337b872
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 4, 2026.

Transparency log

Security for ee-smarthub 0.5.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 ee_smarthub-0.5.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 Nov 4, 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