Skip to content

BindThings/bindthings-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BindThings Python

Official Python client for the BindThings IoT Platform.

Installation

pip install bindthings

Quick Start

from bindthings import BindThings

bt = BindThings("YOUR_DEVICE_TOKEN")
bt.connect()
bt.send({"temperature": 25.5, "humidity": 60})

API Reference

Constructor

bt = BindThings(token, client_id=None)

Connect

bt.connect()              # Background thread (non-blocking)
bt.connect(blocking=True) # Foreground (blocking)

Send Telemetry

bt.send({"temperature": 25.5})
bt.send({"temperature": 25.5, "humidity": 60, "pressure": 1013})

Receive Commands

def on_command(payload: str):
    import json
    data = json.loads(payload)
    print(data)

bt.on_command(on_command)

Status

bt.set_online(True)   # Mark device as online
bt.set_online(False)  # Mark device as offline
bt.is_connected()     # Check connection
bt.disconnect()       # Graceful disconnect

Examples

Example Description
basic.py Send temperature and humidity every 15 seconds
dht22.py Read DHT22 on Raspberry Pi and send to BindThings

Connection Details

Parameter Value
Broker mqtt.bindthings.io
Port 8883 (TLS)
Username Your Device Token
Password Your Device Token

License

MIT License — © 2025 BindThings

About

Official Python client for BindThings IoT Platform — pip install bindthings

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages