Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

A simple API for RainMachine sprinkler controllers

Project description

💧 Regenmaschine: A Simple Python Library for RainMachine™

.. image:: :target:

.. image:: :target:

.. image:: :target:

.. image:: :target:

.. image:: :target:

.. image:: :target: :alt: Maintainability

.. image::!-1EAEDB.svg :target:

Regenmaschine (German for "rain machine") is a simple, clean, well-tested Python library for interacting with RainMachine™ smart sprinkler controllers <>_. It gives developers an easy API to manage their controllers over their local LAN.

💧 PLEASE READ: 1.0.0 and Beyond

Version 1.0.0 of Regenmaschine makes several breaking, but necessary changes:

  • Moves the underlying library from Requests <>_ to aiohttp <>_
  • Changes the entire library to use :code:asyncio
  • Makes 3.5 the minimum version of Python required

If you wish to continue using the previous, synchronous version of Regenmaschine, make sure to pin version 0.4.2.

💧 Installation

.. code-block:: bash

$ pip install regenmaschine

💧 Example

Regenmaschine starts within an aiohttp <>_ :code:ClientSession:

.. code-block:: python

import asyncio

from aiohttp import ClientSession

from regenmaschine import Client

async def main() -> None: """Create the aiohttp session and run the example.""" async with ClientSession() as websession: await run(websession)

async def run(websession): """Run.""" # YOUR CODE HERE


A Regenmaschine :code:Client can be created manually:

.. code-block:: python

client = Client('', websession, port=9999)

...or you can attempt to discover one on your local network:

.. code-block:: python

from regenmaschine import scan from regenmaschine.errors import DiscoveryFailedError

try: client = scan(websession) except DiscoveryFailedError: print("Couldn't find a valid RainMachine unit via discovery")

Once you have a client, authenticate it by using your RainMachine password:

.. code-block:: python

await client.authenticate('my_password_123')

You can now get some properties with your authenticated client:

.. code-block:: python

print('Name: {0}'.format( print('Host: {0}'.format( print('MAC Address: {0}'.format(client.mac))

...and get to work controlling your RainMachine!

.. code-block:: python

Get all diagnostic information:

diagnostics = await client.diagnostics.current()

Get all weather parsers:

parsers = await client.parsers.current():

Get all programs:

programs = await client.programs.all():

Get a specific program:

program_1 = await client.programs.get(1)

Get the next run time for all programs:

runs = await

Get all running programs:

programs = await client.programs.running()

Start and stop a program:

client.programs.start(1) client.programs.stop(1)

Get the device name:

name = await client.provisioning.device_name

Get all provisioning settings:

settings = await client.provisioning.settings()

Get all networking info related to the device:

wifi = await client.provisioning.wifi()

Get various types of active watering restrictions:

current = await client.restrictions.current() universal = await client.restrictions.universal() hourly = await client.restrictions.hourly(): raindelay = await client.restrictions.raindelay()

Get watering stats:

today = await client.stats.on_date( upcoming_days = client.stats.upcoming(details=True):

Get info on various watering activities not already covered:

log_2_day = client.watering.log(, 2): queue = await client.watering.queue() runs = await client.watering.runs(

Stop all watering activities:

await client.watering.stop_all()

Check out, the tests, and the source files themselves for method signatures and more examples.

💧 Contributing

#. Check for open features/bugs <>_ or initiate a discussion on one <>. #. Fork the repository <>. #. Install the dev environment: :code:make init. #. Enter the virtual environment: :code:pipenv shell #. Code your new feature or bug fix. #. Write a test that covers your new functionality. #. Run tests: :code:make test #. Build new docs: :code:make docs #. Add yourself to AUTHORS.rst. #. Submit a pull request!

Project details

Release history Release notifications

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
regenmaschine-1.0.2-py2-none-any.whl (12.9 kB) Copy SHA256 hash SHA256 Wheel py2 Jun 9, 2018
regenmaschine-1.0.2.tar.gz (11.4 kB) Copy SHA256 hash SHA256 Source None Jun 9, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page