Coder Social home page Coder Social logo

miflora's Introduction

miflora - Library for Xiaomi Mi plant sensor

PyPI PyPI PyPI Travis Coveralls github Plants healty and growing GitHub license

This library lets you read sensor data from a Xiaomi Mi Flora plant sensor.

Functionality

It supports reading the different measurements from the sensor

  • temperature
  • moisture
  • conductivity
  • brightness

To use this library you will need a Bluetooth Low Energy dongle attached to your computer. You will also need a Xiaomi Mi Flora plant sensor.

Backends

As there is unfortunately no universally working Bluetooth Low Energy library for Python, the project currently offers support for two Bluetooth implementations:

  • bluepy library
  • bluez tools (via a wrapper around gatttool)
  • pygatt library

bluepy

To use the bluepy library you have to install it on your machine, in most cases this can be done via: pip3 install bluepy

Example to use the bluepy backend:

from miflora.miflora_poller import MiFloraPoller
from btlewrap.bluepy import BluepyBackend

poller = MiFloraPoller('some mac address', BluepyBackend)

This is the backend library to be used.

bluez/gatttool wrapper

To use the bluez wrapper, you need to install the bluez tools on your machine. No additional python libraries are required. Some distrubutions moved the gatttool binary to a separate package. Make sure you have this binaray available on your machine.

Example to use the bluez/gatttool wrapper:

from miflora.miflora_poller import MiFloraPoller
from btlewrap.gatttool import GatttoolBackend

poller = MiFloraPoller('some mac address', GatttoolBackend)

This backend should only be used, if your platform is not supported by bluepy. Note: gatttool is depracated in many Linux distributions.

pygatt

If you have a Blue Giga based device that is supported by pygatt, you have to install the bluepy library on your machine. In most cases this can be done via: pip3 install pygatt

Example to use the pygatt backend:

from miflora.miflora_poller import MiFloraPoller
from btlewrap.pygatt import PygattBackend

poller = MiFloraPoller('some mac address', PygattBackend)

Dependencies

miflora depends on the btlewrap library. If you install miflora via PIP btlewrap will automatically be installed. If not, you will have to install btlewrap manually:

pip3 install btlewrap

Conttributing

please have a look at CONTRIBUTING.md

Projects Depending on miflora

The following shows a selected list of projects using this library:

miflora's People

Contributors

growers12 avatar christiankuehnel avatar thomdietrich avatar danielhiversen avatar freol35241 avatar rlmalisz avatar bbbenji avatar hifiberry avatar davidlp avatar goestao avatar fedalto avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.