@smartplant/alerts
v3.0.5
Published
Species-aware alerting: turns raw threshold breaches into prioritized, actionable alerts.
Maintainers
Readme
⚠️ @smartplant/alerts
Turns raw threshold breaches into species-aware, prioritized alerts.
A plugin for smartplant — a bridge between AI and plants.
Install
npm install smartplant @smartplant/alertsUse
import { createPlant } from 'smartplant'
import alerts from '@smartplant/alerts'
const plant = await createPlant( {
name : 'Ivy',
species : 'Monstera deliciosa',
sensor : 'mock', // no hardware needed
ai : { provider : 'ollama' }, // or gemini / openai / claude / grok
} )
await plant.use( alerts )
await plant.read()
const result = await plant.plugin( 'alerts' ).checkAlerts( {} )
console.log( result.advice, result.emoji )API
checkAlerts( input? )
Returns { advice, emoji, severity, triggered, actions }.
input is optional; anything you pass is handed to the AI as extra context alongside the plant's readings, trends and care history.
If the AI is unreachable or unconfigured, the call returns the deterministic offline result rather than throwing.
Events
- Listens to
alert(critical only), to avoid spending a request on mild drift.
It stays quiet — and free — when nothing is wrong
If no metric is outside its comfort band, checkAlerts() returns triggered: false without calling the AI at all. The kernel already knows nothing is wrong; there is nothing to ask.
plant.plugin( 'alerts' ).recent( 10 ) // alerts raised this sessionTest
npm testRuns against the mock sensor and mock AI provider — no hardware, no API key, no network.
📜 License
MIT — see LICENSE.

