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.
- Add this repo as a Custom Repository with type Integration
- Click Download in the "OpenPlantbook" card in HACS
- Restart Home Assistant
- Copy
custom_components/openplantbook/to your<config>/custom_components/directory - Restart Home Assistant
You need an OpenPlantbook account (free) with API credentials.
- Register at open.plantbook.io
- Find your
client_idandsecretat https://open.plantbook.io/apikey/show/ - In Home Assistant: Settings β Devices & Services β Add Integration β OpenPlantbook
- Enter your credentials β the integration validates them and shows an error if incorrect
- Configure upload settings (optional but recommended)
After setup, click Configure on the integration card to access additional options.
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.uploadaction - Daily uploads are scheduled at a randomized time-of-day per installation (stable for a given config entry) to even load distribution
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.
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.
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_urlis 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.
Search for plants matching a string:
action: openplantbook.search
data:
alias: CapsicumRead 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
(...)
Get detailed data for a single species:
action: openplantbook.get
data:
species: capsicum annuumNote
The species string must match exactly the pid returned by openplantbook.search.
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') }}Manually trigger uploading of plant sensor data:
action: openplantbook.uploadReturns null if nothing was uploaded or an error occurred. Check the HA log for details.
An example of using the actions to build a plant search UI in Home Assistant:
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.



