Skip to main content

A Python3 class to interrogate Xiaomi Mijia LYWSD* sensors.

Project description

License PyPI version Supported Python versions PyPI downloads Code style: black pre-commit.ci status

pylywsdxx

This is a Python3 library to allow interrogation of Xiaomi Mijia LYWSD* sensors via Bluetooth Low Energy (BLE).

Note: This is an unofficial project, and is in no way supported or endorsed by Xiaomi.

Requirements

This module requires bluepy3 which should be installed automagically when using the installation instructions below.

Development of this package is done in Python 3.12. The package is considered forwards compatible at least upto Python 3.12 and probably also beyond. Backwards compatibility is not guaranteed; if it works on Python 3.9 or before consider yourself lucky. Python versions that are end-of-life are not supported.

The package has been extensively tested on a Raspberry Pi 3 Model B+ (aarch64) with Debian GNU Linux 12 /w Python 3.11.*.

Installation

pip install pylywsdxx

Usage

import pylywsdxx as pyly

mac = "A4:C1:38:0D:EA:D0"

device2 = pyly.Lywsd02(mac)
data2 = device2.data
print(f"Temperature: {data2.temperature}˚C")

device3 = pyly.Lywsd03(mac)
data3 = device3.data
print(f"Temperature: {data3.temperature}˚C")

Please note that this module has completely and intentionally broken backwards compatibility with previous and existing versions of lywsd02 and lywsd03mmc and with v1.* versions of itself.

Acknowledgements

Based on previous work stolen from Mikhail Baranov (h4) : lywsd02 and Duncan Barclay (uduncanu) : lywsd03mmc

Disclaimer & License

As of September 2024 pylywsdxx is distributed under AGPL-3.0-or-later.

Project details


Download files

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

Source Distribution

pylywsdxx-2.8.3.tar.gz (24.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pylywsdxx-2.8.3-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

Details for the file pylywsdxx-2.8.3.tar.gz.

File metadata

  • Download URL: pylywsdxx-2.8.3.tar.gz
  • Upload date:
  • Size: 24.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for pylywsdxx-2.8.3.tar.gz
Algorithm Hash digest
SHA256 3ea0ec4677273f16c937c1a257430780debf7bde7ce8a047d8d6f5ec20e3bf55
MD5 420274897b7f92f15596c561f409dc3a
BLAKE2b-256 d5ca1e50ec67a7cddb6a50d3343340ac0146db52a9574b9789a48e51bd5233e3

See more details on using hashes here.

File details

Details for the file pylywsdxx-2.8.3-py3-none-any.whl.

File metadata

  • Download URL: pylywsdxx-2.8.3-py3-none-any.whl
  • Upload date:
  • Size: 25.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for pylywsdxx-2.8.3-py3-none-any.whl
Algorithm Hash digest
SHA256 341313ba07e7a14593bb885573debb3666be6d73f2f4877668e1d11c2ef9b6c2
MD5 0b233c7816682564de4de54aa00b42dc
BLAKE2b-256 b4a636782e0747b12c55142057d3f20626cd19d2f65cab127740f8e20c9e6935

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page