Xiaomi Mi Plants Monitor Flower

Great, it seems to be working now and I’m getting data back. I’ll let you know if I still get any crazy results though

1 Like

you updated to 38.1?

I updated to 38.1 then changed the miflora_poller file to the code linked above

@baz_12312 @anon35356645
Is the latest version of the modified code working for you ?

Hi, so far so good. No spikes as of yet at least. Although I have noticed that over night the light sensor reports weird values. It seems to vary between 0 and about 20. That could well be the sensor itself though I suppose

@Danielhiversen
Since I put your code is not working.

I upgraded to 38.1 and not working, after changed to your latest code and still not working.

No data displayed

Any errors in the log?
Is the component working with default code (without my changes) ?

Upgrading to 38.1 did not over write your code?

Do not think so.

Ahh

Well so is still your code.
No error in log

This is what I mean about the odd light sensor readings. It seems to be in the same constant range all night, then a random spike to 400 at about 16:00

in configuration.yaml try:

logger:
  logs:
    miflora.miflora_poller: debug
    homeassistant.components.sensor.miflora: debug

ValueError: Expecting value: line 1 column 1 (char 0)
17-02-15 21:08:20 DEBUG (Thread-3) [homeassistant.components.sensor.miflora] Polling data for Flower 1 Light intensity
17-02-15 21:08:20 DEBUG (Thread-3) [miflora.miflora_poller] Enter read_ble (<Thread(Thread-3, started daemon 1955591264)>)
17-02-15 21:08:20 DEBUG (Thread-3) [miflora.miflora_poller] Created lock in thread <Thread(Thread-3, started daemon 1955591264)>
17-02-15 21:08:20 DEBUG (Thread-3) [miflora.miflora_poller] Running gatttool with a timeout of 20
17-02-15 21:08:29 ERROR (Thread-7) [homeassistant.components.switch.command_line] Command failed: curl “http://192.168.1.52:8080/status.json
17-02-15 21:08:29 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: ‘value_json’ is undefined (value: None, template: {{ value_json.curvals.torch == “on” }})
17-02-15 21:08:29 ERROR (Thread-8) [homeassistant.components.switch.command_line] Command failed: curl “http://192.168.1.50:8080/status.json
17-02-15 21:08:29 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: ‘value_json’ is undefined (value: None, template: {{ value_json.curvals.torch == “on” }})
17-02-15 21:08:40 DEBUG (Thread-3) [miflora.miflora_poller] Killed hanging gatttool
17-02-15 21:08:40 DEBUG (Thread-3) [miflora.miflora_poller] Released lock in thread <Thread(Thread-3, started daemon 1955591264)>
17-02-15 21:08:40 DEBUG (Thread-3) [miflora.miflora_poller] Got from gatttool
17-02-15 21:08:40 DEBUG (Thread-3) [miflora.miflora_poller] Waiting for 10 seconds before retrying
17-02-15 21:08:50 DEBUG (Thread-3) [miflora.miflora_poller] Created lock in thread <Thread(Thread-3, started daemon 1955591264)>
17-02-15 21:08:50 DEBUG (Thread-3) [miflora.miflora_poller] Running gatttool with a timeout of 20
17-02-15 21:08:59 ERROR (Thread-6) [homeassistant.components.switch.command_line] Command failed: curl “http://192.168.1.50:8080/status.json
17-02-15 21:08:59 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: ‘value_json’ is undefined (value: None, template: {{ value_json.curvals.torch == “on” }})
17-02-15 21:09:10 DEBUG (Thread-3) [miflora.miflora_poller] Killed hanging gatttool
17-02-15 21:09:10 DEBUG (Thread-3) [miflora.miflora_poller] Released lock in thread <Thread(Thread-3, started daemon 1955591264)>
17-02-15 21:09:10 DEBUG (Thread-3) [miflora.miflora_poller] Got from gatttool
17-02-15 21:09:10 DEBUG (Thread-3) [miflora.miflora_poller] Waiting for 20 seconds before retrying
17-02-15 21:09:10 DEBUG (Thread-3) [miflora.miflora_poller] Created lock in thread <Thread(Thread-3, started daemon 1955591264)>
17-02-15 21:09:10 DEBUG (Thread-3) [miflora.miflora_poller] Running gatttool with a timeout of 20
17-02-15 21:09:29 ERROR (Thread-8) [homeassistant.components.switch.command_line] Command failed: curl “http://192.168.1.50:8080/status.json
17-02-15 21:09:29 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: ‘value_json’ is undefined (value: None, template: {{ value_json.curvals.torch == “on” }})
17-02-15 21:09:30 DEBUG (Thread-3) [miflora.miflora_poller] Killed hanging gatttool
17-02-15 21:09:30 DEBUG (Thread-3) [miflora.miflora_poller] Released lock in thread <Thread(Thread-3, started daemon 1955591264)>
17-02-15 21:09:30 DEBUG (Thread-3) [miflora.miflora_poller] Got from gatttool
17-02-15 21:09:30 DEBUG (Thread-3) [miflora.miflora_poller] Waiting for 20 seconds before retrying
17-02-15 21:09:30 DEBUG (Thread-3) [miflora.miflora_poller] Exit read_ble, no data (<Thread(Thread-3, started daemon 1955591264)>)
17-02-15 21:09:30 INFO (Thread-3) [homeassistant.components.sensor.miflora] Polling error [Errno Could not read data from Mi Flora sensor %s] C4:7C:8D:61:7C:01
17-02-15 21:09:30 DEBUG (Thread-1) [homeassistant.components.sensor.miflora] Polling data for Flower 1 Temperature
17-02-15 21:09:30 DEBUG (Thread-1) [miflora.miflora_poller] Using cache (0:15:00.013710 < 0:20:00)
17-02-15 21:09:30 INFO (Thread-1) [homeassistant.components.sensor.miflora] Polling error [Errno Could not read data from Mi Flora sensor %s] C4:7C:8D:61:7C:01
17-02-15 21:09:30 DEBUG (Thread-8) [homeassistant.components.sensor.miflora] Polling data for Flower 1 Battery
17-02-15 21:09:30 DEBUG (Thread-8) [miflora.miflora_poller] Enter read_ble (<Thread(Thread-8, started daemon 1906308192)>)
17-02-15 21:09:30 DEBUG (Thread-8) [miflora.miflora_poller] Created lock in thread <Thread(Thread-8, started daemon 1906308192)>
17-02-15 21:09:30 DEBUG (Thread-8) [miflora.miflora_poller] Running gatttool with a timeout of 20
17-02-15 21:09:50 DEBUG (Thread-8) [miflora.miflora_poller] Killed hanging gatttool
17-02-15 21:09:50 DEBUG (Thread-8) [miflora.miflora_poller] Released lock in thread <Thread(Thread-8, started daemon 1906308192)>
17-02-15 21:09:50 DEBUG (Thread-8) [miflora.miflora_poller] Got from gatttool
17-02-15 21:09:50 DEBUG (Thread-8) [miflora.miflora_poller] Waiting for 10 seconds before retrying

May I have the previous code?

FYI - These are on sale for $10 via email only special

http://m.gearbest.com/other-garden-supplies/pp_373947.html?wid=21&utm_source=mail_api&utm_medium=mail&utm_campaign=special.0209&eo=rSDoB3fEKyykH6ho&email=b2t8c0BiYXJyZXR0LnJlZHwxMjI0OQ==

Time to stock up!

It shows up at 12.89$ for me, and they always can be found for less than 10$ on Aliexpress :grinning: :

https://www.aliexpress.com/item/Original-Xiaomi-Mi-Flora-Monitor-Digital-Plants-Grass-Flowers-Soil-Water-Light-Smart-Tester-Sensor-for/32716710859.html

Hi, huge fan and I just ordered four sticks :slight_smile:

A couple of questions if someone can help out:

  1. When using multiple mi flora sticks, is there any other issue then that it takes time a bit extra time until all data are collected? (read something about locking…)
  2. I read something about using Razberry 2 disables bluetooth on the PI3, anyone know the case?
  3. Would it be possible using PI3 to setup another bluetooth USB adaptor, so it does not interfere with the tracker?
  4. IF there are issues, is that the case if you use a Z-wave usb stick like Aeon Labs 5gen (in conjunction with either PI3 bluetooth, or a separate bluetooth usb dongle)?

I can’t get it working anymore. How do you connect it to the HASS (I have mine on a pi3 with bluetooth, but is not picking any bluetooth signel from the miflora).

pi@raspberrypi:~ $ sudo hcitool lescan
Set scan parameters failed: Input/output error
pi@raspberrypi:~ $

  1. Yes, correct. I have several sensors and it is working fine.

3, Yes, from the latest release you can specify which Bluetooth adapter to use for each miflora device

1 Like

From release 0.39 of HA the will be more failure check of the data: https://github.com/home-assistant/home-assistant/pull/6142
So it should be less change of getting invalid data from the sensors.

1 Like