skillfed

tb-mqtt-client

ThingsBoard python client SDK

tb-mqtt-client v1.13.13 109.8K downloads/30d#12,499 on PyPI130
Permissive license Apache Software License (Apache Software License 2.0) Active released

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-client

uv

uv add tb-mqtt-client

poetry

poetry add tb-mqtt-client

Installing 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

thingsboard mqtt clientiot device telemetry pythonmqtt http iot sdkthingsboard python sdkdevice gateway mqtt clientiot platform integrationmqtt telemetry attributes
iot-platformmqtt-clientdevice-management

More Internet packages