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 Router's Active flag (can stay set after leaving)
connected bool False if the router reports no link for the device
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.6.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.6.0
File Size Uploaded Provenance Actions
ee_smarthub-0.6.0.tar.gz 23.5 kB With provenance Details for ee_smarthub-0.6.0.tar.gz

Built distribution (wheel)

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

Total release size: 41.2 kB

Release files / ee_smarthub-0.6.0.tar.gz

Download URL ee_smarthub-0.6.0.tar.gz
Size 23.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1ce866aa56a3d432114d2176dba8bd861c4fb49f9f85bc2d3ce6ead3aa6fa4a4
BLAKE2b-256 checksum
How to use checksums
1d2b63965c5981def334c8c4b4544a4fcc58105ac1cfdaa3bf1e1243984554a0
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 25, 2026.

Transparency log

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

Download URL ee_smarthub-0.6.0-py3-none-any.whl
Size 17.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c02d502406d7f0a1243762b0b9697167bb137a0b6e2f516a47d2e7affc55d59
BLAKE2b-256 checksum
How to use checksums
77578a666536bcb90605ac7f41157e62874d7e49fc4a290c36e7d6cb862f900c
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 25, 2026.

Transparency log

Security for ee-smarthub 0.6.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.6.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 25, 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