component.sensor.miflora - extended documentation regarding Bluetooth backends (#4279)

* updated miflora documentation after changes to bluetooth backend
y

* ✏️ Small fixes
This commit is contained in:
ChristianKuehnel 2018-01-20 08:54:50 +01:00 committed by Franck Nijhof
parent 122a77bc82
commit 878515d59a

View File

@ -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 <your Bluetooth adapter> [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