Xiaomi Mi Plants Monitor Flower

Damn, I wish i knew of this before buying a Parrot Flower power :frowning:

Can some one help integrate it to HASS?

Upgraded to 0.39 and the miflora has finally stabilized. Keeping fingers crossed. :fearful:

1 Like

Hi all,

I’ve just bought 2 of those sensor.

One have been founded by the raspberry pi BLE device tracker (the other one no, but that’s another question).

I took the MAC address and added the sensor in my sensors.yaml.

I can see the icons, but in 24h they don’t received any update (while I can see the situation on the Xiaomi app on my android phone).

Can someone please help me to find out the solution?

Thank you in advance

Just got two of these sensors. They weren’t working with HA so I tried to do some debugging. Data came back as all 0’s, so I tried:

gatttool --device=C4:7C:8D:61:6F:7F --char-write --handle=0x0033 --value=0xA01F

That however seems to never complete, it hangs forever. Anyone encounter this before?

Since I upgraded to 0.39… I’ve not had a single MiFlora update very occasionally HASS shows the battery level for 1 sensor (I have 4), so my question is where did the rest of the data go? B4 0.39 MiFlora worked flawlessly.

I have the same issue as keithh666

I just got these sensors :blush:

I see version 2.9.2 firmware is available for update in the app (from my current 2.6.2 I think)
can anyone confirm it would work?

also - how do you figure out the best conditions for a specific plant?

1 Like

@keith666 and @jokeringo
Could it be because of this?

Big banner on that gh repo from 7 days ago saying:

WARNING: XIAOMI HAS DECIDED IS WAS TIME TO UNSUPPORT AND ESSENTIALLY BRICK ALL DEVICES NOT LOCATED IN CHINA!

IF YOU BUY ONE ON ALIEXPRESS (OR ANY OTHER ONLINE SHOP) PLEASE MAKE A VIDEO OF YOUR TABLET OR PHONE WITH THE DEVICE SOFTWARE NOT WORKING IN YOUR COUNTRY AND GET YOUR MONEY BACK!

1 Like

2.9.2 Works OK for me

1 Like

My App is on 3.0.0 (Android version ‘Flower Care’) but i have not used the App since initially pairing the sensor with my RPi3 and HA. I am on HA 0.40.0 and all is running smoothly. I have the android app in hibernation through Greenify and do not intend to use it.

I managed to get mine working again by uninstalling bluez and re-installing Bluez 5.9 and reinstalling my bluetooth adaptor software.

Has anyone gotten the sensor working with HA running on a mac OS?

I’m having issues with some of the BLE tools and want to make sure I’m not going down a rabbit hole.

Oh sh*t.

I confirm that i cannot connect to my BLE Adaptors using Flower Care!

can you specify what you mess with rreinstalling bluetooth adaptor software?

This is a direct copy of my history buffer…
If this doesn’t work for you you will need to google a bit more, check which version of bluez that you have first!

sudo apt-get --purge remove bluez

cd ~; wget https://www.kernel.org/pub/linux/bluetooth/bluez-5.9.tar.xz
tar xvf bluez-5.9.tar.xz

sudo apt-get autoremove iptables-persistent
sudo apt-get install libusb-dev libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev

cd bluez-5.9
export LDFLAGS=-lrt
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-library -disable-systemd
make
sudo make install
sudo cp attrib/gatttool /usr/bin/
lsusb
sudo hciconfig hci0 up

You may need to restart your bluetooth…
sudo /etc/init.d/bluetooth restart

sudo service -f bluetooth
sudo systemctl start bluetooth
sudo systemctl enable bluetooth
sudo systemctl status bluetooth

sudo systemctl unmask bluetooth.service

sudo systemctl start bluetooth.service

modprobe btbcm

sudo systemctl start bluetooth

sudo apt-get remove bluemanz
sudo apt-get install pi-bluetooth
bluetoothctl

Your milage may vary depending on what state your PI is in regarding firmware updates and software updates - also I use mine headless so no gui :slight_smile:

FYI for anyone interested, I was eventually able to get the Mi Flora component working with home assistant running on a mac OS by using a Bluegiga BLED112 USB dongle and reconfiguring the Mi Flora polling file to use pygatt instead of gatttools. I believe it should be possible to use the BLED112 on windows machines, too. Since pygatt is a wrapper for either the bluez (gatttool) or a BGAPI adapter like the BLED112 I think this approach would make this component more universally compatible.

If anyone wants more info, feel free to ping me.

Currently during HA startup the following happens. Can somebody confirm this?

08:21:44 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: new_state=<state sensor.flower_light_intensity=unknown; friendly_name=Flower Light intensity, unit_of_measurement=lux @ 2017-03-26T08:21:44.122496+03:00>, entity_id=sensor.flower_zal_light_intensity, old_state=None>#033[0m

and than error in the logs

#033[33m17-03-26 08:21:44 WARNING (MainThread) [homeassistant.helpers.condition] Value cannot be processed as a number: unknown#033[0m

A company I for using this BLE dongles for wireless smartcard readers. We’ve tested a lot of dongles and this one is most reliable. There is a small issue with BLE and windows. Windows 7 haven’t BLE stack implemented in a core. If you’ll use this dongle with Windows 7 you have to communicate with it through APDU. In Windows 8 and 10 it work out of box.

I’ve done what you’ve suggested but I’m stuck at this point:

sudo hciconfig hci0 up

I don’t find any hci0 on my lsusb maybe because I have a raspberry 3 so bt is included and not as usb key.

What command should I use ?

TY!

hci0 should be the first ble adaptor on your RPI3, in your case the internal one. The RPI3 still uses the usb interface for the internal ble so you should still see it.
What do you get when you type just hciconfig?

You may want to look here http://raspberrypi.stackexchange.com/questions/48220/raspberry-pi-3-bluetooth-no-default-controller-available