Xiaomi Mi Plants Monitor Flower

PWM turns the LEDs on and off with a very high frequency. so you cannot see it. But a sensor could read the light level just at the moment when the light is off.

1 Like

Ah that is right, I remember it from some micro controller starter kit I bought and worked ourselves through with my son pretty recently (recommended BTW). I am not sure I understand why they would use a PWM on a growth light that only is on/off, but maybe its to preserve electricity. I googled some and as I understood it, pulsating light is better than constant light – with the same effect on the bottom line, which I imagine means that higher intensity in pulses is better than a lower level of constant light.

If I understand this article correctly:
https://spider.doc88.com/p-6337675074670.html

New firmware out, 3.3.1. Did not notice any functional or behavioral changes yet though.

Thought i would share my automation for a pushover and Alexa tts notification when a plant needs watering

  alias: Plant Watering - Madagascar dragon tree
  description: ''
  trigger:
  - platform: time
    at: '20:06:00'
  condition:
  - condition: numeric_state
    entity_id: plant.Madagascar
    below: 45
  action:
  - service: notify.mypushover
    data:
      message: 'The madagascar dragon tree in the living room needs watering!  '
      title: Plant SOS
  - service: notify.alexa_media
    data:
      data:
        type: announce
      target:
      - media_player.living_room
      - media_player.kitchen_echo
      message: The madagascar dragon tree in the living room needs watering!
  mode: single

SO if the Madagascar dragon tree moisture is lower than 45% when this automation is triggered at 8 pm I will get a notification.

1 Like

I got this notification in the VegTrug iOS app. I guess it means the sensors will also no longer be marketed under that brand.

I paired them using bluetoothctl from using ssh connection to HA.
I don’t remember the exact commands ive used but i figured it out just by looking at ‘bluetoothctl help’
was something like :slight_smile:
1 - scan … to get the mac adress of each sensor
2 - trust sensor x mac addr.
3 - pair sensor x mac addr
I remenber i had to do the #2 & #3 part real quick there was a time limit i think…

hope this helps

After upgrading my sensors to version 3.3.x I’ve also started to see this behaviour.
The moisture level goes down evenly until it reaches appx. 40-60%, then it suddenly drops appx. 20% at once.

I’m using plantgw, and with older miFlora firmware I did not see this behaviour. I used to trigger an alarm at 25% for most of my plants, but now I no longer track the moisture level reliably.

I have several sensor and all seem to behave this way with new firmware:
Some examples:
a1 gb klematis

I suggest you write to HHCC support. I might do the same.
I did contact them regarding another issue some time back and a later firmware update fixed it, although they never acknowledged the request or told me about a fix.

1 Like

Good idea. But how do one contact HHCC support?

I did find the address and sent them a request. Also created a graph collection for 3 of my plants for the first week of June 2020 and 2021. Will attach here also. This the same hardware and collection method, but 2.6(?) firmware in 2020 and 3.3 in 2021.

I just checked my old mails and I was referred to their Sales Director through another channel. So it was not the support I was in direct contact with back then. But maybe you can share the mail address you found? I can see that a mailbox is listed in the iOS Flower Care app as [email protected], whatever that means.

I used the one listed under the “Flower Care” app in Google Play: [email protected]

@Sand Just a quick update. They are actually responding on the emails I sent and I do have a positive dialog with them.
It would probably not hurt if others with the same problem sent them an email, just to point out that this is a general problem.

1 Like

Sounds great. I just sent them a mail too. I also asked if they could add battery levels to the passive broadcasts.

1 Like

Hi,

