Page 13 of 17

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

Posted: Tuesday 09 May 2017 7:18
by bertbigb
pvm wrote:You can also make a slave Domoticz and have Domoticz sent these values over to the other one
Hi pvm, Thanks for the suggestion, I know and that works also but I would like to make use of MQTT for other purposes also.

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

Posted: Thursday 11 May 2017 2:03
by madrian
Today I needed to reinstall my Orange Pi Zero, before I had armbian's Ubuntu server mainline /experimental/ version, now I installed stable kernel.

At least I 3x reinstalled things (bluez 5.44, 5.45), but I can't get it work. :x Before reinstall it worked perfectly.

Code: Select all

# python3 demo.py 
Getting data from Mi Flora
FW: 2.9.4
connect: Device or resource busy (16)
Name: Flower care
connect: Device or resource busy (16)
connect: Device or resource busy (16)
Traceback (most recent call last):
  File "demo.py", line 8, in <module>
    print("Temperature: {}".format(poller.parameter_value("temperature")))
  File "/root/miflora/miflora/miflora_poller.py", line 259, in parameter_value
    self._mac)
OSError: [Errno Could not read data from Mi Flora sensor %s] C4:7C:8D:62:6E:22

# python3 demo.py 
Getting data from Mi Flora
FW: 2.6.2
connect: Device or resource busy (16)
Name: Flower mate
connect: Device or resource busy (16)
connect: No route to host (113)
connect: No route to host (113)
connect: No route to host (113)
Traceback (most recent call last):
  File "demo.py", line 8, in <module>
    print("Temperature: {}".format(poller.parameter_value("temperature")))
  File "/root/miflora/miflora/miflora_poller.py", line 259, in parameter_value
    self._mac)
OSError: [Errno Could not read data from Mi Flora sensor %s] C4:7C:8D:61:AA:A8
No other process/mobile is connected to the miflora.

sudo hcitool lescan works.
bluetoothctl -> scan on -> nothing shows up here, but it worked before.

What the...? :roll:

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

Posted: Thursday 11 May 2017 8:02
by Szwuntex
madrian wrote:Today I needed to reinstall my Orange Pi Zero, before I had armbian's Ubuntu server mainline /experimental/ version, now I installed stable kernel.

At least I 3x reinstalled things (bluez 5.44, 5.45), but I can't get it work. :x Before reinstall it worked perfectly.
Have you tried 5.43?
It didn't work with 5.44 for me so I had to downgrade to 5.43.

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

Posted: Thursday 11 May 2017 8:14
by madrian
I will try today, if it does not help I am going to reinstalo the whole system.

Edit:

Oh yes, and Parrot Flower Power works (uses similar code).

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

Posted: Thursday 11 May 2017 19:18
by madrian
Final solution for OrangePi zero users: armbian experimental (mainline) version, which comes with Bluez 5.37. Works!

...unfortunately this version of armbian comes with kernel where built in wlan is disabled.

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

Posted: Friday 26 May 2017 23:55
by krizzz
My Bluetooth USB adapter for my Raspberry pi 2 Sems to work quite unreliable. I need to reset the USB (pulling iut the adapter) about Every day now.

So the script works to readout the Miflora
Sensor but maybe it makes the Life difficult for the USB adapter

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

Posted: Saturday 27 May 2017 10:00
by bertbigb
Hi Krizzz,
What is your exact question to us?
What makes you think there is something wrong with the script, I can't find any info/logging about that.
Can you provide info if it was working ok before? For how long. Was there a change in your system and after that change it wasn't working anymore?

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

Posted: Saturday 27 May 2017 17:07
by krizzz
bertbigb wrote:Hi Krizzz,
What is your exact question to us?
What makes you think there is something wrong with the script, I can't find any info/logging about that.
Can you provide info if it was working ok before? For how long. Was there a change in your system and after that change it wasn't working anymore?
Hi Bert, sorry for my unclear message. No there is nothing in the script that makes the USB dongle unreliable. Lets make that clear.

Please see my message as a emotional post about a piece of hardware that is not doing something I want to do :).

Because I do not hear anyone about this problem here, I have to continue my search somewhere else.


Verzonden vanaf mijn iPhone met Tapatalk

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

Posted: Tuesday 13 June 2017 22:52
by krizzz
The devices for the Mi Flora sensor were not updated for a time so I decided to plug out the bluetooth usb stick and to reset the HCIconfig tool. I did this, and executed the domoticz.py script in the Miflora folder and received the following message. Did not see this one before

Code: Select all

 connect error: Transport endpoint is not connected (107))
The other point is when doing the HCICONFIG command, it scans the bkuetooth device without any problem. So i do not really know why this error is coming up. Any tips?

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

Posted: Thursday 22 June 2017 9:12
by Abbadon
Same problem here.. I have to restart my bt doongle with script

Code: Select all

#!/bin/bash
now=$(date +"%T")
echo "Current time : $now"
id=`lsusb |grep Bluetooth |awk '{ print $4 }'| sed 's/://g'`
sudo ./usbreset /dev/bus/usb/001/"$id"
sleep 5
python3 /home/pi/flora/domoticz.py 
I did that to sudo crontab to wxecute every 5 mins,, funny fact is., if i do that by my finger (execute script) its working fine but cron dont work like it should

