Xiaomi Mi Plants Monitor Flower

I have a feeling that in order to flash there is some authentication or approved list of applications that can flash the firmware. This means that only the “Northfifteen” app can flash it instead of the miflora app.

Finally resolved the issue with MI Home App. Changed the region to mainland China in Mi Home App and then binded and ungraded the firmware without any issue. Esp32/espHome setup now works.

1 Like

here is my custom flower card, including an rgb led light with some automations to telling me about the flower stats. if the plant needs water, the led ist flashing blue…

my broadlink remote provide the ir signal to the led.

4 Likes

@raspberrypi353 This looks nice. Do you mind sharing the card?

1 Like

Is there any explanation why my moisture values are so shaky? Illuminance values are rock solid.
I read the values with an ESP32 and post it to MQTT to get them in HA.

My experience is that these sensors are not really VERY reliable (I have a bunch of the “vegtrug” variant).
They are “all over the place” when reporting data - especially moisture and conductivity.
I am using this integration: https://github.com/custom-components/sensor.mitemp_bt
And had to set it to update by using the median of values from the last 5 minutes to get something useful out of them. I would still like to have some kind of “calibration” though, as they report very inconsitent values. One is now reporting more than 70% moisture for one of the plants, but when I touch the soil, it feels completely dry…

1 Like

Ive got 5 of them spread through my various gardens etc, and in general havent experienced any of these problem.

They seem to be more accurate than the “cheap” sensors i have hard wired to an arduino UNO.

One thing i have noticed … data starts getting a bit iffy, particularly around moisture and conductivity, when the battery is starting to get low.

2 Likes

I have 4 of the “VegTruc” variant for about 3 months now and I’m extremely happy with them. They seem to be either pre-calibrated or do some self-calibrating, because the values of all four (under testing conditions) agreed almost 100%.

In the beginning, I was a little confused about moisture and conductivity readings, too, but it turned out the sensors were right: When I thought the plant was dry (dry soil at top), it was actually quite wet at the bottom. I still have to get used to the conductivity readings, though: It kinda shoots up when watering the plant, especially if you have added fertilizer a few days ago. This is explainable, though: Conductivity will rise when watering again, because it can only be measured when wet.

I’m also quite impressed about the range: I have my HA Raspi in the hallway, and it reads the farthest plant (about 10 metres distance) through 2 stone walls without problem.

Batteries are at 99% after 3 months, only one at 98%. I update every 20 minutes.

Since I don’t have a “green thumb”, I also made my plants speak via a high-pitched TTS voice, so they can call for help when encountering problems. Since then I’ve actually done some “electronic Feng Shui” (i.e., moving around some plants for better light/temperature conditions). What can I say—all monitored plants now grow like crazy instead of dying, even the expensive Howea palm (which I had to replace every few month before because it died).

A good investment for me, even at around €20 shipped. I’ll certainly get more.

Note: Since about HA 0.112/0.113, sometimes all sensors show “unavailable” at startup and don’t cure after 20 minutes. A HA restart usually solves this.

If anyone’s interested, here is the (bilingual) “speaking plant” script and the automation to go with it (PicoTTS-based):

