A Smart Greenhouse with Home Assistant – From Plant Sensors to Automation

A Smart Greenhouse with Home Assistant – From Plant Sensors to Automation

Turn your Xiaomi MiFlora sensors into a smart greenhouse monitoring system using Home Assistant, ESPHome Bluetooth Proxy and a little automation.

Advertisements

December 5 is World Soil Day, which makes it a good opportunity to look at something a little different in the smart home world.

Not another motion sensor. Not another smart light. And definitely not another dashboard showing the temperature in every room of the house.

This time, we’re heading into the greenhouse.

Whether you have a greenhouse, a winter garden, a conservatory or simply a collection of indoor plants, Home Assistant can help you keep an eye on growing conditions.

And if you already own a few Xiaomi MiFlora sensors, you might have most of the hardware you need.

The interesting part is that we don’t need to build a complicated sensor platform. We can use Home Assistant’s built-in Xiaomi BLE integration and a few ESP32 Bluetooth proxies to collect the data.

Let’s put those plant sensors to work!

1. Meet the Xiaomi MiFlora

The Xiaomi MiFlora, model HHCCJCY01, is a small Bluetooth Low Energy plant sensor designed to monitor growing conditions.

It measures four useful parameters:

  • Soil moisture: Helps you understand when plants need watering.
  • Temperature: Measures temperature around the sensor, usually in the soil.
  • Illuminance: Measures the amount of light reaching the sensor.
  • Soil conductivity: Provides an indication of dissolved salts in the growing medium.

These measurements give us a surprisingly useful overview of what’s happening around our plants.

The MiFlora has been around for several years, and I’ve previously covered both the ESP32 integration and general plant monitoring with Home Assistant.

If you’re interested in the earlier approaches, have a look at these articles:

This time, we’re taking a slightly different approach.

Instead of configuring every sensor individually through ESPHome, we’ll let Home Assistant handle the Xiaomi BLE integration.

Advertisements

2. Extend Bluetooth Coverage with ESPHome

One of the challenges with Bluetooth sensors is range.

Your Home Assistant server might be located in a utility room, while your greenhouse is at the other end of the house.

That’s where ESPHome Bluetooth Proxy comes in.

An inexpensive ESP32 board can act as a Bluetooth proxy, receiving Bluetooth advertisements from nearby devices and forwarding them over your Wi-Fi network to Home Assistant.

The architecture is simple:

  1. Xiaomi MiFlora broadcasts its sensor measurements over Bluetooth.
  2. An ESP32 Bluetooth Proxy receives the broadcasts.
  3. ESPHome forwards the information to Home Assistant.
  4. The Xiaomi BLE integration processes the data and creates sensor entities.

You can install several Bluetooth proxies around your property to improve coverage.

For example, one near the greenhouse, another in the living room and perhaps one in the garage.

The nice thing is that the ESP32 doesn’t need to know anything about the individual MiFlora sensors.

It’s simply extending Bluetooth coverage.

Setting up a Bluetooth Proxy

If you already use ESPHome, setting up a Bluetooth Proxy is straightforward.

A minimal configuration looks like this:

esphome:
  name: greenhouse-bluetooth-proxy
  friendly_name: Greenhouse Bluetooth Proxy

esp32:
  board: esp32dev
  framework:
    type: esp-idf

logger:

api:

ota:
  - platform: esphome

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

esp32_ble_tracker:

bluetooth_proxy:

This is a basic example for a compatible ESP32 development board. Board definitions and framework support should be checked for your particular hardware.

Once the device is running and connected to Home Assistant, it should appear as a Bluetooth adapter in the Bluetooth integration.

I recommend leaving the Bluetooth scanning mode on Auto, which is the recommended setting for most installations.

You can find the available proxies under:

Settings → Connectivity → Bluetooth

The Bluetooth network overview is also useful when troubleshooting coverage or checking which proxy receives a particular sensor.

