Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor

Others (MiLight, Hue, Toon etc...)

Moderator: leecollings

deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor

Post by deennoo »

Update to last stable @lepetitnicolas
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
pvm
Posts: 550
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: 4.10538
Location: NL
Contact:

Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor

Post by pvm »

Add hardware type dummy and after that the switches
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
lepetitnicolas
Posts: 12
Joined: Wednesday 02 November 2016 22:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Location: South West of France
Contact:

Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor

Post by lepetitnicolas »

Thanks
I found it.... in french "Custom sensor" is translate in "texte"
I'm waiting tomorrow to see if my crontab works.
Raspberry Pi 3 - RFLink and Homewizard
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor

Post 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
customsensor.png (21.45 KiB) Viewed 3262 times
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
lepetitnicolas
Posts: 12
Joined: Wednesday 02 November 2016 22:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Location: South West of France
Contact:

Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor

Post 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
Raspberry Pi 3 - RFLink and Homewizard
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor

Post by deennoo »

advantage of a custom sensor is that you can have a graphique to show value (text doesn't do this)
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
User avatar
jadon
Posts: 7
Joined: Monday 07 November 2016 14:59
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Tiel, Netherlands
Contact:

Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor

Post 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.
simply
Posts: 5
Joined: Sunday 01 February 2015 17:42
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: sthlm, sweden
Contact:

Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor

Post 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... ;)
jkimmel
Posts: 129
Joined: Monday 25 November 2013 17:51
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Mallorca
Contact:

Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor

Post 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?
Rfxcom
Raspi 4
trixwood

Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor

Post by trixwood »

Code: Select all

pip install requests
jkimmel
Posts: 129
Joined: Monday 25 November 2013 17:51
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Mallorca
Contact:

Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor

Post by jkimmel »

I don't get the script running, I'm completely new to Phyton.

Please what has to be installed to run it?
Rfxcom
Raspi 4
trixwood

Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor

Post by trixwood »

Yes so install the missing module with the command

Code: Select all

pip install requests
User avatar
LouiS22
Posts: 433
Joined: Friday 27 February 2015 13:21
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Budapest, Hungary
Contact:

Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor

Post 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?
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor

Post by deennoo »

Mine works on 2.7.0 fw and script is still working, fw isn't the key
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
trixwood

Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor

Post by trixwood »

It relies on gatttool... are you sure it's installed in /usr/local/bin/?

Further make sure you enable low energy:

Code: Select all

sudo btmgmt le on
Follow this guide to compile:
https://urbanjack.wordpress.com/?s=Bluez+into+BLE
User avatar
LouiS22
Posts: 433
Joined: Friday 27 February 2015 13:21
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Budapest, Hungary
Contact:

Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor

Post by LouiS22 »

trixwood wrote:It relies on gatttool... are you sure it's installed in /usr/local/bin/?

Further make sure you enable low energy:

Code: Select all

sudo btmgmt le on
Follow this guide to compile:
https://urbanjack.wordpress.com/?s=Bluez+into+BLE
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.
User avatar
LouiS22
Posts: 433
Joined: Friday 27 February 2015 13:21
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Budapest, Hungary
Contact:

Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor

Post by LouiS22 »

trixwood wrote:It relies on gatttool... are you sure it's installed in /usr/local/bin/?

Further make sure you enable low energy:

Code: Select all

sudo btmgmt le on
Follow this guide to compile:
https://urbanjack.wordpress.com/?s=Bluez+into+BLE
Thanks, It's working now. Don't know what missed before, nevertheless I recompiled everything again and it's ok now.
trixwood

Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor

Post 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
User avatar
LouiS22
Posts: 433
Joined: Friday 27 February 2015 13:21
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Budapest, Hungary
Contact:

Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor

Post 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 :)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests