dorkhub

homeassistant-plant

Alternative Plant component of home assistant

Olen
Python84451 forksGPL-3.0updated 1 day ago
git clone https://github.com/Olen/homeassistant-plant.gitOlen/homeassistant-plant

🌱 Plant Monitor for Home Assistant

HACS Custom GitHub Release

A comprehensive plant monitoring integration for Home Assistant that treats each plant as a device with its own sensors, thresholds, and health tracking. Automatically fetches species data from OpenPlantbook to configure optimal growing conditions.

Warning

This integration is not compatible with the original built-in plant integration in Home Assistant.


📑 Table of Contents


🌿 Overview

Each plant is a device in Home Assistant, grouping all its related entities together:

Plant device overview

Key features:

  • 🖥️ UI-based setup — guided multi-step config flow with optional OpenPlantbook search
  • 📊 Per-plant thresholds — each threshold is its own entity, adjustable from the UI or via automations
  • 🌤️ Daily Light Integral — automatic DLI calculation from illuminance sensors
  • 💧 Vapour Pressure Deficit — automatic VPD calculation from temperature + humidity
  • 🔄 Live updates — change sensors, thresholds, species, or images without restarting HA
  • 🚨 Problem detection — configurable per-sensor problem triggers
  • 🔌 Auto-disable — sensors without a source entity are automatically disabled

📦 Installation

1. Install OpenPlantbook (optional but recommended)

The OpenPlantbook integration automatically fetches species data, thresholds, and images. Without it, you must set all thresholds manually.

  • Install from HACS or manually
  • Register at open.plantbook.io (free)
  • Add your client_id and secret in the integration config
  • Test with the openplantbook.search action

2. Install the Flower Card (optional)

Lovelace Flower Card v2 is the recommended card for displaying plant data. Install via HACS or manually.

3. Install Plant Monitor

Via HACS

  1. Add this repo as a Custom Repository with type Integration
  2. Click Install in the "Home Assistant Plant" integration
  3. Restart Home Assistant

Manual Installation

  1. Copy custom_components/plant/ to your <config>/custom_components/ directory
  2. Restart Home Assistant

After restart, add plants via SettingsDevices & ServicesAdd IntegrationPlant Monitor.


🔧 Setup & Configuration

The config flow guides you through plant setup in four steps:

Step 1: Name & Species

Enter a name for your plant. Optionally enter a species to search OpenPlantbook.

  • If OpenPlantbook is installed and a species is entered, the flow proceeds to species selection
  • If no species is entered (or OpenPlantbook is not installed), the flow skips to sensor selection

Step 2: Select Species (OpenPlantbook only)

If OpenPlantbook found matches, select the correct species from a dropdown list. You can also re-search with a different term if the initial results aren't right.

If the wrong species was selected, you can go back and search again.

Step 3: Select Sensors

Choose which physical sensors to associate with your plant. All sensors are optional and can be added or changed later. Available sensor types:

Sensor Device Class Description
🌡️ Temperature temperature Air temperature
💧 Soil moisture moisture Soil water content
⚡ Conductivity conductivity Soil nutrient level
☀️ Illuminance illuminance Light level
💨 Air humidity humidity Air moisture
🫧 CO2 carbon_dioxide CO2 concentration
🌡️ Soil temperature temperature Soil temperature

Tip

Sensors without a source entity are automatically disabled. You can add or replace sensors at any time after setup.

Step 4: Set Limits

Configure min/max thresholds for each sensor type. If OpenPlantbook data is available, thresholds are pre-filled automatically. Only thresholds for sensor types selected in the previous step are shown (if no sensors were selected, all thresholds are displayed).

You can also set a custom image URL and display species name on this page.


🌡️ Sensors & Thresholds

All thresholds are their own entities and can be changed from the UI or by automations and scripts. Changes take effect immediately — no restart needed.

Threshold entities Threshold config

  • 🌡️ Max/min temperature adapts to your HA unit of measurement (°C or °F)
  • Threshold values update automatically if you change your HA temperature units

☀️ Daily Light Integral (DLI)

A Daily Light Integral sensor is automatically created for each plant, measuring the total photosynthetically active light received per day.

DLI sensor

See Wikipedia: Daily Light Integral for background.

Configurable Lux-to-PPFD Conversion

