{"id":22441,"library":"tb-mqtt-client","title":"ThingsBoard MQTT Python Client","description":"Official ThingsBoard Python client SDK for MQTT-based device communication. Current version 1.13.13, actively maintained with monthly releases. Supports telemetry upload, attribute publishing, RPC handling, and provisioning for ThingsBoard IoT platform.","status":"active","version":"1.13.13","language":"python","source_language":"en","source_url":"https://github.com/thingsboard/thingsboard-python-client-sdk","tags":["thingsboard","iot","mqtt","client-sdk"],"install":[{"cmd":"pip install tb-mqtt-client","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"MQTT protocol implementation","package":"paho-mqtt","optional":false}],"imports":[{"note":"Wrong module name leads to ImportError","wrong":"from tb_mqtt_client import TBDeviceMqttClient","symbol":"TBDeviceMqttClient","correct":"from tb_device_mqtt import TBDeviceMqttClient"}],"quickstart":{"code":"from tb_device_mqtt import TBDeviceMqttClient\nimport os\n\nclient = TBDeviceMqttClient(\"demo.thingsboard.io\", username=os.environ.get('TB_ACCESS_TOKEN', ''))\nclient.connect()\nclient.send_telemetry({\"temperature\": 22.5})\nclient.disconnect()","lang":"python","description":"Connects to ThingsBoard, sends telemetry using access token authentication."},"warnings":[{"fix":"Use keyword argument tls=True when connecting to TLS endpoints.","message":"TBDeviceMqttClient no longer supports direct host passing in constructor with TLS; use TBDeviceMqttClient(host, port=8883, tls=True) or set tls=True explicitly.","severity":"breaking","affected_versions":">=1.10.0"},{"fix":"Remove qos parameter from send_telemetry calls.","message":"The 'quality_of_service' parameter in send_telemetry is deprecated and will be removed in a future version.","severity":"deprecated","affected_versions":">=1.12.0"},{"fix":"Implement manual reconnection logic using on_disconnect callback or enable automatic reconnect via paho-mqtt options.","message":"The client does not auto-reconnect by default; connection loss leads to silent failures.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Install with 'pip install tb-mqtt-client' and import using 'from tb_device_mqtt import TBDeviceMqttClient'.","cause":"Installed wrong package or imported incorrect module name.","error":"ImportError: No module named tb_device_mqtt"},{"fix":"Create client with host parameter: TBDeviceMqttClient('host', port=1883) and call client.connect() without arguments.","cause":"Passing host and port as positional arguments in connect() method; new versions require host in constructor.","error":"tb_device_mqtt.TBDeviceMqttClient: connect() takes 1 positional argument but 2 were given"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}