One small limitation worth knowing: ESPHome Bluetooth Proxy supports a maximum of three simultaneous active connections per proxy. For MiFlora, most measurements are broadcast passively, so this is generally not a major concern.

3. Connect Your MiFlora Sensors to Home Assistant

With Bluetooth coverage in place, we can add the Xiaomi BLE integration.

Navigate to:

Settings → Devices & services → Add Integration → Xiaomi BLE

That’s essentially it.

The integration listens for Bluetooth advertisements and automatically discovers supported devices.

Your MiFlora sensors should appear as Home Assistant receives their measurements.

There is one important firmware detail.

The Home Assistant documentation identifies firmware version 3.2.1 as the lowest confirmed working version for the HHCCJCY01.

If your sensor isn’t discovered, check its firmware using the official Flower Care app. An update might be necessary.

Once the sensor is discovered, you’ll typically get entities for:

  • Soil moisture.
  • Temperature.
  • Illuminance.
  • Conductivity.
  • Battery level, when available.

The battery level works slightly differently from the other measurements. Home Assistant needs to establish an active Bluetooth connection to retrieve it, so it checks periodically rather than continuously to conserve battery.

This is also why a Bluetooth proxy with active connection support is useful.

A note about sensor placement: Keep the sensor properly positioned in the growing medium, and remember that the illuminance measurement is taken where the sensor itself is located. It isn’t necessarily a perfect measurement of the light available to the entire plant.

4. Monitor Multiple Plants and Growing Areas

Here’s where things become interesting.

Instead of monitoring one plant, we can use several MiFlora sensors to monitor different areas of a greenhouse or winter garden.

For example:

SensorLocationWhat to monitor
MiFlora 1Tomato bedMoisture and conductivity
MiFlora 2Herb sectionMoisture and temperature
MiFlora 3Indoor plantsMoisture and light
MiFlora 4Raised bedMoisture and temperature

The actual sensor names will depend on how Home Assistant discovers and identifies your devices.

I recommend renaming each device and its entities to something meaningful.

For example:

sensor.greenhouse_tomatoes_moisture

is considerably easier to understand than:

sensor.hhccjcy01_123456_moisture

Once everything has sensible names, you can create a dedicated greenhouse dashboard.

You can also reuse the Home Assistant Plant integration from my earlier article if you want to create individual plant status entities with thresholds for moisture, conductivity and other measurements.

This is where the two approaches complement each other nicely.

The MiFlora sensors provide the measurements, while Home Assistant helps interpret them.

5. Create Useful Notifications

Monitoring is great, but the real benefit comes when Home Assistant tells us when something needs attention.

Let’s start with a simple example.

Imagine that the soil moisture in your tomato bed drops below 25%.

Rather than checking the dashboard every morning, Home Assistant can send a notification.

alias: Greenhouse - Soil Moisture Warning
description: Notify when the soil gets too dry
triggers:
  - trigger: numeric_state
    entity_id: sensor.greenhouse_tomatoes_moisture
    below: 25
    for:
      minutes: 30

actions:
  - action: notify.mobile_app_your_phone
    data:
      title: "Greenhouse warning"
      message: "The tomato bed is getting dry. Time to check the plants!"

mode: single

The threshold is only an example. Different plants and growing mediums require different moisture levels.

You could create separate thresholds for each growing area.

Another useful notification is a temperature warning.

Remember, though, that the MiFlora measures temperature around the probe. For reliable frost protection, use a separate air temperature sensor positioned where it can measure the greenhouse environment accurately.

6. Add Automatic Watering

Now we’re moving from monitoring to actual automation.

A simple irrigation system can be built using a small water pump, tubing and a suitable relay or smart switch.

Home Assistant can then activate the pump when the soil becomes too dry.

However, I would avoid immediately building a system that waters every time a sensor reports a low value.

