Skip to main content

mithermometer - Library for Xiaomi Aqara temperature and humidity sensor

PyPI PyPI PyPI GitHub license

This library lets you read sensor data from a Xiaomi Aqara temperature and humidity sensor.

the mithermometer library is based on the miflora library. Thanks for this great lib.

Functionality

It supports reading the different measurements from the sensor

  • temperature
  • humidity

To use this library you will need a Bluetooth Low Energy dongle attached to your computer. You will also need a Xiaomi Aqara thermometer.

Backends

As there is unfortunately no universally working Bluetooth Low Energy library for Python, the project currently offers support for two Bluetooth implementations:

  • bluepy library
  • bluez tools (via a wrapper around gatttool)
  • pygatt library

bluepy

To use the bluepy library you have to install it on your machine, in most cases this can be done via: pip3 install bluepy

Example to use the bluepy backend:

from mithermometer.mithermometer_poller import MiThermometerPoller
from btlewrap.bluepy import BluepyBackend

poller = MiThermometerPoller('some mac address', BluepyBackend)

This is the backend library to be used.

bluez/gatttool wrapper

To use the bluez wrapper, you need to install the bluez tools on your machine. No additional python libraries are required. Some distrubutions moved the gatttool binary to a separate package. Make sure you have this binaray available on your machine.

Example to use the bluez/gatttool wrapper:

from mithermometer.mithermometer_poller import MiThermometerPoller
from btlewrap.gatttool import GatttoolBackend

poller = MiThermometerPoller('some mac address', GatttoolBackend)

This backend should only be used, if your platform is not supported by bluepy. Note: gatttool is depracated in many Linux distributions.

pygatt

If you have a Blue Giga based device that is supported by pygatt, you have to install the bluepy library on your machine. In most cases this can be done via: pip3 install pygatt

Example to use the pygatt backend:

from mithermometer.mithermometer_poller import MiThermometerPoller
from btlewrap.pygatt import PygattBackend

poller = MiThermometerPoller('some mac address', PygattBackend)

Dependencies

mithermometer depends on the btlewrap library. If you install mithermometer via PIP btlewrap will automatically be installed. If not, you will have to install btlewrap manually:

pip3 install btlewrap

Conttributing

please have a look at CONTRIBUTING.md

Projects Depending on mithermometer

The following shows a selected list of projects using this library:

Release files for mithermometer 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mithermometer 0.1.4
File Size Uploaded
mithermometer-0.1.4.tar.gz 10.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mithermometer 0.1.4
File Interpreter ABI Platform
mithermometer-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 26.9 kB

Release files / mithermometer-0.1.4.tar.gz

Download URL mithermometer-0.1.4.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
cf3fb090224c29a2d5701e0c240adc4b33409b7a3b02c1a2c3c52fe94d6a6708
BLAKE2b-256 checksum
How to use checksums
ed6198d4299f9e79563b4aca6dbe92268cc32905f7fc359a01ef90407a041de6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release files / mithermometer-0.1.4-py3-none-any.whl

Download URL mithermometer-0.1.4-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
15b9875dae250681bd7a12f08e5edc18f794b29484765f38baf5523c3a7053e4
BLAKE2b-256 checksum
How to use checksums
8cf94e638f45a9996598acc601269ac6322a0d05af1646852ead20124a553c2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page