say_plant_status:
  alias: 'Say plant status'
  description: 'Alert about plant problem (single plant)'
  fields:
    entity_id:
      description: 'Entity Id of the media player to use'
      example: 'media_player.signalpi1'
    audiofile:
      description: 'Name of introductory audio file to play. MUST be WAV, pcm-s16le, mono, 16000 Hz.'
      example: 'picotts-beep.wav'
    plant_id:
      description: 'The entity ID of the plant'
      example: 'plant.fern'
    message:
      description: 'The name of the plant to speak in "This is …" (can be a template)'
      example: "your fern"
    language:
      description: 'The language to speak in (defaults to tts: setting)'
      example: 'en-GB'
  sequence:
    # only alert if "Audio Alerts" is on
    - condition: state
      entity_id: 'input_boolean.audio_alerts'
      state: 'on'
    # play text message
    - service: tts.picotts_say
      data_template:
        entity_id: "{{ entity_id|default(states('var.audio_alerts_media_player'),true) }}"
        language: "{{ language | default(states('input_select.audio_language'), true) }}"
        message: >-
          {% set language = language | default(states('input_select.audio_language'), true) %}
          {% set lang = language[0:2] %}
          {% set problem = state_attr(plant_id, 'problem') %}
          {%- if audiofile == '' -%}
          {%- elif audiofile -%}
            <play file="{{ states('var.audio_alerts_base_path') }}/{{ lang }}/{{ audiofile }}"/>
          {%- else -%}
            <play file="{{ states('var.audio_alerts_base_path') }}/{{ lang }}/{% if problem == 'none' %}picotts-plant-ok.wav{% else %}picotts-plant-problem.wav{% endif %}"/>
          {%- endif -%}
          {% set problems = problem.split(', ') %}
          <volume level="60"><pitch level="+75%">
          {%- if lang == 'de' -%}
            {%- set map_problem = {
                'moisture low': "ich verdurste",
                'moisture high': "es ist so nass hier",
                'moisture unavailable': "",
                'brightness low': "es war lange zu dunkel",
                'brightness high': "mir ist zu hell",
                'brightness unavailable': "",
                'temperature low': "ich friere",
                'temperature high': "mir ist zu warm",
                'temperature unavailable': "",
                'conductivity low': "ich bräuchte etwas Dünger",
                'conductivity high': "ich bin überdüngt",
                'conductivity unavailable': "",
                } -%}
            {{ 'Hallo! Hier spricht ' ~ message ~ '. ' -}}
            {%- if problems == ['none'] -%}
              {{ ["Mir geht es wieder prima!", "Alles ist wieder gut.", "Danke, dass du dich um mich kümmerst!"] | random }}
            {%- else -%}
              {%- for p in problems if not 'unavailable' in p -%}
                {%- if loop.last and loop.index > 1 %} und {% elif not loop.first %}, {% endif -%}{%- if loop.first -%}{{- map_problem[p][0:1] | upper() ~ map_problem[p][1:] -}}{%- else -%}{{- map_problem[p] -}}{%- endif -%}
                {%- if loop.last and loop.index > 0 %}. {% endif -%}
              {%- endfor -%}Hilfst du mir bitte?
            {%- endif -%}
          {%- else -%}
            {%- set map_problem = {
                'moisture low': "I'm dried out",
                'moisture high': "I'm too wet",
                'moisture unavailable': "",
                'brightness low': "it's been too dark for a long time",
                'brightness high': "it's too bright for me",
                'brightness unavailable': "",
                'temperature low': "I'm cold",
                'temperature high': "it's so warm",
                'temperature unavailable': "",
                'conductivity low': "I need some fertilzer",
                'conductivity high': "I'm over-fertilized",
                'conductivity unavailable': "",
                } -%}
            {{ 'Hello! This is ' ~ message ~ ' speaking. ' -}}
            {%- if problems == ['none'] -%}
              {{ ["I feel really great again!", "All is well again.", "Thank you for caring about me!"] | random }}
            {%- else -%}
              {%- for p in problems if not 'unavailable' in p -%}
                {%- if loop.last and loop.index > 1 %} and {% elif not loop.first %}, {% endif -%}{%- if loop.first -%}{{- map_problem[p][0:1] | upper() ~ map_problem[p][1:] -}}{%- else -%}{{- map_problem[p] -}}{%- endif -%}
                {%- if loop.last and loop.index > 0 %}. {% endif -%}
              {%- endfor -%}Will you help me, please?
            {%- endif -%}
          {%- endif -%}
          </pitch></volume>
  # Plant Problem
  - alias: "Problem mit Pflanze"
    trigger:
      platform: state
      entity_id:
        - plant.farn
        - plant.wohnzimmer_palme
        - plant.wohnzimmer_spargel
        - plant.bergpalme
      to:
        - 'problem'
        - 'ok'
    action:
      - service: script.say_plant_status
        data_template:
          plant_id: "{{ trigger.entity_id }}"
          message: >-
            {% set language = language | default(states('input_select.audio_language'), true) %}
            {% set lang = language[0:2] %}
            {% set plants = {
              "plant.farn": {
                "en": "your fern",
                "de": "dein Farn",
              },
              "plant.wohnzimmer_palme": {
                "en": "your livingroom palm tree",
                "de": "deine Wohnzimmer-Palme",
              },
              "plant.bergpalme": {
                "en": "your parlour palm",
                "de": "deine Bergpalme",
              },
              "plant.wohnzimmer_spargel": {
                "en": "your livingroom asparagus",
                "de": "dein Wohnzimmer-Spargel",
              },
            } %}
            {{ plants[trigger.entity_id][lang] }}


