tb-mqtt-client
ThingsBoard python client SDK
What it is and what it does
This package provides a Python client library for interacting with ThingsBoard, an open-source IoT platform. It abstracts the complexity of MQTT and HTTP communication, allowing developers to send device telemetry, manage attributes, subscribe to server updates, and handle remote procedure calls without building protocol handlers from scratch.
The SDK supports both device and gateway modes, with MQTT offering QoS 0 and 1 delivery guarantees and automatic reconnection, while HTTP provides a simpler alternative for basic operations. It includes built-in support for TLS encryption, firmware updates, and device claiming. The library wraps tb-paho-mqtt-client for MQTT operations and requests for HTTP, simplifying integration into Python applications that need to communicate with ThingsBoard.
Use it for:
- Send sensor readings and device metrics to ThingsBoard for real-time monitoring and visualization
- Subscribe to attribute changes from the server to dynamically update device configuration
- Implement gateway functionality to relay telemetry from constrained devices through a single connection
- Handle remote procedure calls from ThingsBoard to trigger device actions or retrieve system information
- Manage secure MQTT connections with TLS certificates for production IoT deployments
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python client SDK for ThingsBoard IoT platform, supporting MQTT and HTTP protocols for sending telemetry, managing attributes, handling RPC commands, and device/gateway operations.
Yes. The package is actively maintained, has no known vulnerabilities, requires only three lightweight dependencies, and provides a straightforward abstraction over MQTT and HTTP protocols for ThingsBoard integration. It is well-suited for any Python IoT application targeting the ThingsBoard platform. Install if you are building a device or gateway client for ThingsBoard.
Install
tb-mqtt-client on PyPI
pip
pip install tb-mqtt-clientuv
uv add tb-mqtt-clientpoetry
poetry add tb-mqtt-clientInstalling tb-mqtt-client
Before you install
Low install friction with a pure-wheel distribution. Actively maintained with recent commits and steady releases since 2019. Requires Python 3.9 or later.
License in practice
Licensed under Apache Software License 2.0 (permissive), allowing commercial and private use with minimal restrictions.
Quickstart
pip install tb-mqtt-client
from tb_mqtt_client import TBDeviceMqttClient
client = TBDeviceMqttClient("127.0.0.1", username="A1_TEST_TOKEN")
client.connect()
client.send_telemetry({"temperature": 41.9})
client.disconnect()
Requires Python 3.9 or later; ThingsBoard server must be accessible at the specified host and port.
Verify before relying
- Whether TLS v1.2 is the only supported TLS version or if newer versions are also supported
- Performance characteristics when handling high-frequency telemetry or large device counts
- Specific version constraints or compatibility notes for tb-paho-mqtt-client, requests, and orjson
Package facts
| License | Apache Software License (Apache Software License 2.0) (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — tb-paho-mqtt-client, requests, orjson |
| Maintenance | actively maintained — 171 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 109,779/month — #12,499 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: tb_mqtt_client-1.13.13-py3-none-any.whl
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
pymysensorsPython API for communicating with MySensors…
permissive · top 15,000 on PyPI
tb-paho-mqtt-clientProvides an MQTT client library implementing…
copyleft · top 15,000 on PyPI
awsiotsdkConnects Python applications to AWS IoT Core…
permissive · top 5,000 on PyPI
paho-mqttProvides an MQTT client library for connecting…
copyleft · top 5,000 on PyPI
gmqttgmqtt is an async Python MQTT client that…
permissive · top 15,000 on PyPI
meross-iotA Python library for controlling Meross IoT…
permissive · top 15,000 on PyPI
tuya-device-sharing-sdkA Python SDK for Tuya's Open API that handles…
permissive · top 15,000 on PyPI
yoto-apiAsync Python client for controlling Yoto player…
permissive · top 15,000 on PyPI
scarf-sdkA Python client for sending telemetry events to…
unclear · top 15,000 on PyPI
pysmappeeWrapper library for the Smappee energy…
permissive · top 15,000 on PyPI