Page 5 of 17
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Friday 20 January 2017 12:48
by corbin
Coldman wrote:corbin wrote:Coldman wrote:
Yes, and all others
Also, I'm having a hard time keeping the fertility/conductivity over 500, can anyone offer some advice on this?
I use fertilizer when watering -
http://www.biobizz.com/home/?lang=enuk
my gardenia blooms already 3 times this year
- Spoiler: show
- Gardenia.jpg
I've got quite a few tree ferns growing, some better than others, but the Xiaomi monitored ones are not doing the best (going ok but just not growing fast)
are you keeping your plants over 500 points?
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Friday 20 January 2017 14:00
by Coldman
corbin wrote:Coldman wrote:corbin wrote:
Also, I'm having a hard time keeping the fertility/conductivity over 500, can anyone offer some advice on this?
I use fertilizer when watering -
http://www.biobizz.com/home/?lang=enuk
my gardenia blooms already 3 times this year
- Spoiler: show
- Gardenia.jpg
I've got quite a few tree ferns growing, some better than others, but the Xiaomi monitored ones are not doing the best (going ok but just not growing fast)
are you keeping your plants over 500 points?
yes, I try to keep within 400 - 2000, but for each plant its own parameters, looking in the Flower Care app of knowledge
- Spoiler: show

- 2017-01-20_16-01-03.jpg (343.65 KiB) Viewed 4061 times
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Friday 20 January 2017 14:31
by MrClem_Domoticz
Hello,
First, thank you for the script.
I encounter an error when i want to test the demo.py file
Code: Select all
Traceback (most recent call last):
File "demo.py", line 1, in <module>
from miflora.miflora_poller import MiFloraPoller, \
File "/home/pi/flora/miflora/miflora/miflora_poller.py", line 12, in <module>
from subprocess import PIPE, Popen, TimeoutExpired
ImportError: cannot import name TimeoutExpired
I'm a noob in Python so ...I use google but for this one ... I need you
I have already check the bluetooth layer : hcitool lescan works well (gattool too)
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Friday 20 January 2017 14:34
by Coldman
trixwood wrote:
consistently... so I was lazy and patch the domoticz scripts... let it max retry 3 times if temperatures are over 200 degree celcius...
you set the delay in 5000 seconds between requests, it is so?
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Friday 20 January 2017 16:46
by trixwood
Agh.. crap, 5000 seconds...
Yeah, that happens when you mix to may languages and environments....

That should be 5 seconds to let the sensor cool down and the disturbance to clear up... fix that

Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Friday 20 January 2017 16:49
by trixwood
@mrclem
Those errors: ImportError: cannot import name XYZ
Fix em with: pip install XYZ
repeat that until you install all packages

