Xiaomi Mi Plants Monitor Flower

I don0t understand if it could be related to a problem of signal strength…

VegTrug connect via Bluethoos. Have you connected it to HA this way? Like your setup here :slight_smile:

I bought two such devices from Amazon over the past year or so. They came in very different packages and are (apparently) of different brands. However, they both work fine with the iPhone App. The issue I’m having is that they pair with only one device (my iPhone). I wanted then to pair with a central device (e.g., a Raspberry Pi) so that the data can be accessed from multiple devices, whether my phone or something else.

Any thoughts on if/how such functionality can be achieved ?

You actually don’t need to pair to the device to get the state of the sensors - I believe the pairing is only required for loading historic data to the app. You can use any of the Mi Flora integrations with Home Assistant (e.g. if you’re running on a Bluetooth enabled Pi, the native integration, otherwise ESPHome has a good ESP32 integration which is what I’m using).

The plant monitor will regularly “advertise” over Bluetooth Low Energy. If a device is around and listening for that advertisement, it can read the data without needing to pair. This means that when you first start up the sensors, they won’t have data for all the observed metrics (sunlight, moisture, etc) until the advertisements have been received.

I’ve also had good luck using the North Connected Home app on my android phone https://play.google.com/store/apps/details?id=com.chug.northconnectedhome. It seems to connect fine to my mainland-china-only devices, and doesn’t conflict with the sensors in home assistant.

Thank you @ptrsnja . I’ll look this up, I was under the impression they needed to be ‘permanently’ paired to a single device. The reason is, once I paired them to my iPhone, they were not available anymore to pair with my iPad.

Hi, who is in charge of the smart flower pot integration?


link Ali

link Gear

That is an expensive smart pot/planter … I wonder what all the features are … self-watering perhaps?

I use it myself. Connects to MiHome. light sensor, humidity, fertility analyzer. Well, the main thing is automatic watering.
Gearbest shows a high price, in fact it costs $ 100.

This doesn’t seems to be bluetooth contrary to mi flora. Unless you confirm you can see it with a blietooth app like nrf connect ?

Has anyone used this monitoring script > https://diyfuturism.com/index.php/2017/12/19/home-assistant-making-plant-sensors-talk/

I have followed the guide but it’s not fulling working. The python script runs as I see it’s created the sensors but no data gets sent to the python script to.

configuration.yaml

plant:
  tomatoes:
    sensors:
      moisture: sensor.xiaomi_hhccjcy01_moisture
      temperature: sensor.xiaomi_hhccjcy01_temperature
      conductivity: sensor.xiaomi_hhccjcy01_soil_conductivity
      brightness: sensor.xiaomi_hhccjcy01_illuminance
    min_moisture: 10
    max_moisture: 100
    min_conductivity: 200
    min_temperature: 45

Automation:

  alias: Update Plant Problems
  description: ''
  trigger:
  - platform: state
    entity_id: plant.tomatoes
  condition: []
  action:
  - service: python_script.plant_problems
    data: {}
  mode: single

python_scripts/plant_problems.py

#
# DIYFUTURISM.COM
# PLANT_PROBLEMS.PY
# Make a list of all plants that need to be water and fertilized and combine into readable lists.
#
# Creates:
# sensor.water_plants_number
# sensor.fertilize_plants_number
# sensor.plant_problems
#
#  http://www.diyfuturism.com/making-houseplants-talk
 
problemPlants = 0
allproblemPlants = []
waterPlants = []
numberWater = 0
fertilizePlants = []
numberFertilize = 0
deadBatteries = []
numberdeadBatteries = 0
whichIcon = "mdi:help-circle-outline"
 
