Skip to main content

A py package to access the T-Mobile Home Internet API

Project description

T-Mobile Home Internet API Client

A python client for the T-Mobile Home Internet API.

This package was developed for use by ha-tmobilehome, a Home Assistant integration.

Tested against a Sercomm TMO-G4SE gateway, hardware version R02 and software version 1.03.20.

Installation

pip install pytmhi

Usage

from pytmhi import TmiApiClient
client = TmiApiClient("admin",<admin-password>)
version = client.get_version()

Functions

All functions are synchronous (blocking).

Retrieve gateway device details, basic received signal values, and current time.

get_gateway_config()

Retrieve basic received signal values (same as included in above).

get_gateway_signal()

Retrieve detailed cell tower and received signal values.

get_cell()

Retrieve sim card data.

get_sim()

Retrieve wired and wireless client details.

get_clients()

Retrieve access point (wireless) settings.

get_ap_config()

Set access point (wireless) settings.

Note: Gateway will reset and may lose communications for a minute or more.

set_ap_config(new_ap_config)
Parameter Type Required? Description
new_ap_config dict required Contains entire contents from get_ap_config() with any changes to be made. (See example below.)

Cause immediate reboot of gateway.

reboot_gateway()

Retrieve current version of API.

get_version()

Examples

Retrieve 4G RSRQ (Reference Signal Received Quality)

rsrq__4g = client.get_gateway_signal()["signal"]["4g"]["rsrq"]

Retrieve 5G Cell Tower ECGI (Cell Global Identifier)

ecgi_5g = client.get_cell()["cell"]["5g"]["ecgi"]

Turn off 2.4GHz WiFi

Do not turn off WiFi unless you are connected to the gateway via a cable!

Note: Gateway will reset and may lose communications for a minute or more.

access_point_config = client.get_ap_config()
access_point_config["2.4ghz"]["isRadioEnabled"] = False
client.set_ap_config(access_point_config)

Acknowledgements

Thanks to Michael R. Torres (micrictor) for providing the original version of this fork. Also thanks to Zachary Wander (zacharee), author of HINTControl, which provided a much-needed API reference.

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

pytmhi-1.1.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

pytmhi-1.1.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file pytmhi-1.1.0.tar.gz.

File metadata

  • Download URL: pytmhi-1.1.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for pytmhi-1.1.0.tar.gz
Algorithm Hash digest
SHA256 10a26a22658be3d6690b7cf8be3c31abc6467e87420c2452ffeff6833314dcbf
MD5 ce5dea4623b03a3920fc7c6c3843de16
BLAKE2b-256 98d7889f789d5c8aeb8e545cbe0a86e3cc28d9fe082e7af0c9cd576316435107

See more details on using hashes here.

File details

Details for the file pytmhi-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: pytmhi-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for pytmhi-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cf0993d1ab5739b2e4c4c5982756b457ff67ab96b61449fea65836458ca8d718
MD5 46b0a2383142a14e66e009720c13b487
BLAKE2b-256 3bfe524b3e3fdbb5e2653cc1dfea548ee9857329fb7aeeac2cb335d40be49b91

See more details on using hashes here.

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