8 Likes

Hi Pete,

Am I doing something wrong here when trying to add an image?

plant:
  tomatoes:
    sensors:
      moisture: sensor.miflora_moi
      temperature: sensor.miflora_tem
      conductivity: sensor.miflora_fer
      brightness: sensor.miflora_lux
    min_moisture: 20 

  customize:
    plant.tomatoes:
      friendly_name: Garden Tomatoes
      entity_picture: /local/images/tomatoes.jpg

i get the error -

  • Invalid config for [plant]: [plant.tomatoes] is an invalid option for [plant]. Check: plant->plant->customize->plant.tomatoes. (See /config/configuration.yaml, line 22).
  • Invalid config for [plant]: [tomatoes] is an invalid option for [plant]. Check: plant->plant->customize->tomatoes. (See /config/configuration.yaml, line 22).

Gareth, looks like you have nested customize inside of plant which is not recognised. Below is an except from my plant package files. Hope that helps.

plant:
  miflora_1:
    sensors:
      moisture: sensor.miflora_1_moisture
      battery: sensor.miflora_1_battery
      temperature: sensor.miflora_1_temperature
      conductivity: sensor.miflora_1_conductivity
      brightness: sensor.miflora_1_brightness

homeassistant:
  customize:
    plant.miflora_1:
      friendly_name: Dragon Tree
      entity_picture: /local/dragon_tree.jpg

Ah, thanks @PeteB that’s now working :slight_smile:

What range are people achieving with the mi flora sensor?

My receiver is an esp32 with openmqttgateway and achiving less than 5 meters

I get less but not unhappy.

I believe its Bluetooth LE - so it will be competing with your 2.4Ghz wifi/phone/microwave oven, as well as being fairly low power.

For info I’m getting far better range with an external antenna. The esp32 olimex gateway has one among others :

Hi! Last week I got my Miflora setup running.
I noticed one thing thats really strange regarding the humidity sensor. After I watered - the humidity peaks around 70 - then will drop of course but once it reaches 46 it goes immediately down to 23 (see attached screenshot).
What could be the reason for this kind of behaviour? My receiver is an esp32 - esphome.
Any suggestions/help how to fix it?

All the other sensors are behaving completely normal!

Hey All, so I decided to update 15 MiFloras to the latest firmware version 3.2.2 and in the process discovered that 4 were the chinese variant. Unfortunately, I cant seem to get these to bind to the Flower Care app. I have tried selecting Mainland China in the settings. I’ve gone so far as to “VPN into China” to get a local IP address but to no avail. Has anyone managed to firmware update a Chinese variant out side of china ?

How do you know if they are chinese? I might have a couple and I did get them all updated.

The chinese variant wont connect to the Flower Care app if outside of china. When you try, it comes up with a “The device is for china mainland only” message. I bought them all a couple of years ago advertised as the international version but only discovered the mixed batch when I tried to pair them with the Flower Care App.

Perhaps the WatchFlower app is of some help for your chinese Mi Flora’s (it says that it also works for chinese Mi Flora’s). I just found it and it works great next to my Home Assistant ESPhome BLE Wifi setup.

Although not HA integrated, it does help for one of my Mi Flora’s which doesn’t work in my HA setup.

5 Likes

Hi,
I have 0.117.1 and I have some problem with MiFlora integration, bluetooth seem to work fine:

xxxxxxx1C:11 is the MiFlora device…

but I don’t any data in sensor/lovelace…

1 Like