A small python library for discovery and interacting with Melnor, Eden, etc Bluetooth water timers.
Project description
Melnor Bluetooth
Melnor Bluetooth is a reverse engineered implementation of the Bluetooth protocol for all "smart" bluetooth-enabled watering valves under the Melnor, EcoAquastar, Eden, and other brands.
The library should run on MacOS, Linux, or Windows. It's primarily developed on MacOS and other platforms likely have bugs. PRs and tests are welcome to improve quality across all platforms.
Getting Started
CLI
A simple CLI has been provided for basic debugging purposes. It's not intended for any real use and isn't suitable for running a valve in the real world.
This project uses poetry for dependency management and building. Running this project locally is as simple as the following steps:
- Clone the repository
poetry install
poetry run cli.py
The python API has been designed to be as easy to use as possible. A few examples are provided below:
Read battery state
import asyncio
from bleak import BleakScanner # type: ignore - bleak has bad export types
from melnor_bluetooth.device import Device
ADDRESS = "00:00:00:00:00" # fill with your device mac address
async def main():
ble_device = await BleakScanner.find_device_by_address(ADDRESS)
if ble_device is not None:
device = Device(ble_device)
await device.connect()
await device.fetch_state()
print(device.battery_level)
await device.disconnect()
asyncio.run(main())
Turn on a zone
import asyncio
from bleak import BleakScanner # type: ignore - bleak has bad export types
from melnor_bluetooth.device import Device
address = "00:00:00:00:00" # fill with your device mac address
async def main():
ble_device = await BleakScanner.find_device_by_address(ADDRESS)
if ble_device is not None:
device = Device(ble_device)
await device.connect()
await device.fetch_state()
device.zone1.is_watering = True
await device.push_state()
await device.disconnect()
asyncio.run(main())
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 melnor-bluetooth-0.0.19.tar.gz
.
File metadata
- Download URL: melnor-bluetooth-0.0.19.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 480f8b82768c916107aa7ede03d4046f94a68fb51dd5361c820aa9cec8df387a |
|
MD5 | 220e0e796261e16c94a9bf9ccf8bbac6 |
|
BLAKE2b-256 | 6ba534c8650a1f01d4509e97e5ab0ade9665f9a1aee104d9f7a6ad2ce604a935 |
File details
Details for the file melnor_bluetooth-0.0.19-py3-none-any.whl
.
File metadata
- Download URL: melnor_bluetooth-0.0.19-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15d899d6ed9fb1aaf1040e9e346ad1c665636d750450630b580b757bce978219 |
|
MD5 | 3dde089833cc7a8f3cceccb9aceecd88 |
|
BLAKE2b-256 | 1c0f1967a963607ab300952e8feebd46561d0e6b635680fb0596f5bd61dd1294 |