The DLI calculation converts illuminance (lux) to PPFD. The default factor (0.0185) is optimized for sunlight, but different light sources need different factors. Adjust it per plant using the Lux to PPFD factor entity.

For technical details on the DLI calculation pipeline, conversion factors, troubleshooting low readings, and the optional rolling 24-hour sensor, see DLI.md.


💧 Vapour Pressure Deficit (VPD)

A VPD sensor is automatically created when a plant has both a temperature and humidity sensor configured. VPD measures the "drying power" of the air — how aggressively it pulls moisture from leaf surfaces. It is calculated using the Tetens formula:

SVP = 0.6108 × e^((17.27 × T) / (T + 237.3))
VPD = SVP × (1 - RH / 100)

Default Thresholds

Threshold Default Meaning
Minimum 0.4 kPa Below this the air is too humid — risk of fungal disease
Maximum 1.6 kPa Above this plants may close stomata and stop growing

Practical Considerations

Note

VPD is primarily useful for greenhouses and controlled growing environments. The default thresholds come from agricultural science where humidity is actively managed (typically 50–80% RH).

A typical heated indoor environment — especially in winter — often has humidity around 20–35%, which produces VPD values of 1.5–2.5 kPa. This is genuinely stressful for most plants (it's why greenhouses exist), but it is also completely normal for a living room. Most houseplants tolerate it, even if it's not optimal.

For this reason, the VPD problem trigger is disabled by default. You can enable it in the plant's options if you want VPD to affect the plant's ok/problem state — this is most useful if you are actively managing humidity (e.g. in a greenhouse, grow tent, or terrarium).

Enabling VPD Problem Trigger

  1. Go to Settings → Devices & Services → Plant Monitor
  2. Select your plant
  3. Click Configure → Plant properties
  4. Enable "Use VPD as problem trigger"

🖼️ Plant Images

The plant image can be set in several ways:

From OpenPlantbook (automatic)

If the species is found in OpenPlantbook, the image URL is fetched automatically. The integration validates that the URL is accessible before using it. If the OpenPlantbook integration is configured to download images, the downloaded files are stored in config/www/images/plants/ by default and referenced as /local/images/plants/.

Custom Images

You can override the image with your own. Supported formats:

Format Example
HTTP/HTTPS URL https://example.com/my-plant.jpg
Local /www/ folder /local/images/plants/my-plant.jpg (file at config/www/images/plants/my-plant.jpg)
Media Source media-source://media_source/local/plants/my-plant.jpg

Note

  • Paths are case-sensitive — the filename must match exactly
  • Only media_source/local/ is supported for media source URLs
  • Media source URLs require a compatible Lovelace card (like the Flower Card)

⚠️ Problem Reports

By default, any sensor reading outside its configured threshold triggers a "problem" state on the plant. You can enable or disable problem triggers per sensor type.

Configure via SettingsDevices & ServicesPlant MonitorYour PlantConfigurePlant properties.

Note

Disabling a trigger only removes that sensor from the plant's ok/problem calculation — it does not stop the sensor being evaluated. Each *_status attribute (e.g. illuminance_status: Low) always reflects the latest reading against the plant's thresholds regardless of its trigger, and is null only when no value is available (sensor missing or unavailable). Use the problems attribute — which lists only sensors that are out of range and have their trigger enabled — as the source of truth for active problems.

Hysteresis

All threshold checks include a hysteresis band equal to 5% of the threshold being crossed (capped so it never exceeds 5% of the min–max range). This prevents rapid flapping between OK and PROBLEM when a sensor value hovers near a threshold.

A plant enters PROBLEM when a value crosses a threshold, but does not return to OK until the value clears that threshold by the band amount. For example, with moisture min=20 (band = 20 × 5% = 1.0):

  • Moisture drops below 20% — enters PROBLEM
  • Moisture rises to 20.5% — stays in PROBLEM (not yet past min + band = 21%)
  • Moisture rises to 22% — clears to OK

The band is relative to each threshold, so the margin stays proportional whether a value is near the min or the max. No configuration is needed — hysteresis is always active.

Note

When a sensor becomes unavailable, the hysteresis state resets. The next valid reading is evaluated fresh against the thresholds.


🔔 Automations: Triggers & Conditions

Home Assistant 2026.7+. That release introduced purpose-specific triggers and conditions — reusable automation building blocks that an integration registers under its own domain. Plant Monitor teaches Home Assistant a set of plant.* triggers and conditions built directly on the status and problem detection described above. They appear automatically once you're on HA 2026.7 or later; on older supported versions (2025.8+) nothing changes and nothing is registered.

Core Home Assistant ships generic purpose triggers too, like temperature.crossed_threshold — but you have to type in the number yourself. The plant.* per-measurement triggers instead fire off the plant's own status, which this integration already computes from the species-configured min/max with hysteresis (see above). There's no threshold to enter, and nothing to keep in sync with the plant's dashboard.

The trigger & condition families

  • Whole-plant: plant.problem_detected / plant.problem_cleared — the plant entered / left a problem state. Condition: plant.has_problem.

  • Per-measurement status: plant.<measurement>_became_low / _became_high / _became_ok, for moisture, conductivity, temperature, soil_temperature, humidity, illuminance, co2, dli, vpd. Conditions: plant.<measurement>_is_low / _is_high / _is_ok.

  • Stale source sensor: plant.<measurement>_sensor_became_stale / _became_fresh, for the externally-sourced measurements only — moisture, conductivity, temperature, soil_temperature, humidity, illuminance, co2 (not dli/vpd, which are derived rather than sensor-backed). Condition: plant.<measurement>_sensor_is_stale.

    "Stale" means the source sensor is unavailable/unknown, or simply hasn't updated within a window (for, default 24 hours). A grace period means it does not false-alarm at restart, when a sensor briefly reads unknown before its own integration populates it — staleness only fires once the source is genuinely still dead after the full window elapses.

Targeting

Every trigger and condition targets the plant entity — you pick which plant, nothing else. For the stale family, the integration resolves that measurement's configured external source sensor itself; you never reference the sensor directly.

Examples

# Notify when a plant's moisture drops below its configured minimum
triggers:
  - trigger: plant.moisture_became_low
    target:
      entity_id: plant.my_fern
actions:
  - action: notify.mobile_app_phone
    data:
      message: "My Fern needs water"
# Do something whenever a plant enters a problem state
triggers:
  - trigger: plant.problem_detected
    target:
      entity_id: plant.my_fern
actions:
  - action: light.turn_on
    target:
      entity_id: light.plant_shelf
    data:
      color_name: red
# Alert if the source sensor feeding a plant's temperature has gone stale for 6 hours
triggers:
  - trigger: plant.temperature_sensor_became_stale
    target:
      entity_id: plant.my_fern
    options:
      for:
        hours: 6
actions:
  - action: notify.mobile_app_phone
    data:
      message: "{{ trigger.entity_id }} hasn't reported in 6 hours"

Note

For measurements whose source sensor carries a standard Home Assistant device class (temperature, humidity, illuminance, soil temperature), Home Assistant's own generic temperature.* / humidity.* / illuminance.* purpose triggers also apply to that sensor — and their crossed_threshold form can optionally read the limit from the plant's published number.<plant>_min_* / _max_* entities. The plant.* triggers above need no such wiring.


🔄 Replacing Sensors

You can replace the physical sensor backing a plant measurement at any time — no restart needed.

From the Configuration menu (recommended)

  1. Go to SettingsDevices & ServicesPlant MonitorYour PlantConfigure
  2. Select Replace sensors
  3. Change the sensor entity for any sensor type, or clear a field to remove it
image image

Using the plant.replace_sensor action

You can also use the plant.replace_sensor action directly via Developer ToolsActions:

Replace sensor

action: plant.replace_sensor
data:
  meter_entity: sensor.rose_illumination
  new_sensor: sensor.ble_sensor_12_illumination

To remove a sensor, call the action with an empty new_sensor.

Tip

Use generic entity IDs for physical sensors (e.g. sensor.ble_sensor_1_moisture) and descriptive IDs for plant sensors (e.g. sensor.rose_moisture). This makes it easy to swap hardware without confusion.

Adding a sensor to an existing plant

If you set up a plant without a particular sensor (e.g. you didn't have a CO2 or humidity sensor at the time), that plant sensor entity is automatically disabled. To add the sensor later:

  1. Go to your plant's device page
  2. Find the disabled sensor entity (e.g. "CO2") and enable it
  3. Use ConfigureReplace sensors to assign your physical sensor, or use the plant.replace_sensor action

Important

You must enable the plant sensor entity before replacing it — Home Assistant hides disabled entities from the entity picker in the UI.


🌻 OpenPlantbook Integration

Requires the OpenPlantbook integration to be installed.

During Setup

When adding a new plant, the config flow searches OpenPlantbook for the species you enter. Matching species are displayed in a dropdown. The selected species' thresholds and image are pre-filled in the limits step.

Note

The OpenPlantbook API does not include your private user-defined species in search results. See "Force Refresh" below for how to fetch data for private species.

Changing Species / Refreshing Data

Go to SettingsDevices & ServicesPlant MonitorYour PlantConfigurePlant properties.

  • Change species: Enter the new species exactly as the pid in OpenPlantbook (including punctuation). New thresholds and image are fetched automatically.
  • Force refresh: Check this box to re-fetch data from OpenPlantbook without changing the species. Useful for private species not found during initial search. When checked, both the image and display species name are updated.

Note

If the current image points to a local file or non-OpenPlantbook URL, it is not replaced unless "Force refresh" is checked.

🪴 Care Guidance (OpenPlantbook)

When OpenPlantbook has care information for a species, the plant device exposes it as free-text attributes you can show on a dashboard or use in automations and templates. Only the fields OpenPlantbook provides for a given species appear:

  • care_watering
  • care_sunlight
  • care_soil
  • care_pruning
  • care_fertilization

Note

Care guidance is fetched together with the species data, so existing plants only get it after a refresh — use Force refresh (above) or change the species. Newly added plants get it automatically.


🃏 Lovelace Card

The Lovelace Flower Card is designed to work with this integration.

Flower card light Flower card dark

The card supports both °C and °F:

Temperature units


💡 Tips & Tricks

Important

A sensor doesn't show up in a dropdown? This is the most common problem, and it's almost always a missing device_class on the source integration (often Zigbee2MQTT or BLE) — not a Plant Monitor bug. Please report it to that integration (the only permanent fix); local workarounds are in MISSING_SENSORS.md.

For other practical tips, template examples, and workarounds — auto-watering, problem notifications, battery/stuck sensor monitoring — see TIPS.md.


❓ FAQ

I added the wrong sensors — after removing and re-adding the plant, old values still show

Home Assistant remembers old entity configurations. Instead of removing and re-adding a plant, use ConfigureReplace sensors (or the plant.replace_sensor action) to swap sensors. See Replacing Sensors.

A sensor is missing from the dropdown (e.g. conductivity, moisture, humidity)

The dropdowns filter by device_class, and some integrations (often Zigbee2MQTT or BLE sensors) create the entity without one — so it isn't listed.

The permanent fix is upstream: report the missing device_class/state_class to the integration that owns the sensor (e.g. Zigbee2MQTT). Once fixed there, the sensor appears automatically — for you and everyone else with that device. Plant Monitor deliberately does not work around missing device classes.

Local workarounds (Zigbee2MQTT devices.yaml override, customize.yaml, a template sensor, or plant.replace_sensor) are documented in MISSING_SENSORS.md.

My local image path doesn't work

Local images must be in your HA www folder, referenced with the /local/ prefix. The path is case-sensitive.

Path Works?
/local/images/plants/my-plant.jpg ✅ (file at config/www/images/plants/my-plant.jpg)
/local/images/plants/My-Plant.jpg (wrong case)
/mnt/nas/photos/plant.jpg (filesystem path)
file:///config/www/images/plants/my-plant.jpg (file URI)

You can also use media-source:// URLs. See Plant Images.

Can the integration monitor sensor battery levels or detect dead sensors?

The integration monitors plant readings, not sensor hardware. For battery monitoring, see Home Assistant's official tutorial: Get notified when a device needs a new battery. For detecting stuck sensors (no value change in 24+ hours), see the Battery Monitoring & Stuck Sensors section in TIPS.md.

I removed a sensor but it comes back after restart

When you remove a sensor using ConfigureReplace sensors (or plant.replace_sensor with an empty new_sensor), the change is persisted to the configuration. If sensors reappear, update to the latest release.


☕ Support

If you find this integration useful, consider buying me a coffee:

more like this

PowerDisplayESPHome

A small display for ESPHome and Home Assistant to retrieve the current house consumption and energy price via a sensor…

C++52

search

search projects, people, and tags