Build a simple plant search interface in Home Assistant using OpenPlantbook actions, helpers, and Lovelace cards.
Note
This UI is not part of the integration — it's an example of what you can build with the OpenPlantbook actions.
Create these helpers to store search results and trigger the automations. You can create them via YAML or in the UI under Settings → Devices & Services → Helpers.
input_text:
openplantbook_search:
name: Search OpenPlantbookinput_select:
openplantbook_searchresults:
name: Openplantbook Search Results
options:
- "Search first"input_button:
openplantbook_clear_cache:
name: Clear Openplantbook CacheThese automations wire the helpers to the OpenPlantbook actions.
Triggers a search whenever the search field is updated:
alias: Search Openplantbook
triggers:
- trigger: state
entity_id: input_text.openplantbook_search
actions:
- action: openplantbook.search
data:
alias: "{{ states('input_text.openplantbook_search') }}"Fills the dropdown when search results arrive:
alias: Populate Openplantbook Dropdown
triggers:
- trigger: state
entity_id: openplantbook.search_result
actions:
- action: input_select.set_options
data:
entity_id: input_select.openplantbook_searchresults
options: |
{% if states('openplantbook.search_result') | int(default=0) > 0 %}
{{ states.openplantbook.search_result.attributes | list }}
{% else %}
[ "No plants found"]
{% endif %}Gets full plant data when a species is selected from the dropdown:
alias: Get Info From Openplantbook
triggers:
- trigger: state
entity_id: input_select.openplantbook_searchresults
actions:
- action: openplantbook.get
data:
species: "{{ states('input_select.openplantbook_searchresults') }}"alias: Clear Openplantbook cache
triggers:
- trigger: state
entity_id: input_button.openplantbook_clear_cache
actions:
- action: openplantbook.clean_cache
data:
hours: 0Two cards: one for searching, one for displaying plant details.
type: entities
title: Search OpenPlantbook
entities:
- entity: input_text.openplantbook_search
- entity: openplantbook.search_result
- entity: input_select.openplantbook_searchresults
- entity: input_button.openplantbook_clear_cacheA Markdown card that shows the selected plant's image, species, and thresholds:
type: markdown
title: Plant info
content: |
{% set plant = "openplantbook." + states('input_select.openplantbook_searchresults') | replace(" ", "_") | replace("'", "") | replace(".", "") %}
{% if states(plant) == "unknown" %}
# Search for a plant
{% else %}
# {{ state_attr(plant, 'display_pid') }}
{% set min_dli = ((state_attr(plant, 'min_light_mmol') | float(default=0) * 0.0036)) | round(0, default=0) %}
{% set max_dli = ((state_attr(plant, 'max_light_mmol') | float(default=0) * 0.0036)) | round(0, default=0) %}
 | urlencode }})
_{{ state_attr(plant, 'pid') }}_
## Thresholds
| | Min | | Max | |
|----------------------|------------------------------------------:|----|------------------------------------------:|------|
| Moisture | {{ state_attr(plant, 'min_soil_moist') }} | | {{ state_attr(plant, 'max_soil_moist') }} | % |
| Conductivity | {{ state_attr(plant, 'min_soil_ec') }} | | {{ state_attr(plant, 'max_soil_ec') }} | μS/cm |
| Temperature | {{ state_attr(plant, 'min_temp') }} | | {{ state_attr(plant, 'max_temp') }} | °C |
| Humidity | {{ state_attr(plant, 'min_env_humid') }} | | {{ state_attr(plant, 'max_env_humid') }} | % |
| Illumination | {{ state_attr(plant, 'min_light_lux') }} | | {{ state_attr(plant, 'max_light_lux') }} | lx |
| Daily Light Integral | {{ min_dli }} | | {{ max_dli }} | mol/d⋅m² |
{% endif %}