A Python3 class to interrogate Xiaomi Mijia LYWSD* sensors.
Project description
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.11. 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
License
See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pylywsdxx-2.2.2.tar.gz
.
File metadata
- Download URL: pylywsdxx-2.2.2.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebeae1fe8863dd76261029b90512248d3f4a24a06207737752949017edcee3bd |
|
MD5 | d493285dabfddc9b1ed6a63694eeec3d |
|
BLAKE2b-256 | af7f2798e49936adef58d9371f0349ff28dd6a3d2342f1a53cb7c3476e04cccc |
File details
Details for the file pylywsdxx-2.2.2-py3-none-any.whl
.
File metadata
- Download URL: pylywsdxx-2.2.2-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57df33109f038cb812580e41603e2248e3cd316c6a5198ba7f558d0cec978b5a |
|
MD5 | dddad73ed2794a103983341e55abd794 |
|
BLAKE2b-256 | 9538a2fd6c183e5bc1c61de48a8819884cad45faee74b3554025de5b85d4785d |