(aargh python3... pip3 ofcourse)
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Friday 20 January 2017 17:16
by MrClem_Domoticz
thank you trixwood
Code: Select all
pip install TimeoutExpired
Downloading/unpacking TimeoutExpired
Could not find any downloads that satisfy the requirement TimeoutExpired
No distributions at all found for TimeoutExpired
Storing complete log in /home/pi/.pip/pip.log
I have already tried but with no success.
oups the package is subprocess, right ?
but I have the same result.
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Friday 20 January 2017 17:22
by trixwood
On my system it's pip3 for python3... and pip for python2... This code is python3...

Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Saturday 21 January 2017 11:17
by MrClem_Domoticz
I also tried with python 3 but same error on my Rpi. weird
I cloned the git : OK
I launched the setup.py install : OK
I checked the bluetooth layer testing the lescan and the gatttool tools.: OK
when i launch the demo.py : KO with this import error.
I don't know what to do. maybe reinstall python tool
I have tried this on python 2.7 and 3
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Wednesday 25 January 2017 20:27
by LouiS22
Damn, seems I have a defective one. Ordered 3 devices, 2 of them are ok, but the 3rd one doesn't seem work at all. It connects via the app, which is kinda weird cause I'm not able to get a bluetooth reading via raspi+bluetooth. Bad luck I guess and sending it back to china could cost me somewehere around buying a new one
If anyone have some advice or trick to get this thing working...
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Wednesday 25 January 2017 20:33
by Coldman
LouiS22 wrote:Damn, seems I have a defective one. Ordered 3 devices, 2 of them are ok, but the 3rd one doesn't seem work at all. It connects via the app, which is kinda weird cause I'm not able to get a bluetooth reading via raspi+bluetooth. Bad luck I guess and sending it back to china could cost me somewehere around buying a new one
If anyone have some advice or trick to get this thing working...
It is a pity of course, I have seen a review about the defective sensor on the Russian forum, it is quite rare. I have 10 pieces bought in different Chinese online stores at different times, but all the work ...
The sensor doesn't work in app Mi Flower Care also?
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Wednesday 25 January 2017 20:38
by LouiS22
Coldman wrote:LouiS22 wrote:Damn, seems I have a defective one. Ordered 3 devices, 2 of them are ok, but the 3rd one doesn't seem work at all. It connects via the app, which is kinda weird cause I'm not able to get a bluetooth reading via raspi+bluetooth. Bad luck I guess and sending it back to china could cost me somewehere around buying a new one
If anyone have some advice or trick to get this thing working...
It is a pity of course, I have seen a review about the defective sensor on the Russian forum, it is quite rare. I have 10 pieces bought in different Chinese online stores at different times, but all the work ...
The sensor doesn't work in app Mi Flower Care also?
Yeah, strange to me as well, seems a solid device. Unfortunately it doesn't work in Mi Flower as well. Looks like the connection has made, but no readings at all, also no battery status and not able to upgrade the firmware - which lead me to the conclusion that it's not connected at all.
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Wednesday 25 January 2017 20:41
by Coldman
LouiS22 wrote:Coldman wrote:LouiS22 wrote:Damn, seems I have a defective one. Ordered 3 devices, 2 of them are ok, but the 3rd one doesn't seem work at all. It connects via the app, which is kinda weird cause I'm not able to get a bluetooth reading via raspi+bluetooth. Bad luck I guess and sending it back to china could cost me somewehere around buying a new one
If anyone have some advice or trick to get this thing working...
It is a pity of course, I have seen a review about the defective sensor on the Russian forum, it is quite rare. I have 10 pieces bought in different Chinese online stores at different times, but all the work ...
The sensor doesn't work in app Mi Flower Care also?
Yeah, strange to me as well, seems a solid device. Unfortunately it doesn't work in Mi Flower as well. Looks like the connection has made, but no readings at all, also no battery status and not able to upgrade the firmware - which lead me to the conclusion that it's not connected at all.
maybe try change the battery
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Wednesday 25 January 2017 20:52
by LouiS22
Coldman wrote:LouiS22 wrote:Coldman wrote:
It is a pity of course, I have seen a review about the defective sensor on the Russian forum, it is quite rare. I have 10 pieces bought in different Chinese online stores at different times, but all the work ...
The sensor doesn't work in app Mi Flower Care also?
Yeah, strange to me as well, seems a solid device. Unfortunately it doesn't work in Mi Flower as well. Looks like the connection has made, but no readings at all, also no battery status and not able to upgrade the firmware - which lead me to the conclusion that it's not connected at all.
maybe try change the battery
LOL, can't believe it: replaced the battery - the result: device recognised, though the firmware upgrade stopped around 50%.
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Wednesday 25 January 2017 20:57
by Coldman
LouiS22 wrote:Coldman wrote:LouiS22 wrote:
Yeah, strange to me as well, seems a solid device. Unfortunately it doesn't work in Mi Flower as well. Looks like the connection has made, but no readings at all, also no battery status and not able to upgrade the firmware - which lead me to the conclusion that it's not connected at all.
maybe try change the battery
LOL, can't believe it: replaced the battery - the result: device recognised, though the firmware upgrade stopped around 50%.
The phone must be close to the sensor, everything will be okay, good luck!
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Tuesday 31 January 2017 23:38
by pvm
Small battery status update:
After 2 months of usage (1 data retrieval/day, except for some extra seting upon setup), the battery level is still at 100%
I can see my plant really likes the Domoticz notifications resulting in its care (water/fertilizer), it is growing considerably faster now
This kind of scripting would fit in the new Python plugin framework, wouldn't it? Using the a field similar (or exactly) to the data timeout field to set the polling frequency?
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Wednesday 01 February 2017 19:07
by remb0
pvm I think you are right.
the framework can help to share scripts easier and it would be great for other users! also to complete and test the current framework.
only one problem: who has enough knowledge to (re)write the scripts?
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Wednesday 01 February 2017 19:46
by remb0
after git pull updating i got:
Code: Select all
domoticz/scripts/python/miflora $ sudo python3 demo.py
Traceback (most recent call last):
File "demo.py", line 6, in <module>
print("Mi Flora: " + address)
NameError: name 'address' is not defined
seems that adress parameter isn't declared:
I put address = "c4:7C:8D:62:48:52" and i got:
Code: Select all
1: Kamerplant
connect error: Transport endpoint is not connected (107)
connect error: Transport endpoint is not connected (107)
connect error: Software caused connection abort (103)
connect: No route to host (113)
Traceback (most recent call last):
File "domoticz.py", line 89, in <module>
update("c4:7C:8D:62:48:52","1478","1476","1477","1479")
File "domoticz.py", line 46, in update
while loop < 2 and poller.parameter_value("temperature") > 200:
File "/home/pi/domoticz/scripts/python/miflora/miflora/miflora_poller.py", line 250, in parameter_value
self._mac)
OSError: [Errno Could not read data from Mi Flora sensor %s] c4:7C:8D:62:48:52
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Wednesday 01 February 2017 19:54
by deennoo
The main probleme, even if i don't have enough knowledge yet to made a plugin, is using gatttool.
Gatttool is monothread, when he run he can't used for somthing else.
There is a python lib who is call blue.py who allow to be used for many thread on the same time.
We can imagine provid a plugin for Bt device who use it.
On jeedom (a french automation app) their is a plugin call BLEA, he is able to drive :
- beacon
- awox bulb
- playbulb device
- recieve mi-scale info
- recieve Mi-Flora
- scan for nodo bt switch action
And more with only one bt4le dongle
Shame for us Dev was a Domoticz user before switching for Jeedom.
Chance we have is that plugin is free and we can have source from github :but looks like they hide it, no matter, for dev who want i put files here :
https://drive.google.com/open?id=0B-QCl ... DY5REJGUU0
Adapting it for domoticz can be a good start.
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Friday 03 February 2017 5:14
by trixwood
@remb0: Does it help if you use all uppercase? the first c4 is lower, you never know...
there is a pull requested merged with adapters fixes... could help
Anyway hope somebody makes a bluetooth plugin for domoticz... that would be awesome!
2 month in reading every hour lowest battery 93% (16 devices
