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

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

Moderator: leecollings

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 »

So why didn't you change the wiki after finding the mistake in it?
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 »

blauwebuis wrote:So why didn't you change the wiki after finding the mistake in it?
Oh, can i ? I didnt knew i can edit them :D
-----------------------------------------
Smartthings
zigbee2mqtt
RFLink 433mhz / Nrf 2.4Ghz
Mi Light
esp8266MiLight Hub
OpenHab/HomeAssistant/Domoticz
HP T610 & Debian 5.10.19-1 x86_64[/b]
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 »

Yes you can :-) Feel free to change things when you find a mistake.
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 »

Guys, help me out.

I tested the setup on my "test"-Pi and it worked. It seemed that on my Domoticz Pi i already installed a previous version of Bluez (5.32). I noticed this before walking through the wiki and i though I removed everything that came with installing Bluez version 5.32.

Now, I did the wiki and I seem to be stuck. When executing the domoticz.py script

Code: Select all

sudo python3 domoticz.py
I receive an error

Code: Select all

/bin/sh: 1: /usr/bin/gatttool: not found
so it seems that the gattool is not correctly installed. I googled and found the gattool is installed by installing pygatt which was mentioned in the wiki. So I try to install pygatt again and I receive the following

Code: Select all

Requirement already satisfied (use --upgrade to upgrade): pygatt in /usr/local/lib/python3.4/dist-packages
Requirement already satisfied (use --upgrade to upgrade): pyserial in /usr/local/lib/python3.4/dist-packages (from pygatt)
Requirement already satisfied (use --upgrade to upgrade): enum34 in /usr/local/lib/python3.4/dist-packages (from pygatt)
Cleaning up...
Ok, so maybe it is partially installed or I removed only half earlier. I will try and upgrade

Code: Select all

sudo pip3 install pygatt --upgrade
Requirement already up-to-date: pygatt in /usr/local/lib/python3.4/dist-packages
Requirement already up-to-date: pyserial in /usr/local/lib/python3.4/dist-packages (from pygatt)
Requirement already up-to-date: enum34 in /usr/local/lib/python3.4/dist-packages (from pygatt)
Cleaning up...
Ok, now I am stuck. Anybody?

*Edit*

I tried again, and now with

Code: Select all

sudo apt-get purge bluez
to remove the bluez stack and succeeded. Then did the whole wiki page again. Same error.

Code: Select all

/bin/sh: 1: gatttool: not found
physiker123
Posts: 37
Joined: Wednesday 25 November 2015 18:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany / France
Contact:

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

Post by physiker123 »

tontze wrote:Actually, wiki´s crontab part doesnt correspond to instructions earlier. I had same mistake as user before ..

Code: Select all

And then add this line:
0 0,12 * * * python3 /pi/domoticz/scripts/python/miflora/domoticz.py
an extra /python/ in the path, and missing /home from the path start :)

-T
Actually, I reread the Script. It is written, That you should place the miflora folder in the domoticz python folder. So it was my mistake, I placed it in the domoticz scripts folder.

The wiki article Should be precise as it is now.
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 »

Did you try installing latest bluez via sources(not apt-get).? At some versions of bluez gatttool isn't installed and it won't be installed via apt-get
-----------------------------------------
Smartthings
zigbee2mqtt
RFLink 433mhz / Nrf 2.4Ghz
Mi Light
esp8266MiLight Hub
OpenHab/HomeAssistant/Domoticz
HP T610 & Debian 5.10.19-1 x86_64[/b]
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 »

tontze wrote:Did you try installing latest bluez via sources(not apt-get).? At some versions of bluez gatttool isn't installed and it won't be installed via apt-get
How do I do this via sources? Thanks!


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

krizzz wrote:
tontze wrote:Did you try installing latest bluez via sources(not apt-get).? At some versions of bluez gatttool isn't installed and it won't be installed via apt-get
How do I do this via sources? Thanks!


Verzonden vanaf mijn iPhone met Tapatalk
It is in the wiki :

