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)
    await client.validate_connection()  # raises on failure

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.4.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.4.0
File Size Uploaded Provenance Actions
ee_smarthub-0.4.0.tar.gz 23.1 kB With provenance Details for ee_smarthub-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 40.5 kB

Release files / ee_smarthub-0.4.0.tar.gz

Download URL ee_smarthub-0.4.0.tar.gz
Size 23.1 kB
Tags Source
SHA-256 checksum
How to use checksums
85c167137977408652cf6be639ab690a1a805ab9c5c20c861b9e9a2956743746
BLAKE2b-256 checksum
How to use checksums
7e798f8c8992d80a6e9eb57f534c396e86f2b96d08e27900944e253d67309a5d
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.4.0-py3-none-any.whl

Download URL ee_smarthub-0.4.0-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
368f9b7f88ed34e9f5b510d983fa78bdaa9fcd2dbec6f34505baa4c906e8ce68
BLAKE2b-256 checksum
How to use checksums
f0e126d6cae50fcc2f94b3a860bbf4eff35f7637897978a022a6005cea8ea557
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.4.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.4.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