Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mausy5043/pylywsdxx
A Python3 class to interrogate Xiaomi Mijia LYWSD* sensors.
https://github.com/mausy5043/pylywsdxx
ble bluetooth-low-energy iot lywsd02 lywsd03mmc pypi python python3 raspberry-pi
Last synced: 6 days ago
JSON representation
A Python3 class to interrogate Xiaomi Mijia LYWSD* sensors.
- Host: GitHub
- URL: https://github.com/mausy5043/pylywsdxx
- Owner: Mausy5043
- License: mit
- Created: 2023-02-12T10:24:55.000Z (almost 2 years ago)
- Default Branch: devel
- Last Pushed: 2024-04-13T12:33:36.000Z (7 months ago)
- Last Synced: 2024-04-13T21:14:05.927Z (7 months ago)
- Topics: ble, bluetooth-low-energy, iot, lywsd02, lywsd03mmc, pypi, python, python3, raspberry-pi
- Language: Python
- Homepage:
- Size: 135 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[![License](https://img.shields.io/github/license/mausy5043/pylywsdxx)](LICENSE)
[![PyPI version](https://img.shields.io/pypi/v/pylywsdxx.svg?logo=pypi&logoColor=FFE873)](https://pypi.org/project/pylywsdxx)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/pylywsdxx.svg?logo=python&logoColor=FFE873)](https://pypi.org/project/pylywsdxx)
[![PyPI downloads](https://img.shields.io/pypi/dm/pylywsdxx.svg)](https://pypistats.org/packages/pylywsdxx)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Mausy5043/pylywsdxx/devel.svg)](https://results.pre-commit.ci/latest/github/Mausy5043/pylywsdxx/devel)# 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`](https://pypi.org/project/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](https://devguide.python.org/versions/) 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 pylymac = "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](https://github.com/h4/lywsd02)
and Duncan Barclay (`uduncanu`) : [lywsd03mmc](https://github.com/uduncanu/lywsd03mmc)## Disclaimer & License
As of September 2024 `pylywsdxx` is distributed under [AGPL-3.0-or-later](LICENSE).