Skip to content

About

Integration to search and fetch data from Openplantbook.io

Topics

Resources

Contributing

Stars

574 stars

Watchers

7 watching

Forks

Repository files navigation

🌿 OpenPlantbook Integration for Home Assistant

HACS Custom GitHub Release

Connects Home Assistant to the OpenPlantbook API for searching plant species, fetching care data, and uploading sensor readings. Used as the data backend for the Plant Monitor integration. To set up plant monitoring and tracking of your plant related sensors, you need to install that integration.


πŸ“‘ Table of Contents


πŸ“¦ Installation

Via the Marketplace (recommended)

OpenPlantbook is in the default catalog of the Marketplace (HACS before Home Assistant 2026.11).

Open your Home Assistant instance and open this repository in the Marketplace.

  1. Select the button above, or open Settings β†’ Marketplace (HACS before 2026.11) and search for "OpenPlantbook"
  2. Click Install (Download in HACS)
  3. Restart Home Assistant

Note

Until November 2026 the catalog listed a fork of this repository, slaxor505/home-assistant-openplantbook. If you installed the fork, uninstall it in the Marketplace (or HACS), install this repository, and restart. Both use the domain openplantbook, so your OpenPlantbook configuration is kept.

Manual Installation

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

πŸ”§ Setup

You need an OpenPlantbook account (free) with API credentials.

  1. Register at open.plantbook.io
  2. Find your client_id and secret at https://open.plantbook.io/apikey/show/
  3. In Home Assistant: Settings β†’ Devices & Services β†’ Add Integration β†’ OpenPlantbook
  4. Enter your credentials β€” the integration validates them and shows an error if incorrect
  5. Configure upload settings (optional but recommended)

βš™οΈ Configuration Options

After setup, click Configure on the integration card to access additional options.

Configuration options

πŸ“€ Upload Plant Sensor Data

Note

All data is shared anonymously.

When enabled, the integration periodically (once a day) uploads sensor data from your plants to OpenPlantbook. This helps build a useful community dataset. More info: https://open.plantbook.io/ui/sensor-data/

  • First upload: last 24 hours of data
  • If sensors are disconnected, it retries daily for up to 7 days of historical data
  • Can also be triggered manually via the openplantbook.upload action
  • Daily uploads are scheduled at a randomized time-of-day per installation (stable for a given config entry) to even load distribution

Upload health

Three diagnostic entities on the OpenPlantbook device show how uploads are going:

  • Upload problem (binary sensor): on while uploads need attention - the latest upload failed or hit the rate limit, no data has reached OpenPlantbook for 3 days, or a plant cannot be registered. Its attributes say why (reason: failed, rate_limited, overdue or plants_failed) and list the plants that cannot be registered. A plant stays on that list until it registers again. The sensor is unavailable while uploading is off.
  • Upload status: how the latest run went - uploaded, nothing_new, failed, rate_limited, or disabled when uploading is off - with the time of the run, the plants that could not be registered, and the error.
  • Last upload: when data last reached OpenPlantbook, from a successful run or from OpenPlantbook's own record.

On Home Assistant 2026.7 or later there are triggers for automations: openplantbook.upload_problem_started and openplantbook.upload_problem_cleared, which fire when Upload problem turns on and off. On older versions, use a state trigger on that sensor.

The triggers fire when the sensor changes from off to on (or back). A problem that begins while Home Assistant is down, or that is already there when you turn uploading back on, shows on the sensor but does not fire them. To be told about it after a restart, check the sensor when Home Assistant starts:

triggers:
  - trigger: homeassistant
    event: start
conditions:
  - condition: state
    entity_id: binary_sensor.openplantbook_upload_problem
    state: "on"
actions:
  - action: notify.mobile_app_phone
    data:
      message: "OpenPlantbook uploads need attention"

The OpenPlantbook upload problem blueprint uses both - pick what should happen, such as a notification: Import blueprint

🌍 Share Location