Code: Select all

 cd / 
 sudo mkdir bluez 
 cd bluez 
 sudo wget http://www.kernel.org/pub/linux/bluetooth/bluez-5.44.tar.xz
 sudo tar -xJf bluez-5.44.tar.xz 
 cd bluez-5.44 
 sudo ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-tools --disable-test --disable-systemd
 sudo make all 
 sudo apt-get install python-bluez python-requests
Also do (depending where your bins are);

Code: Select all

sudo cp attrib/gatttool /usr/local/bin/ [b]or[/b] sudo cp attrib/gatttool /usr/bin/
-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]
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 »

tontze wrote:
krizzz wrote:
tontze wrote:Did you try installing latest bluez via sources(not apt-get).? At some versions of bluez gatttool isn't installed and it won't be installed via apt-get
How do I do this via sources? Thanks!


Verzonden vanaf mijn iPhone met Tapatalk
It is in the wiki :

Code: Select all

 cd / 
 sudo mkdir bluez 
 cd bluez 
 sudo wget http://www.kernel.org/pub/linux/bluetooth/bluez-5.44.tar.xz
 sudo tar -xJf bluez-5.44.tar.xz 
 cd bluez-5.44 
 sudo ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-tools --disable-test --disable-systemd
 sudo make all 
 sudo apt-get install python-bluez python-requests
Also do (depending where your bins are);

Code: Select all

sudo cp attrib/gatttool /usr/local/bin/ [b]or[/b] sudo cp attrib/gatttool /usr/bin/
-T
Thanks for pointing me into the right direction. I spend my evening trying and compiling again and again the 5.44 Bluez install. And I keept getting the same message, that gattool was not find. And then I noticed 1 small line in the wiki

Code: Select all

Note: Bluez version 5.44 does not compile gatttool on a Raspberry Pi 3, however version 5.43 does work properly.
So I tried compiling Bluez 5.43, and works flawlessly :). So not only does the 5.44 Bluez not install gatttool on a Raspberry Pi3, also not on a Raspberry Pi2 and Pi1.

Now for the next step. How to find out when to water the plants and if the fertility is good :)
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 »


Thanks for pointing me into the right direction. I spend my evening trying and compiling again and again the 5.44 Bluez install. And I keept getting the same message, that gattool was not find. And then I noticed 1 small line in the wiki

Code: Select all

Note: Bluez version 5.44 does not compile gatttool on a Raspberry Pi 3, however version 5.43 does work properly.
So I tried compiling Bluez 5.43, and works flawlessly :). So not only does the 5.44 Bluez not install gatttool on a Raspberry Pi3, also not on a Raspberry Pi2 and Pi1.

Now for the next step. How to find out when to water the plants and if the fertility is good :)
Indeed, i missed that part as i had bluez allready installed :) Good that you got it working !

If you can pair your mi flora with phone(have not updated it to latest fw), you can allways add plant to it and check from there whats good moisture/fert for your plant :)
-----------------------------------------
Smartthings
zigbee2mqtt
RFLink 433mhz / Nrf 2.4Ghz
Mi Light
esp8266MiLight Hub
OpenHab/HomeAssistant/Domoticz
HP T610 & Debian 5.10.19-1 x86_64[/b]
physiker123
Posts: 37
Joined: Wednesday 25 November 2015 18:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany / France
Contact:

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

Post by physiker123 »

Can anyone post perhaps the values for the different plants? I do not really want to change something now that everything works.

:)
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 »

physiker123 wrote:Can anyone post perhaps the values for the different plants? I do not really want to change something now that everything works.

:)
You can safely use phone app, just dont update when it asks you to :) Im using it this way. And have access to plant database.
-----------------------------------------
Smartthings
zigbee2mqtt
RFLink 433mhz / Nrf 2.4Ghz
Mi Light
esp8266MiLight Hub
OpenHab/HomeAssistant/Domoticz
HP T610 & Debian 5.10.19-1 x86_64[/b]
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 »

physiker123 wrote:Can anyone post perhaps the values for the different plants? I do not really want to change something now that everything works.

:)
For all plants? ;)
I use 20% as moisture trigger. I defined thus by just feeling the soil at which I normally give water to the plant
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
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 »

pvm wrote:
physiker123 wrote:Can anyone post perhaps the values for the different plants? I do not really want to change something now that everything works.

