Mi Flora plant sensor

yes,still nothing …

The Miflora component has been rewritten to use bluepy instead of gatttool. The implementation has a bug in error handling but A fix is in the works and should be included in the next release.

2 Likes

just so we are clear which release? 0.63? :slight_smile:

0.62.2 or 0.63 whichever happens first.

1 Like

Is anyone able to please help with gattool syntax, I realise this is slightly off topic but I’m sure you have the best knowledge on how to solve this query.
I’m trying to write a simple bash script which uses gattool to get the the raw data from the MiFlora device.
From what I’ve read the data is encoded in the 0x35 address. But I gather that address 0x33 has to be written with “A0 1F” before the 0x35 address can be read. I’ve tried as many combinations of syntax I can think of but still cant read the data using gattool.
This is basically what I’ve tried so far:
gatttool -i hci0 -b C4:7C:8D:66:17:C0 --char-write-req --handle=0x33 --value=“A01F”
Characteristic value was written successfully
then
gatttool --device=C4:7C:8D:66:17:C0 --char-read -a 0x35
Characteristic value/descriptor: aa bb cc dd ee ff 99 88 77 66 00 00 00 00 00 00
When the above data is shown as above the 0x33 write has not set the device in the correct mode.
Any help appreciated.

Update: No problem, I’m just going to use the demo.py script which works really well :slight_smile:
/home/pi/miflora/demo.py --backend gatttool poll C4:7C:8D:66:17:C0

Just a heads up that the price on these sensors have dropped to around $13us shipped on Ali Express, cheapest they’ve been in a while:

https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180206130931&SearchText=xiaomi+plant

Hi pals!

I’m running Hassio. According to this, Mi Flora should work right away:

“On Hass.io: Miflora will work out of the box.”

But, what does that mean? I just ordered a Bluetooth 4.0 dongle for my Raspberry Pi 2, where I run Hassio. Should I just add the sensor info to the configuration.yaml file? or should I still have to follow this tutorial?

Thanks!

Bluetooth on Hass.io only works on Raspberry Pi 3 as this is the only model with an add-on for the bluetooth chipset.

I tried to get a usb bluetooth dongle working on my Raspberry Pi 2 but failed miserably, I went for a RPi3 instead ^^

Followed your advice. Just waiting for my new Pi 3 :slight_smile: Thanks

Well, got my RP 3. It all looks good, but I’m not getting any values, like most of pals over here. My Mi Flora device is less than 2 meter away from the Pi :frowning:

Did you tried updating the firmware on your miflora devices? You can do it with the official Miflora phone apps. It seems the underlying miflora library is set to work with the latest firmware, I think.

I am not using a Pi anymore, so I ended up building 2 of these which bridge BT->MQTT for the MiFlora units:

About $10us for a Wemos D1 Mini and a HC-10 Bluetooth board. I have one at either end of my house and they are the only reliable solution I’ve found! In HA I made the MQTT sensors for each value.

The only difficult part about setting it up, is that the HC-10 BT module has to be the latest firmware. Flashing that firmware requires a Windows PC which was a PITA for me as I don’t use Windows. But other than that, once set up they just work.

1 Like

My device is up to date (3.1.8) . I’ll try to keep on testing. I don’t know whether it’s a problem with BLE. Does Bluetooth LE work out of the box? I just unboxed my Pi 3, swap in the SD card from the Pi 2 and that’s all. I don’t know whether I should’ve “turned on” the BLE somehow before that. Thanks!

Hi all,

I came here just to telle you that starting from few day my BLE usb device is no more working with HA.

Bluetooth tracking is working, but there’s no way to install GATTLIB and make LE device available agains. I tried also with pygatt but I still can’t see my miflora devices.

I open also a issue request on github but no one is commenting or taking care of it. Maybe is because BLE device are no so common? Or maybe because it can’t be solved?

Who knows.

Did you install the bluetooth addon? Hass.io with mi flora works absolutely fine for me

anyone starting to have problems with the latest release 0,67?

Just upgraded to 0.67 and enabled the Bluetooth addon. Mi Flora is now working on my Pi 3, finally!

my has stopped working :frowning:

Hi,

Anyone knows how to add templates to Mi Flora? I want to show something like “Needs water” when the “moisture” value is below 20, as an example.

Thanks

Something like this would work…

- alias: Plant Data Update
#   hide_entity: false
   initial_state: 'on'
   trigger:
     - platform: numeric_state
       entity_id: sensor.miflora_bird_of_paradise_moisture, sensor.miflora_trailing_plant_bathroom_moisture, sensor.miflora_volcano_fern_moisture, sensor.miflora_flowering_fern_moisture
       below: 15
   action:
 - service: notify.mypushbullet
   data_template:
     message: "This Plant needs water '{{ trigger.from_state.attributes.friendly_name }}' "

Hope that helps :slight_smile:

I got this working and appreciate everyone’s efforts on this component, but what are the values representative of? Is there an established range of values for each sensor that is considered ideal? I can’t find anywhere the recommended value to target here…

For instance my moisture is reading 11 what is that and is it low?