Skip to main content

A small python library for discovery and interacting with Melnor, Eden, etc Bluetooth water timers.

Project description

Melnor Bluetooth

PyPI Codecov branch GitHub Workflow Status (branch) PyPI - Downloads

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:

  1. Clone the repository
  2. poetry install
  3. 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


Download files

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

Source Distribution

melnor_bluetooth-0.0.23.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

melnor_bluetooth-0.0.23-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file melnor_bluetooth-0.0.23.tar.gz.

File metadata

  • Download URL: melnor_bluetooth-0.0.23.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for melnor_bluetooth-0.0.23.tar.gz
Algorithm Hash digest
SHA256 8a020c007e8e33e7acd84f6b1658b3c51e70fd50354aaced914011b1d624b777
MD5 24cf11b7fb6f3b290c96861e67098f50
BLAKE2b-256 3a787a19f6d828692bd1e236cd97fae57feb1201a48838cabc68200f5c5bfbdc

See more details on using hashes here.

File details

Details for the file melnor_bluetooth-0.0.23-py3-none-any.whl.

File metadata

File hashes

Hashes for melnor_bluetooth-0.0.23-py3-none-any.whl
Algorithm Hash digest
SHA256 b8d04baedc020b60b70086e8cf420a263c5871d111563f18594b005bb88a1d91
MD5 b8f49e7431dab40a8a0416ad6e3036fe
BLAKE2b-256 ff14e5d5ef8f358220ee44590495870a5f0fa02381c642d05a9e73e91005dc7c

See more details on using hashes here.

Supported by

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