:)
For all plants? ;)
I use 20% as moisture trigger. I defined thus by just feeling the soil at which I normally give water to the plant
In the android app it says about fertilizing :

Normally when fertility is under 500, you need to add fertility, so i quess they use that same threshold for every plant ?

And also about soil moisture, 20%

I quess those are good guidelines.

-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]
physiker123
Posts: 37
Joined: Wednesday 25 November 2015 18:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany / France
Contact:

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

Post by physiker123 »

I looked at the app (Flower Care), but when it detects my sensors it wants to make the firmware update. I cannot delete the notification (Nexus 5x with Android 7.1), so I have to restart the app. Therefore, I only have seconds to look at the app :D

I looked at the FAQ, and it gave as well the values of 500 for the fertility, but 35 for the moisture. I had a look at two different plants, but the values where the same (I hope I looked right, see above).

I will just look, if 35 is too much, and then lower the value.
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 »

physiker123 wrote:I looked at the app (Flower Care), but when it detects my sensors it wants to make the firmware update. I cannot delete the notification (Nexus 5x with Android 7.1), so I have to restart the app. Therefore, I only have seconds to look at the app :D

I looked at the FAQ, and it gave as well the values of 500 for the fertility, but 35 for the moisture. I had a look at two different plants, but the values where the same (I hope I looked right, see above).

I will just look, if 35 is too much, and then lower the value.
The firmware update won't break anything IMHO.
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 »

physiker123 wrote:I looked at the app (Flower Care), but when it detects my sensors it wants to make the firmware update. I cannot delete the notification (Nexus 5x with Android 7.1), so I have to restart the app. Therefore, I only have seconds to look at the app :D

I looked at the FAQ, and it gave as well the values of 500 for the fertility, but 35 for the moisture. I had a look at two different plants, but the values where the same (I hope I looked right, see above).

I will just look, if 35 is too much, and then lower the value.
The firmware update won't break anything IMHO.
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 »

physiker123 wrote:I looked at the app (Flower Care), but when it detects my sensors it wants to make the firmware update. I cannot delete the notification (Nexus 5x with Android 7.1), so I have to restart the app. Therefore, I only have seconds to look at the app :D

I looked at the FAQ, and it gave as well the values of 500 for the fertility, but 35 for the moisture. I had a look at two different plants, but the values where the same (I hope I looked right, see above).

I will just look, if 35 is too much, and then lower the value.
You can close it via X on the right upper corner.
-----------------------------------------
Smartthings
zigbee2mqtt
RFLink 433mhz / Nrf 2.4Ghz
Mi Light
esp8266MiLight Hub
OpenHab/HomeAssistant/Domoticz
HP T610 & Debian 5.10.19-1 x86_64[/b]
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 »

LouiS22 wrote:
physiker123 wrote:I looked at the app (Flower Care), but when it detects my sensors it wants to make the firmware update. I cannot delete the notification (Nexus 5x with Android 7.1), so I have to restart the app. Therefore, I only have seconds to look at the app :D

I looked at the FAQ, and it gave as well the values of 500 for the fertility, but 35 for the moisture. I had a look at two different plants, but the values where the same (I hope I looked right, see above).

I will just look, if 35 is too much, and then lower the value.
The firmware update won't break anything IMHO.
PPL say that they wont work with flower care app after upgrade, they added regions to it. In domotics it works even after update.
-----------------------------------------
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
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 »

tontze wrote:
LouiS22 wrote:
physiker123 wrote:I looked at the app (Flower Care), but when it detects my sensors it wants to make the firmware update. I cannot delete the notification (Nexus 5x with Android 7.1), so I have to restart the app. Therefore, I only have seconds to look at the app :D

I looked at the FAQ, and it gave as well the values of 500 for the fertility, but 35 for the moisture. I had a look at two different plants, but the values where the same (I hope I looked right, see above).

I will just look, if 35 is too much, and then lower the value.
The firmware update won't break anything IMHO.
PPL say that they wont work with flower care app after upgrade, they added regions to it. In domotics it works even after update.
I know, but you can solve this easily, I've even provided a how-to before ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest