Xiaomi MiFlora is a cost effective plant sensor, which uses BLE to send it’s data, and is capable of sensing temperature, soil humidity, light, soil fertility and it’s own battery level.
Daniel Matuschek (openha) has written a python3 code which is capable of reading these data, and I have been running it on a Raspberry Pi 3 (because that model has a Bluetooth module).
I’m not skilled enough to create a pimatic plugin, but using a workaround the data can be displayed in pimatic.
Step 1: using a rule in pimatic to run openha’s python library’s demo.py script every 10 minutes (pimatic-cron plugin), and send the output to a file (overwriting it’s content with every update, so the file will contain only the latest data). Raspbian’s cron could be used as well, but using pimatic rules, there is no need for an extra external component, and the config file will contain every needed setting, except openha’s miflora python3 script itself.
Step 2: Use the pimatic-log-reader plugin to create a LogWatcher device, and read the data from the output file of the python script and display it in pimatic.
It consists of many components, but I’ve been running it for approx. a
week year now, and it’s reliable enough. I can share the pimatic rule and device config if anyone is interested.
Snippets of the config and rules can be found in the thread below, and it’s recommended to read them for insights, but the most complete version of my tutorial on the MiFlora integration to pimatic can be found on my techblog: https://zsiti.eu/xiaomi-miflora-plant-sensor-pimatic-raspberry-pi-3/
UPDATE 2017-12-08: Our fellow community member and pimatic developer @rrooggiieerr has announced on 2017 December 1st, that he made a BLE plugin and a mi-flora plugin which work together and provide the same functionality as this tutorial’s method. As his method uses native pimatic plugins, it’s easier to set up the sensor that way, so I recommend you to use @rrooggiieerr’s plugins and disregard this tutorial. Head over to follow rrooggiieerr’s pimatic forum thread to get your sensors integrated into pimatic and for updates on his work on the BLE and mi-flora pimatic plugin.