Last resort for me :-(. I can’t seem to get a good connection with my flower sensors. I’ve got two of them. I was able to retrieve the MAC address of one of them, but it only let me read out the battery once and never updated since…

My Home Assistant setup:
Device: Macbook Pro Retina 2015
OS version: Mac OSx 11.1 (Big Sur)
Virtual Machine: Virtual Box 6.1.22
USB controller: TP-link UB400

I have bluetoothctl running and scanning and it finds one sensor just fine:
[CHG] Device C4:7C:8D:6C:C1:71

I’ve added this mac address to my configuration.yaml like the instructions describe (Mi Flora - Home Assistant):

sensor:
  - platform: miflora
    mac: C4:7C:8D:6C:C1:71
    name: XXX Plant
    force_update: true
    median: 3
    go_unavailable_timeout: 43200
    monitored_conditions:
      - moisture
      - light
      - temperature
      - conductivity
      - battery

This only gave back a battery reading back and never was able to update any of the other monitored conditions…

I set out to do some further investigation, like pairing and trusting below:

// Trusting is possible
[bluetooth]# trust C4:7C:8D:6C:C1:71
Changing C4:7C:8D:6C:C1:71 trust succeeded
...
// Service data is being received so it seems
[CHG] Device C4:7C:8D:6C:C1:71 ServiceData Key: 0000fe95-0000-1000-8000-00805f9b34fb
[CHG] Device C4:7C:8D:6C:C1:71 ServiceData Value:
71 20 98 00 41 71 c1 6c 8d 7c c4 0d 07 10 03 5f  q ..Aq.l.|....._
00 00
...
// Pairing seems to create an issue
[bluetooth]# pair C4:7C:8D:6C:C1:71
Attempting to pair with C4:7C:8D:6C:C1:71
Failed to pair: org.bluez.Error.AuthenticationFailed

Can anyone help me :pray:?

1 Like

Hi folks,

I just bought one MiFlora sensor for testing but it does not return values.

I used BLE mac seeker, added the correct one to the configuration, after restart I see the entities but they do not have values. Each entity also says that “the entity does not have unique ID”

Any ideas what’s wrong?

I see, I just added monitored conditions (all of them), so the default apparently does not work. Now I see the values.

1 Like

I’ve been fine-tuning my flower sensor setup for a few months and it’s now pretty stable. A few observations from my environment (ymmv etc.):

  1. ESPHome with ESP32s worked best for me - I use the stock Mija platform (my sensors are VegTrug branded, but it looks like these are all the same OEM sensor across brands)

  2. Proximity matters (alot) - I initially figured one ESP32 would be more than sufficient to monitor plants in every room but nope - sensors hang, HASS gripes, data enters ether. I suspect this setup is highly susceptible to interference, at least in my case - speakers/magnets, power supplies, pot material, etc. (observations based on tinkering with +/- results). For @mrpharderwijk and others with initial connect but no regular data cadence, I’m betting proximity between the sensor and your monitoring device is a likely culprit.

  3. If you roll with ESPHome, testing your setup on a cheap/cheerful ESP32 is fine, but I’d recommend going with a solid board from a trusted manufacturer for production. I’ve had the best luck with Adafruit’s Huzzah32 Featherboard, but the HiLetgo 32 gave me (gives me) fits. This is probably just an ESPHome tip tbh - my RadonEye sensor has the same issues losing data / falling off my ESP network on the cheaper boards.

  4. Once stable, I’ve found these sensors very useful for watering / feeding reminders. However, I do notice the same data bounces, usually in ‘humidity’ readings, that others have mentioned. I’ve also noticed my sensors pick up new humidity readings less frequently than the others, especially when the plant needs water (see Sam Sevieria’s reading below). Bottom line for me: if you’re looking for relative watering reminders, these things can be great; but if you’re setting up a high dollar / revenue-bearing grow or trying to gather detailed scientific data, these may not be the sensors you are looking for.

  5. I don’t get Battery readings in my setup - related threads note ESPHome stopped receiving these readings after some update a while ago, and I’m jelly if battery shows up in the native HASS add-on. I have taken to using the Flower Care app to occasionally check battery levels and update firmware - pair the sensor, check things out, delete the sensor (not sure the latter is required, but that’s what I do).

  6. I’m an Influx/Grafana fanboy - what a glorious rabbit hole for data nerds! Not hard to set up and well worth it imo - you’re gathering data, after all, so might as well add visuals to the mix. I also use native Lovelace guages and HASS’s Plant component for quick-hit dashboard status, but prefer Grafana for the detailed charts:

Lovelace:
image

Grafana:

2 Likes

would you share your esp config yaml?

Yeah sure ok to share whatever esp & ha.

I use the ESP setup which is discussed here.

In HA it looks like this

(yes, I need to water some plants :wink: )

The esp bluetooth - wifi router has the script (ESP 2021.10.3) like this:

# esp32 Wifi-Bluetooth router

substitutions:
  devicename: flora-wnkmr
  friendly_name: Flora Woonkamer
  
esphome:
  name: $devicename
  platform: ESP32
  board: esp32doit-devkit-v1

wifi:
  networks:
  - ssid: xyz-1
    password: !secret wifi_password
  - ssid: xyz-2
    password: !secret wifi_password

  ap:
    ssid: ${devicename}

captive_portal:

# Enable logging
logger:
  level: DEBUG

# Enable Home Assistant API
api:
  password: !secret api_password

# Enable Over the Air updates
ota:
  password: !secret ota_password

binary_sensor:

  - platform: status
    name: ${friendly_name} Status

text_sensor:

  - platform: wifi_info
    ip_address:
      name: ${friendly_name} IP Address
    mac_address:
      name: ${friendly_name} Mac Address
    ssid:
      name: ${friendly_name} Connected SSID

  - platform: version
    name: ${friendly_name} ESPHome Version

time:
  - platform: homeassistant
    id: homeassistant_time
    timezone: Europe/Amsterdam

web_server:

# End standard ESP settings

esp32_ble_tracker: 
  scan_parameters:
    interval: 320ms
    window: 200ms
    active: false
  
# status_led uit esphome: warning=slow blink, error=fast blink, normal=off
status_led:
  pin: GPIO2  
  
sensor:

  - platform: xiaomi_hhccjcy01
    mac_address: 80:ea:ca:89:4e:6f
    temperature:
      name: "Reserve 80:ea:ca:89:4e:6f Temperature"
    moisture:
      name: "Reserve 80:ea:ca:89:4e:6f Moisture"
    illuminance:
      name: "Reserve 80:ea:ca:89:4e:6f Illuminance"
    conductivity:
      name: "Reserve 80:ea:ca:89:4e:6f Conductivity"

  - platform: xiaomi_hhccjcy01
    mac_address: c4:7c:8d:6b:4f:44
    temperature:
      name: "Spathiphyllum Green Giant Temperature"
    moisture:
      name: "Spathiphyllum Green Giant Moisture"
    illuminance:
      name: "Spathiphyllum Green Giant Illuminance"
    conductivity:
      name: "Spathiphyllum Green Giant Conductivity"
      
  - platform: xiaomi_hhccjcy01
    mac_address: c4:7c:8d:6b:47:a3
    temperature:
      name: "Calathea Crocata Temperature"
    moisture:
      name: "Calathea Crocata Moisture"
    illuminance:
      name: "Calathea Crocata Illuminance"
    conductivity:
      name: "Calathea Crocata Conductivity"

  - platform: xiaomi_hhccjcy01
    mac_address: c4:7c:8d:6b:43:08
    temperature:
      name: "Epipremnum Aureum Temperature"
    moisture:
      name: "Epipremnum Aureum Moisture"
    illuminance:
      name: "Epipremnum Aureum Illuminance"
    conductivity:
      name: "Epipremnum Aureum Conductivity"      
      
  - platform: xiaomi_hhccjcy01
    mac_address: c4:7c:8d:6b:44:58
    temperature:
      name: "Monstera Temperature"
    moisture:
      name: "Monstera Moisture"
    illuminance:
      name: "Monstera Illuminance"
    conductivity:
      name: "Monstera Conductivity"     
      
  - platform: xiaomi_hhccjcy01
    mac_address: c4:7c:8d:6b:df:53
    temperature:
      name: "Dracaena Fragans Temperature"
    moisture:
      name: "Dracaena Fragans Moisture"
    illuminance:
      name: "Dracaena Fragans Illuminance"
    conductivity:
      name: "Dracaena Fragans Conductivity" 
 
  - platform: xiaomi_hhccjcy01
    mac_address: C4:7C:8D:6B:EC:12
    temperature:
     name: "Calathea Mix Temperature"
    moisture:
     name: "Calathea Mix Moisture"
    illuminance:
     name: "Calathea Mix Illuminance"
    conductivity:
     name: "Calathea Mix Conductivity" 
      

It’s running fine for over a year now.

A pity there is no battery level broadcast from the Mi-Flora’s, but batteries last 4-6 months and are easy, quick & cheap to change.

Hope this helps.

2 Likes

New firmware available - fixes “sensor-drop” problem in HA graphs.
I needed to fully synchronize all sensor data in app before beeing able to update/see new version.