Usbreset script source
https://askubuntu.com/questions/645/how ... mmand-line

Crontab entry
*/5 * * * * sh /home/pi/flora/rebooter.sh >> /home/pi/temp/rebooter.txt

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

Posted: Saturday 24 June 2017 0:52
by JoannaMel
I joined purely to post this. :)
While i do not have/use Domoticz at the moment, it does look like something right up my street...
If any other unfortunate souls end up here trying to make their China-only Xiaomi Mi Flora Smart Plants monitor work with Flower Care app, here's my guide.

The error shown on the screen when trying to pair the sensor is: "The device is for China Mainland user only, please contact the reseller for international version"
Screenshot_20170623-170727.png
Screenshot_20170623-170727.png (74.92 KiB) Viewed 5909 times
I have followed some advice earlier in this thread, but found the advice lacking in detail.

It seems that you only need to convince the app you are in china when first linking the device. Once you have done so it shall remain accessible in the app, even when no longer spoofing location.

To make it work, on my android phone i did the following:
1) turn off mobile network totally (for me: settings - sim cards - sim1- disable) - this prevents your mobile using mobile network masts to approximate location.
2) enable developer mode (settings - about phone - tap "build number" 10 or so times)
3) get a location spoofing app. I chose the first one i found : https://play.google.com/store/apps/deta ... akegps.fre
4)Select it under settings- developer - select mock location app
5) open the app, tap a location in china and start "faking" location
6) get free vpn with chinese servers. I had to try a couple. One that worked was: https://play.google.com/store/apps/deta ... .flyclient (3 x 20mins free daily)
7) connect to Chinese server via vpn. For me this was shanghai.
8) open the Flower care app and connect the new sensor as normal. (i have taken the battery out of the sensor immediately prior to this, in case it somehow "remembered" the previous failed pairing, but i expect this was not necessary)
I also set my timezone to manual and chose a location in china, but have a feeling this was not necessary either.
It should now allow you to connect.
9) return back to normal settings, remove the no-longer-needed apps, and enjoy your now-working sensor!

Hope this helps somebody.
Jo

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

Posted: Saturday 24 June 2017 8:14
by LouiS22
I believe you wrote almost the same as I did in my first how-to :)

Step 1 and time zone setting is not neccesary.

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

Posted: Monday 26 June 2017 17:59
by JoannaMel
LouiS22 wrote:Step 1 a... is not neccesary.
The reason I included this is that I do not change location settings to use only (spoofed) GPS for location - I was under the impression that is the spoofed location and Mobile network inferred position did not agree it could cause issues...

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

Posted: Monday 26 June 2017 21:45
by krizzz
Do not seem to get my miflora backup again. It still giving me the
Transport endpoint is not connected (107)
error message...

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

Posted: Monday 26 June 2017 21:46
by krizzz
Do not seem to get my miflora backup again. It still giving me the
Transport endpoint is not connected (107)
error message...Anyone any ideas?

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

Posted: Monday 26 June 2017 21:51
by krizzz
Do not seem to get my miflora backup again. It still giving me the

Code: Select all

 Transport endpoint is not connected (107)
error message...And then after a reboot back to the

Code: Select all

Connection refused (111)
Anyone any ideas?

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

Posted: Tuesday 27 June 2017 9:22
by LouiS22
krizzz wrote:Do not seem to get my miflora backup again. It still giving me the

Code: Select all

 Transport endpoint is not connected (107)
error message...And then after a reboot back to the

Code: Select all

Connection refused (111)
Anyone any ideas?
By any chance do you have a running MiFlora app on your phone? I've noticed it could disturb the communication with the sensor. Just and idea, though.

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

Posted: Sunday 02 July 2017 10:48
by Ricard1
Hi All!

As this thread is 13 pages I ask here if someone can give a short good advice... :)

Can I use this sensor reliably if I have maximum 15-20 meters distance two the controller (Windows10) running Domotics and lets say two plaster walls as worse case?

If not, do you know any alternative? For measuring soil humidity i.e a 433MHz device would be more straight on simple and also providing better distance, normally.

Kind regards,
Ricard

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

Posted: Friday 04 August 2017 9:38
by Stefan
Hey guys, my device is on the way and I'm very excited :D

But I'm a bit curios, does it really have a PH sensor? In some descriptions on various websites I see that it haves, but from the readings you guys are posting, it doesn't.

And did anybody try submerging the electrodes in water? If yes, how do the readings look? If it works, it might be a perfect tool also for aquariums, as it can measure some quite important variables.

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

Posted: Saturday 05 August 2017 11:00
by AVBoX
After following the Wiki I have this error

Code: Select all

pi@raspberrypi ~ $ /usr/bin/python3 /home/pi/domoticz/scripts/python/miflora/domoticz.py
Traceback (most recent call last):
  File "/home/pi/domoticz/scripts/python/miflora/domoticz.py", line 4, in <module>
    from miflora.miflora_poller import MiFloraPoller, \
  File "/home/pi/domoticz/scripts/python/miflora/miflora/miflora_poller.py", line 12, in <module>
    from subprocess import PIPE, Popen, TimeoutExpired
ImportError: cannot import name TimeoutExpired
Did you have a solution to the problem ?

Thx