Skip to main content

Library for reading temperature, humidity, and battery level from a SHT31 Smart Gadget Development Kit by Sensirion

Project description

Sensirion-SmartGadget

Python library for reading temperature, humidity, and battery level from a SHT31 Smart Gadget Development Kit by Sensirion.

Supported features

  • Direct reading of SHT31 sensor values and device battery level.
  • Subscription to notifications on value changes.
  • Output of manufacturer, model name, and firmware version.

Currently not supported

  • Downloading data from the integrated data logger.
  • Setup of data logger interval.

Installation

pip install sensirion-smartgadget

Usage

from sensirionbt import SmartGadget

sensor = SmartGadget('CA:FE:12:34:56:78')
print(sensor.get_values(init_static=True))
# 'init_static' is optional; it fetches following values immediately.
print("Manufacturer:", sensor.manufacturer)
print("Model:", sensor.model)
print("Firmware:", sensor.firmware_version)

Notes

  • The device only allows one connection at a time. If the connection keeps failing, make sure you have disconnected other services, e.g. the smartphone app.
  • On a connection failure, transmission will be re-attempted, depending on the ‘retries’ argument or property. The default is to retry twice.
  • The first connection and value readings take a few seconds. The reason for this is that characteristics are discovered by UUID, then handles are cached and reused for subsequent calls.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for python-smartgadget, version 0.1.3
Filename, size File type Python version Upload date Hashes
Filename, size python_smartgadget-0.1.3-py3.7.egg (9.8 kB) File type Egg Python version 3.7 Upload date Hashes View hashes
Filename, size python-smartgadget-0.1.3.tar.gz (4.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page