Nice & easy affordable temperature / light / moisture sensor - Xiaomi Flora

I must admit… I’m bit of a Xiaomi fan… products are affordable, typically good looking & very reasonable quality…

So when I saw this sensor I was hooked, as it solved one of my common household problems… timely watering the flowers. This $11 stick measures the soil moisture, soil fertility. However besides that, it aslo measures room temperature & light level (lux), so can be used as cheap sensor for that as well.
It uses bluetooth BLE and the battery is suppose to last a year.

To hook it to Openhab I used small python script & mqtt. You can find here
Once @chris merged his Bluetooth BLE binding I’ll add it there and the script can go.

Notifications when water level is low I did with nodered… but will be moved to OH as well when I have bit of time to look at the new OH2 script engine.


Cool, looks interesting.

Is it weather resistant (i.e. could it be deployed in an outside garden)?

I didn’t look close yet, but my first impression is that it is not

Now that it is working, I’ll buy a few more, and though probably not 100%
waterproof I’m still thinking I’ll have one in the garden, but than I’ll
cover it in some plastic.

@marcel_verpaalen thanks for sharing the script. I have a few BLE devices I’d like to integrate as well, just wondering how your script would work with OH2 once the BLE binding is available?

@jamborta once the BLE binding is working fine, I think the script is no longer needed.
I’ve not yet experimented with the BLE binding, Chris has not yet released it, so don’t know how fast it will come.

See post:

How would the binding work? Typically bluetooth is short range, and plants are scattered all around, I will have 2 - 3 pi:s picking up plant data and transmitting them with mqtt.

Regards, S

So, got a some new ones today and was looking if they were water proof. Well, at least they made some arrangements to make it water resistant.
The main area where water would reach electronics is surrounded by a rubber seal.
I’m still but suspicious about the seal around the led, but assume that will similar seal inside.

The manual probably spells it out but… my Chinese is not too good, so don’t know what is written there.
If anyone can read it and is willing to translate I’ll post it

I found English manual here

As caution is mentioned:

  1. If the device has been exposed to rain or dropped into
    water, it can cause it to break.
1 Like

I have got a couple of these to try. I am running openhab on a rpi2. The script works ok about 50% of the time, but I get this quite frequently

on notification, handle: 0x21 -> 00:00:
on notification, handle: 0x21 -> 00:00:
on notification, handle: 0x21 -> 00:00:

And then the the bluetooth connection drops. I though it was related the distance between the pi and the sensor, but it also happens if the sensor is right next to the computer.

@jamborta What script are you running to poll the device?
Been running mine for ~20 days without problems. I have 6 of them now.

Regards S

@Seaside Running the one from this thread (

@jamborta Probably easiest to mail the author and ask.
I’m using another python lib to extract the values…
See: Xiaomi Miflora Sensor Integration

Have you been able to check how good the precision is for Xiaomi temperature?

such as the Xiaomi Flora you mention here

or looking at for example the temperature sensors

or the

do they differ several deegres from more expensive termometer?
or are they fairly accurate?

Hi Marcel,

I’m already using your Mio binding which is awesome so thanks for that. I’ve got loads of xaiomi devices now as well based on your feedback and would like to use this one too in OpenHAB but I have no idea how to get it working. I’m using Windows 10 and I’ve got python running, the MQTT binding and Actions installed, but how do I go from there?

Thanks in advance!

I think the script I wrote only works with Linux (due to the library used). Hence for my integration to work you need linux with the gattlib installed. I’m not familiar with similar libraries on windows.

Moved over to Ubuntu so going to try it out… Thanks for the great work

Hello, I started a new topic to get feedback from the community on what is a good working solution for stand alone environment sensor (temperature, humidity, etc)

It needs to be able to log data

What combination of sensors, OH binding, GW/hardware are YOU using?
for what price?
do you regret your choice ?