Update sensor.miflora.markdown (#5532)

* Update sensor.miflora.markdown

* Update sensor.miflora.markdown

* Update sensor.miflora.markdown

* Update sensor.miflora.markdown

* ✏️ Minor tweak

* 🚀 Trigger rebuild
This commit is contained in:
themanieldaniel 2018-06-26 00:16:52 -04:00 committed by Franck Nijhof
parent 8fa0a3e191
commit 801d2aa240

View File

@ -13,20 +13,20 @@ ha_release: 0.29
ha_iot_class: "Local Polling" ha_iot_class: "Local Polling"
--- ---
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. The `miflora` sensor platform allows one to monitor plant soil and air conditions. 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 the moisture and conductivity of the soil as well as ambient light and temperature. Since only one BLE device can be polled at a time, the library implements locking to prevent polling more than one device at a time.
# Installation # Install Bluetooth Backend
Depending on the operating system you're running, you have to configure the proper Bluetooth backend on your system: Before configuring Home Assistant you need a Bluetooth backend and the MAC address of your sensor. Depending on your operating system, you may have to configure the proper Bluetooth backend for your system:
- On [Hass.io](/hassio/installation/): Miflora will work out of the box. - On [Hass.io](/hassio/installation/): Miflora will work out of the box.
- On a [generic Docker installation](/docs/installation/docker/): Works out of the box with `--net=host` and properly configured Bluetooth on the host. - On a [generic Docker installation](/docs/installation/docker/): Works out of the box with `--net=host` and properly configured Bluetooth on the host.
- On other Linux systems: - On other Linux systems:
- Preferred solution: Install the `bluepy` library (via pip). When using a virtual environment, make sure to use install the library in the right one. - Preferred 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`    - 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/). - On Windows and MacOS there is currently no support for the [miflora library](https://github.com/open-homeautomation/miflora/).
# Configuration # Scan for MAC address
Start a scan to determine the MAC addresses of the sensor: Start a scan to determine the MAC addresses of the sensor (you can identify your sensor by looking for `Flower care` or `Flower mate` entries) using this command:
```bash ```bash
$ sudo hcitool lescan $ sudo hcitool lescan
@ -36,7 +36,7 @@ C4:D3:8C:12:4C:57 Flower mate
[...] [...]
``` ```
Or if your distribution is using bluetoothctl: Or, if your distribution is using bluetoothctl use the following commands:
```bash ```bash
$ bluetoothctl $ bluetoothctl
@ -46,9 +46,7 @@ $ bluetoothctl
[NEW] C4:D3:8C:12:4C:57 Flower mate [NEW] C4:D3:8C:12:4C:57 Flower mate
``` ```
# Configure
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: To use your Mi Flora plant sensor in your installation, add the following to your `configuration.yaml` file:
```yaml ```yaml
@ -57,7 +55,7 @@ sensor:
- platform: miflora - platform: miflora
mac: 'xx:xx:xx:xx:xx:xx' mac: 'xx:xx:xx:xx:xx:xx'
monitored_conditions: monitored_conditions:
- temperature - moisture
``` ```
- **mac** (*Required*): The MAC address of your sensor. - **mac** (*Required*): The MAC address of your sensor.
@ -75,8 +73,9 @@ sensor:
- **cache_value** (*Optional*): Define cache expiration value in seconds (defaults to 1200 if not defined) - **cache_value** (*Optional*): Define cache expiration value in seconds (defaults to 1200 if not defined)
- **adapter** (*Optional*): Define the Bluetooth adapter to use (defaults to hci0). Run `hciconfig` to get a list of available adapters. - **adapter** (*Optional*): Define the Bluetooth adapter to use (defaults to hci0). Run `hciconfig` to get a list of available adapters.
Note that by default the sensor is only polled once every 20 minutes. This means with the `median: 3` setting will take as least 40 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. <p class='note warning'>
Reducing polling intervals will have a negative effect on the battery life. By default the sensor is only polled once every 20 minutes. So, if you set `median: 3` it will take _at least_ 40 minutes before the sensor will report a value after a Home Assistant restart. Since the values usually change very slowly, this usually isn't a big problem. Keep in mind though that reducing polling intervals will have a negative effect on the battery life.
</p>
A full configuration example could look like the one below: A full configuration example could look like the one below: