Page 4 of 17

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

Posted: Friday 06 January 2017 20:29
by Coldman
Update 2.8.6 date: 2017-01-06

Change log:
1. Fixed a bug of history data lost.
2. Fixed an abnormal issue when synchronize history data.
3. Fixed a bug that abnormal history data came out when temperature was below zero degree.
4. Fixed an issue that device restart unexpectedly due to the interval of connections.
5. Fixed a bug that users cannot connect with devices paired with the phone in the Bluetooth.
6. Cancelled Bluetooth pairing.
Spoiler: show
Screenshot_2017-01-06-22-08-46-409_com.huahuacaocao.flowercare.png
Screenshot_2017-01-06-22-08-46-409_com.huahuacaocao.flowercare.png (77.25 KiB) Viewed 4697 times
Screenshot_2017-01-06-22-08-13-014_com.huahuacaocao.flowercare.png
Screenshot_2017-01-06-22-08-13-014_com.huahuacaocao.flowercare.png (245.62 KiB) Viewed 4697 times
Screenshot_2017-01-06-22-08-25-757_com.huahuacaocao.flowercare.png
Screenshot_2017-01-06-22-08-25-757_com.huahuacaocao.flowercare.png (248.23 KiB) Viewed 4697 times
result of demo.py

Code: Select all

Getting data from Mi Flora
FW: 2.8.6
Name: Flower care
Temperature: 21.5
Moisture: 30
Light: 3
Conductivity: 529
Battery: 86

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

Posted: Monday 09 January 2017 10:10
by LouiS22
probably a stupid question, but I'm assuming I have to enter the full path to the script in crontab, ie: /pi/domoticz/scripts/python/python3 domoticz.py?

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

Posted: Monday 09 January 2017 11:07
by Itschi
Yes, you need to enter the full path.

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

Posted: Monday 09 January 2017 12:52
by Coldman
LouiS22 wrote:probably a stupid question, but I'm assuming I have to enter the full path to the script in crontab, ie: /pi/domoticz/scripts/python/python3 domoticz.py?
I think
python3 /home/pi/domoticz/scripts/python/domoticz.py

Отправлено с моего MI PAD 2 через Tapatalk

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

Posted: Tuesday 10 January 2017 10:33
by LouiS22
Coldman wrote:
LouiS22 wrote:probably a stupid question, but I'm assuming I have to enter the full path to the script in crontab, ie: /pi/domoticz/scripts/python/python3 domoticz.py?
I think
python3 /home/pi/domoticz/scripts/python/domoticz.py

Отправлено с моего MI PAD 2 через Tapatalk
Thanks, that was it!

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

Posted: Friday 13 January 2017 22:58
by remb0
great work all!

I tried it and get:

Code: Select all

python3 domoticz.py
Getting data from Mi Flora: c4:7C:8D:62:48:52
connect error: Transport endpoint is not connected (107)
connect error: Transport endpoint is not connected (107)
connect error: Transport endpoint is not connected (107)
connect error: Transport endpoint is not connected (107)
FW: None
connect error: Transport endpoint is not connected (107)
connect error: Transport endpoint is not connected (107)
Traceback (most recent call last):
  File "domoticz.py", line 71, in <module>
    update("c4:7C:8D:62:48:52","1478","1476","1477","1479")
  File "domoticz.py", line 42, in update
    print("Name: {}".format(poller.name()))
  File "/home/pi/domoticz/scripts/python/miflora/miflora/miflora_poller.py", line 173, in name
    return ''.join(chr(n) for n in name)
TypeError: 'NoneType' object is not iterable

second time:

python3 domoticz.py
Getting data from Mi Flora: c4:7C:8D:62:48:52
connect error: Transport endpoint is not connected (107)
connect error: Transport endpoint is not connected (107)
FW: 2.8.6
Name: Flower care
connect error: Transport endpoint is not connected (107)
connect error: Transport endpoint is not connected (107)
connect error: Transport endpoint is not connected (107)
connect error: Transport endpoint is not connected (107)
connect error: Transport endpoint is not connected (107)
connect error: Transport endpoint is not connected (107)
Moisture: 136
Light: 61149
Conductivity: 26231
Battery: 100
Temperature: 4804.2

I updated my python to 3. installed request.
have the correct mac and with hcitool scan I see Flower Care.

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

Posted: Saturday 14 January 2017 9:29
by trixwood
the second try looks like it has trouble reading it... it retries... and succeeded :-)

The first try probably related to bad error handling... I usually have issues with new ones...

https://github.com/open-homeautomation/miflora/issues/7

btw conductivity appears to be soil fertility...

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

If all else fails you could try the mtqq version...:

https://github.com/marcelrv/miflora

And some nice background:

https://wiki.hackerspace.pl/projects:xiaomi-flora

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

Posted: Saturday 14 January 2017 10:50
by trixwood
Also note that moisture is in procents % not soil moisture cb... that is a whole other unit... :D

And soil fertility should be above 500, for blocky or lua use (according to their app)

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

Posted: Saturday 14 January 2017 11:06
by Coldman
trixwood wrote:Also note that moisture is in procents % not soil moisture cb... that is a whole other unit... :D

And soil fertility should be above 500, for blocky or lua use (according to their app)
Great work!

Отправлено с моего MI PAD 2 через Tapatalk

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

Posted: Saturday 14 January 2017 11:25
by trixwood
connect error: Transport endpoint is not connected (107)

if the sensor is more then 4-5 meters from a pi3 (internal) bluetooth, it seems it's really struggling... to get a reading... :-)
Is that what you experienced?

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

Posted: Saturday 14 January 2017 11:47
by Coldman
trixwood wrote:connect error: Transport endpoint is not connected (107)

if the sensor is more then 4-5 meters from a pi3 (internal) bluetooth, it seems it's really struggling... to get a reading... :-)
Is that what you experienced?
I'm getting abnormal value sometimes, all of this more than 1000-2000, my sensors (8 pcs) located less than 1 meter and one about 3 meters from my RPi3. And notification: "Domoticz: Battery Low: Adenium obesum (Level: Low)", as example. In next request everything is ok.


Отправлено с моего MI PAD 2 через Tapatalk

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

Posted: Saturday 14 January 2017 13:25
by trixwood
With 6 really close by I get no (transport) retry errors, now with 11, usually it has to retry with 2 or 3... but much wider apart (in circle range of 5 meters of the pi) Still all value's correct read and bridged to domoticz, no spikes, but I will monitor ;-)
And I noticed one of the lux sensors was constant at 47094... (112630 in the app itself)... I think that's broken...

Will update in a couple of weeks about connectivity when I have 21 all around the house :-)

No more plant dehydration and starvation :-) Poor little buggers, suffered long enough.

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

Posted: Wednesday 18 January 2017 18:24
by trixwood
I also have abnormal value's, still think there are a lot of bugs in the code...

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

Posted: Wednesday 18 January 2017 18:45
by LouiS22
trixwood wrote:With 6 really close by I get no (transport) retry errors, now with 11, usually it has to retry with 2 or 3... but much wider apart (in circle range of 5 meters of the pi) Still all value's correct read and bridged to domoticz, no spikes, but I will monitor ;-)
And I noticed one of the lux sensors was constant at 47094... (112630 in the app itself)... I think that's broken...

Will update in a couple of weeks about connectivity when I have 21 all around the house :-)

No more plant dehydration and starvation :-) Poor little buggers, suffered long enough.
LOL, that's a forest you live in :D

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

Posted: Friday 20 January 2017 0:42
by trixwood
Well yeah if you put them all together it would, but spread out in a room. It does what plants do best, be part of the scenery. You hardly notice them...

Uhm, I patched the false readings...

The bad readings I got where:

fertility 26231
moisture 136
temperature 4804.2
lux 61149

consistently... so I was lazy and patch the domoticz scripts... let it max retry 3 times if temperatures are over 200 degree celcius...

Should remove any spikes...

(https://github.com/Tristan79/miflora)

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

Posted: Friday 20 January 2017 0:47
by Coldman
trixwood wrote: Uhm, I patched the false readings...
.
.
.
Should remove any spikes...
Greate work! Thx.

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

Posted: Friday 20 January 2017 11:10
by corbin
trixwood wrote: fertility 26231
moisture 136
temperature 4804.2
lux 61149
so when you got 1 elevated reading, all the others readings were elevated at the same time?

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

Posted: Friday 20 January 2017 11:18
by Coldman
corbin wrote:
trixwood wrote: fertility 26231
moisture 136
temperature 4804.2
lux 61149
so when you got 1 elevated reading, all the others readings were elevated at the same time?
Yes, and all others

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

Posted: Friday 20 January 2017 11:27
by corbin
Coldman wrote: Yes, and all others
thanks, I had seen the high readings, but haven't had time to investigate. I've modified the script to exit on a temp reading over 200 as trixwood did.

Also, I'm having a hard time keeping the fertility/conductivity over 500, can anyone offer some advice on this?

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

Posted: Friday 20 January 2017 12:35
by Coldman
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
Gardenia.jpg (335.85 KiB) Viewed 4339 times