Skip to main content

Async Python client for querying connected devices on EE SmartHub routers via USP over MQTT WebSocket

Project description

EE SmartHub Client

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

import asyncio
from ee_smarthub import SmartHubClient

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

asyncio.run(main())

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 latest .proto files from the Broadband Forum repository and generates Python code using betterproto into src/ee_smarthub/proto/.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ee_smarthub-0.1.1.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ee_smarthub-0.1.1-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file ee_smarthub-0.1.1.tar.gz.

File metadata

  • Download URL: ee_smarthub-0.1.1.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ee_smarthub-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bf62865468d5c65f0818fce2f984d85fc64deafe3b06af2746ab73d27cceda6d
MD5 c612acf91c44f35fe4f8a15fa09e2280
BLAKE2b-256 0c3186f1f0c66f49857daf42de7a94061ad72c72547bc29d9f619977ae528a08

See more details on using hashes here.

Provenance

The following attestation bundles were made for ee_smarthub-0.1.1.tar.gz:

Publisher: publish.yml on conor-mccann/ee-smarthub-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ee_smarthub-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ee_smarthub-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ee_smarthub-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 06f669b34fe99191d400cba0190fd3e4fde84c9317612c84c4f99419f9d9878c
MD5 b1fe296f85374faf3bb9ddb4a7ba6e01
BLAKE2b-256 107f27de0080af89c97c1a224c4ec95048b2de6d6c4a9d5760ee5d26d02a5a01

See more details on using hashes here.

Provenance

The following attestation bundles were made for ee_smarthub-0.1.1-py3-none-any.whl:

Publisher: publish.yml on conor-mccann/ee-smarthub-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page