for entity_id in hass.states.entity_ids('plant'):
    state = hass.states.get(entity_id)
    if state.state == 'problem':
        problemPlants = problemPlants + 1
        allproblemPlants.append(state.name)
        problem = state.attributes.get('problem') or 'none'
        if "conductivity low" in problem:
          fertilizePlants.append(state.name)
          numberFertilize = numberFertilize + 1
        if "moisture low" in problem:
          waterPlants.append(state.name)
          numberWater = numberWater + 1
        if "battery low" in problem:
          deadBatteries.append(state.name)
          numberdeadBatteries = numberdeadBatteries + 1
 
# Set icon
if problemPlants > 0:
  whichIcon = "mdi:alert-circle-outline"
else:
  whichIcon = "mdi:check-circle-outline"
 
# Set states
hass.states.set('sensor.plant_problems', problemPlants, {
    'unit_of_measurement': 'plants',
    'friendly_name': 'Problem Plants',
    'icon': whichIcon,
    'problem_plants': allproblemPlants,
    'water': waterPlants,
    'water_number': numberWater,
    'fertilize': fertilizePlants,
    'fertilize_number': numberFertilize,
    'battery_change': deadBatteries,
    'battery_number': numberdeadBatteries
})
 
hass.states.set('sensor.water_plants_number', numberWater, {
    'unit_of_measurement': 'plants',
    'friendly_name': 'Water Plants Number',
    'icon': 'mdi:water'
})
 
waterplantsList = ', '.join(waterPlants)
if waterplantsList == "":
  waterplantsList = "None"
hass.states.set('sensor.water_plants_friendly', waterplantsList, {
    'friendly_name': 'Water Plants',
    'icon': 'mdi:water'
})
 
hass.states.set('sensor.fertilize_plants_number', numberFertilize, {
    'unit_of_measurement': 'plants',
    'friendly_name': 'Fertilize Plants Number',
    'icon': 'mdi:emoticon-poop'
})
 
fertilizeplantsList = ', '.join(fertilizePlants)
if waterplantsList == "":
  waterplantsList = "None"
hass.states.set('sensor.fertilize_plants_friendly', fertilizeplantsList, {
    'unit_of_measurement': 'plants',
    'friendly_name': 'Fertilize Plants',
    'icon': 'mdi:emoticon-poop'
})

Or can anyone recommend something else? i would really like to use the alexa TTS

I have not used that script but I have modified the plant component to display the actual problems in the state instead of just saying “Problem”. (What does that help if you still need to look at the problem attribute to know what the problem is.)

I just changed:

        if result:
            self._state = STATE_PROBLEM
            self._problems = ", ".join(result)

to:

        if result:
            self._state = ", ".join(result)
            self._problems = ", ".join(result)

And then just use a basic entities card with some icon coloring:
image

4 Likes

Thanks that is a really cool addition

I have a feeling I’m looking in the wrong location? >

Glad you find it useful!
You have to copy the plant component folder and files to your ha config custom_components folder to add it as a new custom component. If you just change that one line and do not change the component name etc. it will overrule the default plant component.

Habe the same problem? Can anyone help?

I also see that. I guess it’s just either a hardware limitation, too simple an algorithm in the firmware or both.
I average the moisture over 6 hours so I usually don’t notice it too much.

As I understand the issue happens only when using esphome as Bluetooth bridge, so its not the hardware or firmware…

Can someone confirm that?

Looks more like some byte swapping or other numerical bug inside the esp32 :thinking:

Wi-Fi 2,4Gz

I have 10+ miFlora, both chinese and european and purchased over a 2 year period, that I monitor using a Pi Zero with plantgw software. None of them exhibit this behaviour, so my guess is that this is a bug in the esphome software.

Yes, that’s also my guess… My hope is that anyone already find the bug in esp software and fixed it…

Just trying to get some updated information on this topic. I see many scattered threads and most are before the last few HA updates… Is anyone using these sensors successfully now on the current HA version? If so my couple of questions would be what is your method without having to flash the board. I noticed the plant app Mi Flora doesn’t even load on a new iPhone as I have seen in the description to get the MAC address… If anyone has any info it would be much appreciated!