I built a Home Assistant integration that diagnoses cannabis plant health from a camera photo and returns structured data your automations can act on - specific condition, confidence score, growth stage. Not a paragraph of text you have to read, but JSON that lets HA respond the same way it would to any sensor state change. I built this because I was tired of squinting at leaves under a blurple light at midnight trying to decide if I was looking at magnesium deficiency or early spider mites.
Fair warning: the models are trained specifically on cannabis. It will correctly reject non-cannabis photos, but it won’t diagnose your tomatoes.
What it does:
- Service action
plantlab.diagnose- pass a camera entity or image path - Returns structured JSON: health status, detected conditions, pests, growth stage, confidence scores
- 30 classifiable issues (20 conditions + 10 pests) - calcium vs magnesium vs iron vs potassium individually, not “nutrient deficiency” as a bucket
- 6 sensors update after each diagnosis (health, top condition, top pest, growth stage, nutrient analysis, binary problem sensor)
- Nutrient analysis sensor runs Mulder’s Chart automatically - if it detects a deficiency, it flags which excess nutrients might be causing the lockout. So instead of “magnesium deficiency, add magnesium” it might tell you your calcium is too high and that’s the actual problem
- Under a second per diagnosis
Because the output is structured, your automations can act on the result without a human reading it. Camera detects light burn? Dim the grow light. Nutrient deficiency? Adjust the dosing pump. Spider mites? Kill the intake fan so spores don’t spread to the next tent. The diagnosis is machine-readable, so HA treats it like any other sensor.
Example - diagnose and branch based on what’s detected:
automation:
- alias: "Daily Plant Health Check"
trigger:
- platform: time
at: "08:00:00"
action:
- action: camera.snapshot
target:
entity_id: camera.grow_tent
data:
filename: /config/www/plant_snapshot.jpg
- action: plantlab.diagnose
data:
image_path: /config/www/plant_snapshot.jpg
response_variable: diagnosis
- choose:
- conditions:
- condition: template
value_template: >
{{ 'light_burn' in diagnosis.conditions | map(attribute='class_id') | list }}
sequence:
- action: light.turn_on
target:
entity_id: light.grow_light
data:
brightness_pct: 70
- conditions:
- condition: template
value_template: "{{ diagnosis.is_healthy == false }}"
sequence:
- action: notify.mobile_app
data:
title: "Plant Health Alert"
message: >
{{ diagnosis.conditions | map(attribute='class_id') | join(', ') }}
Light burn detected? Light dims to 70% automatically. Anything else unhealthy falls through to a notification. You could add branches for nutrient dosers, fan speed, irrigation - whatever your setup has. The structured response gives you the condition name and confidence to branch on.
Install:
HACS default listing is in the review queue. For now, add as a custom repository:
- HACS > Integrations > three dots menu > Custom repositories
- Paste:
https://github.com/plantlab-ai/home-assistant-plantlab - Category: Integration
- Install, restart, add via Settings > Devices & Services
Free tier is 3 diagnoses/day - enough for daily monitoring of a home grow. API key at plantlab.ai.
GitHub: GitHub - plantlab-ai/home-assistant-plantlab: PlantLab automation for Home Assistant · GitHub
I went with a service action instead of polling because most people want a check once or twice a day, not a camera hitting an API every 30 seconds. But the response is designed to be acted on programmatically - notification is just the simplest fallback. If you’ve got dosers, dimmable lights, or fan controllers wired into HA, the diagnosis data can drive all of them.