Optionally share your Home Assistant location to complement sensor data. Two levels:

Option What is shared
Country only Country from HA configuration
Coordinates Lat/lon from HA configuration

Location is configured in HA under Settings β†’ System β†’ General.

Location settings

Tip

Enable DEBUG logging for the integration to see exactly what data is being shared.

Debug logging

🌐 International Common Names

When enabled, the integration sends your Home Assistant language to OpenPlantbook so the API can return common names in that language when available.

More information about this OpenPlantbook feature.

πŸ–ΌοΈ Automatically Download Images

Available in the integration's Options (click Configure after setup).

  • Default path: /config/www/images/plants
  • Specify any directory the HA user has write access to
  • Relative paths are relative to your config directory

Path behavior:

  • If the path contains www/ β†’ image_url is replaced with a /local/ reference
  • If the path does not contain www/ β†’ the full OpenPlantbook URL is kept

Note

Existing files are never overwritten. The target directory must exist before configuring.


πŸ“‘ Actions (Service Calls)

openplantbook.search

Search for plants matching a string:

action: openplantbook.search
data:
  alias: Capsicum

Read results from openplantbook.search_result:

Number of plants found: {{ states('openplantbook.search_result') }}
{%- for pid in states.openplantbook.search_result.attributes %}
  {%- set name = state_attr('openplantbook.search_result', pid) %}
  * {{ pid }} -> {{ name }}
{%- endfor %}

Example output:

Number of plants found: 40
  * capsicum annuum -> Capsicum annuum
  * capsicum baccatum -> Capsicum baccatum
  * capsicum chinense -> Capsicum chinense
  (...)

openplantbook.get

Get detailed data for a single species:

action: openplantbook.get
data:
  species: capsicum annuum

Note

The species string must match exactly the pid returned by openplantbook.search.

Extra data categories

Request additional categories with the optional include parameter (comma-separated). Currently the API supports care, which adds watering, sunlight, soil, pruning, and fertilization:

action: openplantbook.get
data:
  species: monstera deliciosa
  include: care

The extra fields are merged into the same entity and returned in the service response. Cached entries remember which categories they already contain, so requesting care for a plant that was previously fetched without it triggers a fresh API call.

After an include: care call, the care fields are available as attributes on the entity:

* Watering: {{ state_attr('openplantbook.monstera_deliciosa', 'watering') }}
* Sunlight: {{ state_attr('openplantbook.monstera_deliciosa', 'sunlight') }}
* Soil: {{ state_attr('openplantbook.monstera_deliciosa', 'soil') }}
* Pruning: {{ state_attr('openplantbook.monstera_deliciosa', 'pruning') }}
* Fertilization: {{ state_attr('openplantbook.monstera_deliciosa', 'fertilization') }}

Read results from openplantbook.capsicum_annuum:

Details for plant {{ states('openplantbook.capsicum_annuum') }}
* Max moisture: {{ state_attr('openplantbook.capsicum_annuum', 'max_soil_moist') }}
* Min moisture: {{ state_attr('openplantbook.capsicum_annuum', 'min_soil_moist') }}
* Max temperature: {{ state_attr('openplantbook.capsicum_annuum', 'max_temp') }}
* Image: {{ state_attr('openplantbook.capsicum_annuum', 'image_url') }}

openplantbook.upload

Manually trigger uploading of plant sensor data:

action: openplantbook.upload

Returns null if nothing was uploaded or an error occurred. Check the HA log for details.


πŸ–₯️ GUI Example

An example of using the actions to build a plant search UI in Home Assistant:

OpenPlantbook GUI

Note

This UI is not part of the integration β€” it's an example of what you can build with the actions.

For a full walkthrough with helpers, automations, and Lovelace cards, see examples/GUI.md.


β˜• Support

About

Integration to search and fetch data from Openplantbook.io

Topics

Resources

Contributing

Stars

574 stars

Watchers

7 watching

Forks

Releases

Packages

Used by

Contributors

Languages