From 878515d59abb65d2341ef7299caee1383829be72 Mon Sep 17 00:00:00 2001 From: ChristianKuehnel Date: Sat, 20 Jan 2018 08:54:50 +0100 Subject: [PATCH] component.sensor.miflora - extended documentation regarding Bluetooth backends (#4279) * updated miflora documentation after changes to bluetooth backend y * :pencil2: Small fixes --- source/_components/sensor.miflora.markdown | 25 ++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/source/_components/sensor.miflora.markdown b/source/_components/sensor.miflora.markdown index 739ce1e2c0f..4d15463a1c7 100644 --- a/source/_components/sensor.miflora.markdown +++ b/source/_components/sensor.miflora.markdown @@ -13,8 +13,18 @@ ha_release: 0.29 ha_iot_class: "Local Polling" --- -The `miflora` sensor platform allows one to monitor to plants. The [Mi Flora plant sensor](https://xiaomi-mi.com/sockets-and-sensors/xiaomi-huahuacaocao-flower-care-smart-monitor/) is a small Bluetooth Low Energy device that monitors not only the moisture, but also light, temperature and conductivity. As only a single BLE device can be polled at the same time, the library implements locking to make sure this is the case. +The `miflora` sensor platform allows one to monitor plants. The [Mi Flora plant sensor](https://xiaomi-mi.com/sockets-and-sensors/xiaomi-huahuacaocao-flower-care-smart-monitor/) is a small Bluetooth Low Energy device that monitors not only the moisture but also light, temperature, and conductivity. As only a single BLE device can be polled at the same time, the library implements locking to make sure this is the case. +# Installation +Depending on the operating system you're running, you have to configure the proper Bluetooth backend on your system: + +- On [Hass.io](https://home-assistant.io/hassio/installation/): Miflora will work out of the box. +- On other Linux systems: + - Prefered solution: Install the `bluepy` library (via pip). When using a virtual environment, make sure to use install the library in the right one. +    - Fallback solution: Install `gatttool` via your package manager. Depending on the distribution, the package name might be: `bluez`, `bluetooth`, `bluez-deprecated` +- Windows and MacOS are currently not supported by the [miflora library](https://github.com/open-homeautomation/miflora/). + +# Configuration Start a scan to determine the MAC addresses of the sensor: ```bash @@ -25,6 +35,17 @@ C4:D3:8C:12:4C:57 Flower mate [...] ``` +Or if your distribution is using bluetoothctl: + +```bash +$ bluetoothctl +[bluetooth]# scan on +[NEW] Controller [default] +[NEW] F8:04:33:AF:AB:A2 [TV] UE48JU6580 +[NEW] C4:D3:8C:12:4C:57 Flower mate +``` + + Check for `Flower care` or `Flower mate` entries, those are your sensor. To use your Mi Flora plant sensor in your installation, add the following to your `configuration.yaml` file: @@ -56,7 +77,7 @@ sensor: Note that by default the sensor is only polled once every 15 minutes. This means with the `median: 3` setting will take as least 30 minutes before the sensor will report a value after a Home Assistant restart. As the values usually change very slowly, this isn't a big problem. Reducing polling intervals will have a negative effect on the battery life. -A full configuration example could looks the one below: +A full configuration example could look like the one below: ```yaml # Example configuration.yaml entry