Page 3 of 17
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Sunday 11 December 2016 0:02
by deennoo
Update to last stable @lepetitnicolas
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Sunday 11 December 2016 0:03
by pvm
Add hardware type dummy and after that the switches
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Sunday 11 December 2016 22:45
by lepetitnicolas
Thanks
I found it.... in french "Custom sensor" is translate in "texte"
I'm waiting tomorrow to see if my crontab works.
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Monday 12 December 2016 9:43
by trixwood
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Monday 12 December 2016 11:44
by deennoo
lepetitnicolas wrote:Thanks
I found it.... in french "Custom sensor" is translate in "texte"
I'm waiting tomorrow to see if my crontab works.
No lepetitnicolas, his name on french is :

- customsensor.png (21.45 KiB) Viewed 3280 times
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Monday 12 December 2016 13:34
by lepetitnicolas
Thanks Deennoo.
Now, i see it....i don't know why it don't see it yesterday.... tiredness
but it seems working with a text sensor.
I would try this tonight to see the difference
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Monday 12 December 2016 13:48
by deennoo
advantage of a custom sensor is that you can have a graphique to show value (text doesn't do this)
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Wednesday 14 December 2016 16:45
by jadon
LouiS22 wrote:trixwood wrote:yes! as many as you like.
Does anybody has some info on how long the battery will last?
The users manual promises a year, but IMHO it really depends on your using habits: i.e. if you poll the data every minute, it will suck the battery really fast.
I'm using it since nov 20, so almost a month, and I'm polling the sensor every hour. The battery reports 79%. So I'm guessing it could last a year, maybe by polling it every 2 hours.
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Sunday 18 December 2016 21:21
by simply
Impressive small devices! Ordered four of them and they arrived this friday. Got it all working yesterday after installing Jessie on my RPi B2 and then following the guide @
http://www.elinux.org/RPi_Bluetooth_LE .
Thanks for the script posted here...

Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Monday 26 December 2016 20:33
by jkimmel
Running the modified script I get
Code: Select all
pTraceback (most recent call last):
File "flora.py", line 1, in <module>
import urllib.request
ImportError: No module named request
What I'm missing?
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Tuesday 27 December 2016 2:04
by trixwood
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Tuesday 27 December 2016 8:53
by jkimmel
I don't get the script running, I'm completely new to Phyton.
Please what has to be installed to run it?
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Tuesday 27 December 2016 10:47
by trixwood
Yes so install the missing module with the command
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Wednesday 04 January 2017 22:17
by LouiS22
So I got mine today. Paired with my phone, downloaded the app, so far so good.
But...
I'm having hard time working with Domoticz. I followed the above guides, compiled bluez, my dongle is ok, lescan shows the MAC, etc. I've changed the MAC address in demo.py, but all I got in return is the following:
Code: Select all
FW: None
File "demo.py", line 7, in <module>
print("Name: {}".format(poller.name()))
File "/home/pi/miflora/miflora/miflora_poller.py", line 172, in name
timeout=self.ble_timeout)
File "/home/pi/miflora/miflora/miflora_poller.py", line 139, in read_ble
time.sleep(delay)
I have no Idea what's wrong. Maybe worth mentoning that the android app downloaded a firmware upgrade so the device runs a 2.7.0 firmware.
Any ideas?
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Wednesday 04 January 2017 22:19
by deennoo
Mine works on 2.7.0 fw and script is still working, fw isn't the key
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Thursday 05 January 2017 2:34
by trixwood
It relies on gatttool... are you sure it's installed in /usr/local/bin/?
Further make sure you enable low energy:
Follow this guide to compile:
https://urbanjack.wordpress.com/?s=Bluez+into+BLE
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Thursday 05 January 2017 9:54
by LouiS22
Had a quick look on this morning, seems i screwed something, thanks for the info, will look into this later, and will do another compile, just to make sure.
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Friday 06 January 2017 9:55
by LouiS22
Thanks, It's working now. Don't know what missed before, nevertheless I recompiled everything again and it's ok now.
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Friday 06 January 2017 10:08
by trixwood
If you get more mi floras make sure you put 1 second sleep delay between readings... it seems to help with keeping the failed and retry connections to a minimum (none in my case), which happened a lot if executed directly after each other..
See:
https://github.com/Tristan79/miflora/bl ... omoticz.py
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Friday 06 January 2017 10:12
by LouiS22
trixwood wrote:If you get more mi floras make sure you put 1 second sleep delay between readings... it seems to help with keeping the failed and retry connections to a minimum (none in my case), which happened a lot if executed directly after each other..
See:
https://github.com/Tristan79/miflora/bl ... omoticz.py
Thanks I only had time to test with the demo.py
