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

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

Moderator: leecollings

Post Reply
JC38
Posts: 51
Joined: Monday 23 June 2014 15:54
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Isère, France
Contact:

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

Post by JC38 »

As Deennoo said, the Jeedom plugin blea is a very nice one.
Unfortunately, the linked url in not working and i can't find the working one.
Raspberry Pi 3 Domoticz latest public beta + RFXComm Usb + Aeon Labs Z-Stick + Weather Underground
Windows 2012R2 with Essentials + Domoticz Windows (latest) + Open Hardware Monitor
ImperiHome with mdat / Domoticz for Android
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 »

JC38 wrote:As Deennoo said, the Jeedom plugin blea is a very nice one.
Unfortunately, the linked url in not working and i can't find the working one.
Thx to point it out, looks lke they hide it, no probleme, i put all plugon files on a zip and on a drive : https://drive.google.com/open?id=0B-QCl ... DY5REJGUU0, as i got it will update this zip to each update.

Nice Exemple of Open Source app...
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
an0key
Posts: 4
Joined: Thursday 24 November 2016 21:42
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by an0key »

My version of the domoticz script... (you have to sleep between readings different devices, or else you get the transport errors...

https://github.com/Tristan79/miflora

https://wiki.hackerspace.pl/projects:xiaomi-flora
Nice! Purchased 5 of these from aliexpress a little while back. Sat down and got them setup this morning, using your code and all working well - Thanks.

One thing I did notice is, just using them out the box, without updating or configuring, made the demo.py b0rk with no name set. However commenting that out got it working.
User avatar
remb0
Posts: 499
Joined: Thursday 11 July 2013 22:21
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

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

Post by remb0 »

uppercase + latest version is working :)


deennoo Thanks for the Info, I hope that somebody with the right skill read this and wants to help :)
tontze
Posts: 317
Joined: Thursday 12 January 2017 15:30
Target OS: Linux
Domoticz version: Beta Ch
Location: Finland
Contact:

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

Post by tontze »

an0key wrote:
My version of the domoticz script... (you have to sleep between readings different devices, or else you get the transport errors...

https://github.com/Tristan79/miflora

https://wiki.hackerspace.pl/projects:xiaomi-flora
Nice! Purchased 5 of these from aliexpress a little while back. Sat down and got them setup this morning, using your code and all working well - Thanks.

One thing I did notice is, just using them out the box, without updating or configuring, made the demo.py b0rk with no name set. However commenting that out got it working.
Could you share how you did it ? Im not skilled in coding and such, but i have few of these sensors, and i think they are brilliant. Now using only mobile app , but would like to get them to domoticz :)

-T
-----------------------------------------
Smartthings
zigbee2mqtt
RFLink 433mhz / Nrf 2.4Ghz
Mi Light
esp8266MiLight Hub
OpenHab/HomeAssistant/Domoticz
HP T610 & Debian 5.10.19-1 x86_64[/b]
User avatar
remb0
Posts: 499
Joined: Thursday 11 July 2013 22:21
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

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

Post by remb0 »

deennoo do you think it is hard to get that plugin working?
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

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

Post by deennoo »

