User Tools

Site Tools


projects:xiaomi-flora

This is an old revision of the document!


Xiaomi Flora Flower Monitor teardown and analysis

by emeryth (emeryth at hackerspace.pl)

This is a teardown and analysis of the Xiaomi flower/plant monitor (it doesn't seem to have an official name). It is not extremely in-depth because the main goal was to figure out how to use the device without the official app.

Note: While writing this down, I have found out that I am not the first to publish something about the device ( https://community.home-assistant.io/t/xiaomi-mi-plants-monitor-flower/3388 ) but everything here is my independent work.

What is it

Xiaomi Flora is a Bluetooth Low Energy device that monitors the environment of a plant.

It measures:

  • Sunlight intensity
  • Air temperature
  • Soil moisture
  • Soil fertility (via electrical conductivity)

Hardware

The device is sealed well, with lots of gaskets and even manually applied conformal coating on chips. The plastic shell is fused together, so you must use a knife to take it apart.

Scans of the PCB:

Chips on the PCB

DA14580 U5 chip

Sensors

The light and temperature sensors are placed on the top of the device.

The legs end with metal studs that are used to measure soil fertility via electrical conductance. Hidden inside the legs are two traces that end in plates, probably a capacitive method to measure soil moisture.

Getting data out of the device

The device uses BLE GATT for communication, but the sensor values are not immediately available. When the original app connects to the device, it performs an elaborate initialization, but I have found out most of it isn't required.

Here is a short Python script to get all the interesting data from the device:

#Read data from Xiaomi flower monitor, tested on firmware version 2.6.6 
 
import time
from gattlib import GATTRequester, GATTResponse
from struct import *
 
address = "C4:7C:8D:60:95:7A"
requester = GATTRequester(address)
#Read battery and firmware version attribute
data=requester.read_by_handle(0x0038)[0]
battery, version = unpack('<B6s',data)
print "Battery level:",battery,"%"
print "Firmware version:",version
#Enable real-time data reading
requester.write_by_handle(0x0033, str(bytearray([0xa0, 0x1f])))
#Read plant data
data=requester.read_by_handle(0x0035)[0]
temperature, sunlight, moisture, fertility = unpack('<hxIBHxxxxxx',data)
print "Light intensity:",sunlight,"lux"
print "Temperature:",temperature/10.,"°C"
print "Soil moisture:",moisture,"%"
print "Soil fertility:",fertility,"uS/cm"
projects/xiaomi-flora.1477948775.txt.gz · Last modified: 2016/10/31 21:19 by emeryth

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki