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

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

Moderator: leecollings

Post Reply
User avatar
corbin
Posts: 463
Joined: Saturday 20 August 2016 22:57
Target OS: Windows
Domoticz version: Beta
Location: Brisbane, Australia
Contact:

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

Post 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?
Question about the Xiaomi Gateway in Domoticz? Please check the Wiki first: https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)
Coldman
Posts: 61
Joined: Saturday 17 December 2016 11:51
Target OS: Linux
Domoticz version: Beta
Location: Moscow, Russia
Contact:

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

Post 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
2017-01-20_16-01-03.jpg (343.65 KiB) Viewed 4040 times
MrClem_Domoticz
Posts: 3
Joined: Wednesday 24 September 2014 11:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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)
Last edited by MrClem_Domoticz on Friday 20 January 2017 17:06, edited 1 time in total.
Coldman
Posts: 61
Joined: Saturday 17 December 2016 11:51
Target OS: Linux
Domoticz version: Beta
Location: Moscow, Russia
Contact:

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

Post 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?
trixwood

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

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

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

Post 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)
MrClem_Domoticz
Posts: 3
Joined: Wednesday 24 September 2014 11:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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.
trixwood

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

Post by trixwood »

On my system it's pip3 for python3... and pip for python2... This code is python3... :-)
MrClem_Domoticz
Posts: 3
Joined: Wednesday 24 September 2014 11:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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
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 »

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...
Coldman
Posts: 61
Joined: Saturday 17 December 2016 11:51
Target OS: Linux
Domoticz version: Beta
Location: Moscow, Russia
Contact:

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

Post 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?
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 »

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.
Coldman
Posts: 61
Joined: Saturday 17 December 2016 11:51
Target OS: Linux
Domoticz version: Beta
Location: Moscow, Russia
Contact:

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

Post 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
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 »

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%.
Coldman
Posts: 61
Joined: Saturday 17 December 2016 11:51
Target OS: Linux
Domoticz version: Beta
Location: Moscow, Russia
Contact:

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

Post 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!
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 »

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?
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
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 »

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?
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 »

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

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.
Last edited by deennoo on Friday 03 February 2017 20:25, edited 1 time in total.
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 »

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

Who is online

Users browsing this forum: No registered users and 1 guest