remb0 wrote:deennoo do you think it is hard to get that plugin working?
Yeap à bit :
- WE have to mâke it run under all distro
- understand how works blue.py
- Create à hardware choice (which ble dongle to use)
- enable device détection
- make a form for each device created (beacon, or miflora, or awox plugin, or payblub device doesn't nées the same "switch"
- Create command for each device
- Stop beacon détection when sending an ordre
- and more and more


Etc etc

À huge job, and note native for me...First have to made the hardware page, with dongle sélection.
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
krizzz
Posts: 200
Joined: Wednesday 20 November 2013 20:36
Target OS: Linux
Domoticz version:
Location: The Netherlands
Contact:

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

Post by krizzz »

Getting my flora sensor within a few weeks. Looks like the flora community within domoticz is growing!

Update, sensor received and the pain is real. I do not really get it to work properly. My steps

1. Install Bluez (http://www.elinux.org/RPi_Bluetooth_LE)
When done with installing just scanned with

Code: Select all

sudo hcitool lescan
and my sensor is getting picked up by the Bluetooth USB I have in my Raspberry1.

Code: Select all

pi@raspberrypi:~/work/bluepy/bluez-5.32 $ sudo hcitool lescan
LE Scan ...
C4:7C:8D:63:18:14 (unknown)
C4:7C:8D:63:18:14 Flower care
2. Clone the repository from https://github.com/open-homeautomation/miflora into dedicated directory

Code: Select all

pi@raspberrypi:~/miflora $ git clone https://github.com/open-homeautomation/miflora
3. Checked my Bluetooth USB mac adress

Code: Select all

pi@raspberrypi:~/miflora/miflora $ hciconfig
4. Changed the mac dress of the Miflora in the demo.py file

Code: Select all

sudo nano demo.py
5.Then give the command

Code: Select all

python demo.py
to start the script gives me troubles. See the code below:

Code: Select all

Traceback (most recent call last):
  File "demo.py", line 1, in <module>
    from miflora.miflora_poller import MiFloraPoller, \
  File "/home/pi/miflora/miflora/miflora/miflora_poller.py", line 12, in <module>
    from subprocess import PIPE, Popen, TimeoutExpired
ImportError: cannot import name TimeoutExpired
5. So, TimeoutExpires should be installed if I understand correctly. So let's try:

Code: Select all

pi@raspberrypi:~/miflora/miflora $ pip install TimeoutExpired
But it's not downloding anything...... What to do next?
krizzz
Posts: 200
Joined: Wednesday 20 November 2013 20:36
Target OS: Linux
Domoticz version:
Location: The Netherlands
Contact:

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

Post by krizzz »

Also I have issues trying to add the mi flora sensor to the Flower Care iOS app. It sees the sensor but cannot connect because "the connect decive is not available for your country" en does not pair. Anyone know a way to pair?


Verzonden vanaf mijn iPhone met Tapatalk
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 »

Bad news: our chinese friends decided to release an international and a china only sensor (according to a post read at 4pda.ru).

But I found a solution: find a vpn service with a china based ip. Connect it. Then download a fake gps app from play store (sorry this one is for android only). Set your location to somewhere china. Then enable developer settings on your phone, choose mock location and ser it to the fake gps app.

Now you can add your sensor into mi flower app as before.

Update: forgot to mention a step: set your location to GPS ONLY.
Last edited by LouiS22 on Tuesday 07 March 2017 12:21, edited 1 time in total.
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 »

Justinb81 wrote:Any suggestion for a China VPN service? I thought VPN was blocked in China.. I can use the kids android tablet to temporarily change location to add the new ones 1x
Personally I used PureVPN. Be aware, you have to pay for their services (4 or 5 USD for 30 days). Then you can choose a China based server, and connect it via VPN. That way you'll have a chinese IP. I'm sure there are other services (maybe a free one as well), but I was lazy to google further :)

One more thing: there was a firmware update popped today. Version number will be 2.9.2.
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 »

LouiS22 wrote: One more thing: there was a firmware update popped today. Version number will be 2.9.2.
I think that since we got a script who work, maybe it's not necessary to update fw, this update maybe loose all our benefice.
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
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 »

Justinb81 wrote:I updated all to 2.9.2, the script continues to work. The connection is more reliable now compared to previous release (less strange values)
+1 the update indeed solved bluetooth connection issues. Anyway, deennoo has a point: a future fw update could possible break something what's working now. Hopefully that won't happen soon.

Fun fact: our topic is monitored by our fellow iot fans at 4pda.ru :) Was a bit funny to read my solution in russian :D
blauwebuis
Posts: 331
Joined: Wednesday 21 December 2016 9:11
Target OS: Raspberry Pi / ODroid
Domoticz version: current
Contact:

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

Post by blauwebuis »

I've created a page on the Wiki about this. Please help to streamline it :-)

https://www.domoticz.com/wiki/Mi_Flora_Bluetooth_LE
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 »

Next step is to made à python plugin for domoticz guys !
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Gargy
Posts: 4
Joined: Tuesday 17 March 2015 7:55
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Gargy »

I buy one Miflora sensor 2 weeks ago, no problem, run OK with Android App. So I ordered another two, couldn't get them to pair with my phone, different Country.
I started to look how to implement those Sensor into my Domoticz system and I found some guidelines on the web. Playing a little bit around and got them working - even those two with wrong Country!
My Domoticz Server runs on RPI 2, but data grabbing from MiFlora sensor runs on RPi3 (because of BT and RPi should be near the plants). Here is my screenshot:

Image
krizzz
Posts: 200
Joined: Wednesday 20 November 2013 20:36
Target OS: Linux
Domoticz version:
Location: The Netherlands
Contact:

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

Post by krizzz »

blauwebuis wrote:I've created a page on the Wiki about this. Please help to streamline it :-)

https://www.domoticz.com/wiki/Mi_Flora_Bluetooth_LE
Nice!!! I will try the wiki tomorrow


Verzonden vanaf mijn iPhone met Tapatalk
JC38
Posts: 51
Joined: Monday 23 June 2014 15:54
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Isère, France
Contact:

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

Post by JC38 »

@LouiS22 and Justinb81

So, do you succeed using your "china only" sensor. I've got a VPN but I can't go to Mainland China, I've only found servers in Honk-Kong or Macau.
Can you use them with the android Mi Home and Flower Care applications ?
Raspberry Pi 3 Domoticz latest public beta + RFXComm Usb + Aeon Labs Z-Stick + Weather Underground
Windows 2012R2 with Essentials + Domoticz Windows (latest) + Open Hardware Monitor
ImperiHome with mdat / Domoticz for Android
woodtrix
Posts: 34
Joined: Saturday 18 February 2017 17:54
Target OS: -
Domoticz version:
Contact:

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

Post by woodtrix »

Well, if they broke them, I am going to dispute it with aliexpress. I do not have a china ip and I can not fake my gps location with my iphone... I will call that bricked cuz their official app does not work anymore. Money back please...

I will update the github to show a warning...
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

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

Post by deennoo »

woodtrix wrote:Well, if they broke them, I am going to dispute it with aliexpress. I do not have a china ip and I can not fake my gps location with my iphone... I will call that bricked cuz their official app does not work anymore. Money back please...

I will update the github to show a warning...
Lol just remeber that Xiaomi officially only sell to China market.

You made import, this your risk !
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest