Cards, Sensors & Services
The gardenrx integration puts your garden on dashboards, in automations and in voice
commands: three cards, six sensors and twelve services.

The app installs the integration when Home Assistant integration is on (the default).
Add it under Settings → Devices & services → Discovered. It reads the garden every 60
seconds, or at once with gardenrx.refresh.
Add a card to a dashboard
Edit a dashboard, press Add card and search for GardenRX. The cards are listed as GardenRX harvest, GardenRX sprays and GardenRX stock. There is no resource to add.
The cards follow your Home Assistant theme, fit a phone and use 44 px buttons.
See the last spray and mark a queued one done
type: custom:gardenrx-spray-cardThe spray card shows:
- The last spray: how long ago, its date, how many this year, the products and crops.
- Don’t harvest yet: crops inside a pre-harvest interval, with the days left and the date they clear.
- Queued: each planned spray with Mark sprayed and Remove.
| Option | Default | What it does |
|---|---|---|
title |
Last spray | The heading. title: "" leaves it off. |
show_queue |
true |
Shows queued sprays |
show_phi |
true |
Shows crops inside a pre-harvest interval |
volume_gallons |
none | The tank volume recorded when you press Mark sprayed |
entity |
found by itself | The sensor to read |
Log a harvest from a dashboard
type: custom:gardenrx-harvest-card
The harvest card shows this year’s total weight, its value and the number of picks, a bar per crop, and the recent picks with Delete.
To log a pick, choose the crop under Log a harvest, then its variety, the amount, the unit and the date. Press Log harvest. Until the form is complete, the card says what it still needs.
| Option | Default | What it does |
|---|---|---|
title |
Harvest and the year | The heading. title: "" leaves it off. |
show_form |
true |
Shows the Log a harvest form |
crops |
6 |
How many crops to list |
recent |
5 |
How many recent picks to list |
entity |
found by itself | The sensor to read |
See what is running low
type: custom:gardenrx-inventory-cardThe stock card counts the treatments at 20% or less, then lists every product in stock, lowest first, with a level bar. When nothing is low it says Nothing at 20% or less and lists the three lowest.
| Option | Default | What it does |
|---|---|---|
title |
Stock | The heading. title: "" leaves it off. |
max_items |
8 |
How many products to list |
low_only |
false |
Lists only the products running low |
entity |
found by itself | The sensor to read |
Show the cards on Morph
When brAIn’s Morph dashboard is present, the app copies the cards into
/config/morph/cards on every start. Add them to Morph’s dashboard.yaml:
- type: custom:morph-gardenrx-harvest- type: custom:morph-gardenrx-spray- type: custom:morph-gardenrx-inventoryThey are drawn in Morph’s colours and fonts. Turn off Install the Morph cards in the app’s options to stop the copy.
Log a pick or a spray from a script
Call a service and read its answer:
action: gardenrx.log_harvestdata: crop: Apples variety: Liberty weight: 4.5 unit: lbresponse_variable: pickedEvery service answers with what it did. A refusal, such as a crop name that matches nothing or a spray already logged, is an error with the reason in a sentence. Crops and products are found by name, part of a name, or id.
The full list of services is below.
Recipes
Log 20 tomatoes with one button
The pick is counted, not weighed. The crop’s average weight each turns it into pounds.
show_name: truetype: buttonname: Log 20 tomatoestap_action: action: perform-action perform_action: gardenrx.log_harvest data: crop: Tomatoes weight: 20 unit: ctGet told when something runs low
alias: Garden – treatment running lowtriggers: - trigger: numeric_state entity_id: sensor.gardenrx_treatments_running_low above: 0actions: - action: notify.notify data: message: > Running low: {{ state_attr('sensor.gardenrx_treatments_running_low', 'items') | selectattr('low') | map(attribute='product') | join(', ') }}Get a reminder on spray day
alias: Garden – spray daytriggers: - trigger: time at: "07:30:00"conditions: - condition: template value_template: > {{ state_attr('sensor.gardenrx_queued_sprays', 'queued') | selectattr('planned_date', 'eq', now().date() | string) | list | count > 0 }}actions: - action: notify.notify data: message: A spray is planned for today. Check the window in GardenRX first.Use it with brAIn
When brAIn is installed:
- It remembers each crop’s season. brAIn reads Harvest this year on every pass of its checks and keeps one fact per crop: weight, picks, value and last pick. The facts expire a few days after the sensor stops reporting, and a new season’s empty list clears them.
- It acts on your say-so. In chat or by voice, brAIn can call any
gardenrx.*service through its usual safety rules, and reads the reply. - It watches for faults. brAIn’s development loop watches the app’s state and log, so a fault in GardenRX can be reported and fixed like one in brAIn.
Reference
Sensors
| Sensor | State | Attributes |
|---|---|---|
| Harvest this year | pounds picked this calendar year | by_crop, recent (each pick with its id), crops (with varieties), total_value |
| Harvest value this year | dollars, at each crop’s $/lb | |
| Last spray | the date | days_ago, products, crops, queued, phi |
| Queued sprays | how many | queued (each with its id) |
| Crops in a pre-harvest interval | how many | crops (days left, the date it clears, the product) |
| Treatments running low | how many are at 20% or less | items (every product in stock) |
A count is valued with the crop’s average weight each and its $/lb, the same as the Harvest page.
Entity ids follow the sensor names (sensor.gardenrx_last_spray,
sensor.gardenrx_queued_sprays, …). Check yours under Settings → Devices & services →
GardenRX if you renamed anything.
Services
| Service | Fields | What it does |
|---|---|---|
gardenrx.log_harvest |
crop, weight; optional variety, unit (lb default, oz, kg, g, ct), date, notes |
Logs a pick. One inside a pre-harvest interval is saved, and the response’s phi_warning says so. |
gardenrx.delete_harvest |
id |
Deletes a pick. |
gardenrx.log_spray |
product (one or a list), crop (one or a list) or area (Orchard, Garden, Landscape); optional rate, rate_unit, volume_gallons, date, notes |
Logs a spray that wasn’t queued. Without a rate it uses the label’s rate for those crops. Clears a queued spray for the same crops and takes what was used out of stock. A product not labelled for a crop is saved, and label_warning says so. |
gardenrx.queue_spray |
the same crops and products; optional planned_date, notes |
Queues a spray. It shows on the Spray page and the spray card. |
gardenrx.complete_queued_spray |
id; optional volume_gallons, date |
Logs the queued spray, removes it from the queue and takes what it used out of stock, the same as Log Spray in the app. |
gardenrx.delete_queued_spray |
id |
Removes a queued spray. |
gardenrx.adjust_inventory |
product, and change (above zero adds, below zero takes out) or quantity (how much is on hand); optional unit |
Sets or changes stock. A product not stocked yet is added, counted in unit or the unit its label is sold in. |
gardenrx.add_crop |
name; optional crop_group |
Adds a crop. One the catalog knows gets its group without being told. |
gardenrx.add_variety |
crop, name |
Adds a variety. |
gardenrx.log_note |
place, note; optional date |
Adds a dated line to a place on the Garden map (a bed, a tree), shown in its Edit dialog. |
gardenrx.get_harvests |
optional crop, start, end |
Response only. Returns the harvests, newest first, with totals per crop and unit. |
gardenrx.refresh |
none | Reads the garden now instead of at the next poll. |