A better approach is to introduce a few safeguards:

  • Only water when the soil has been dry for a while.
  • Limit how long the pump can run.
  • Check that the water reservoir isn’t empty.
  • Prevent repeated watering while the moisture remains low.
  • Make sure the pump switches off even if something goes wrong.

Here’s a simplified example:

alias: Greenhouse - Automatic Watering
description: Water plants when soil moisture is low
triggers:
  - trigger: numeric_state
    entity_id: sensor.greenhouse_tomatoes_moisture
    below: 25
    for:
      minutes: 30

conditions:
  - condition: numeric_state
    entity_id: sensor.greenhouse_water_level
    above: 20

actions:
  - action: switch.turn_on
    target:
      entity_id: switch.greenhouse_water_pump

  - delay:
      seconds: 10

  - action: switch.turn_off
    target:
      entity_id: switch.greenhouse_water_pump

mode: single

This example assumes you have a water-level sensor and a pump switch.

It also assumes that ten seconds of pumping is an appropriate amount of water for your setup. You’ll need to calibrate this yourself.

For a more reliable installation, I would use a separate maximum-runtime protection, pump failure detection and a mechanism that prevents watering again until the soil has been checked.

Also, don’t forget that soil conductivity isn’t a direct measurement of fertilizer requirements. It can help identify changes in the growing medium, but interpretation depends on the plant, substrate and watering conditions.

And please remember that electrical equipment and water need appropriate protection and installation.

7. Build a Greenhouse Dashboard

A dedicated dashboard is a great way to bring everything together.

I’d keep it simple and focus on the information that actually matters.

For example:

MeasurementGreenhouse
Soil moisture32%
Soil temperature8.4°C
Light level2,450 lx
Conductivity650 µS/cm
Air temperature6.8°C
Air humidity78%

The numbers above are illustrative, not recommended growing targets.

Notice that I’ve included air temperature and humidity separately.

These measurements require an additional environmental sensor, such as an ESPHome or Zigbee sensor.

That gives us a much better picture of the greenhouse environment than relying on the MiFlora alone.

I’d also include:

  • Historical moisture graphs.
  • A notification indicator for dry plants.
  • Water reservoir level.
  • Pump status.
  • Greenhouse air temperature.
  • Ventilation status.

With historical data, you can start identifying patterns.

Perhaps one part of the greenhouse dries out much faster than another.

Perhaps light levels are too low during winter.

Or perhaps the temperature drops much more quickly than expected after sunset.

These are exactly the kinds of things that make smart home monitoring useful.

8. Start Small and Expand

You don’t need to automate an entire greenhouse on day one.

I’d start with a single MiFlora sensor and an ESP32 Bluetooth Proxy.

Get the sensor working, verify that Home Assistant receives its measurements, and then add more sensors as needed.

Once you have a few weeks of historical data, you’ll have a much better understanding of the conditions in your greenhouse.

Then you can start adding notifications, ventilation and eventually automatic watering.

And because everything is connected through Home Assistant, you can expand the setup without having to redesign the entire system.

Final Thoughts: Give Your Plants a Smarter Home

The Xiaomi MiFlora is a good example of how older smart home hardware can remain useful.

You don’t need to replace perfectly good sensors or build a complicated ESP32 measurement system.

With Home Assistant’s built-in Xiaomi BLE integration and a few ESPHome Bluetooth Proxies, you can build a flexible monitoring system for your greenhouse, winter garden or indoor plants.

The sensors collect the data.

Home Assistant makes sense of it.

And you get to spend less time wondering whether your plants need water.

Of course, Home Assistant still can’t stop you from buying another plant.

But at least now you’ll know exactly how thirsty it is.

Happy gardening!


Some of the links in this article are "affiliate links", a link with a special tracking code. This means if you click on an affiliate link and purchase the item, we will receive an affiliate commission. The price of the item is the same whether it is an affiliate link or not. Regardless, we only recommend products or services we believe will add value to our readers. By using the affiliate links, you are helping support our Website, and we genuinely appreciate your support.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.