@smartplant/alerts
v1.0.0
Published
Plugin for species-specific alerts based on sensor data in SmartPlant
Downloads
83
Readme
@smartplant/alerts
This plugin sends species-specific alerts based on sensor deviations from optimal ranges. It uses AI (Gemini, OpenAI, Grok, Claude, Ollama) to customize notifications, incorporating emojis for alert severity.
Functionality
- Configures optimal ranges per plant species.
- Monitors sensors and triggers AI-analyzed alerts.
- Supports all models for personalized advice.
- Emoji alerts (e.g., ⚠️ for warning).
Installation
- Install the base library:
npm install -g smartplant - Install this plugin:
npm install @smartplant/alerts - In your project:
const alerts = require('@smartplant/alerts'); alerts.init({ model: 'grok' });
Usage Example
const smartplant = require('smartplant');
const alerts = require('@smartplant/alerts');
alerts.init({ model: 'ollama' });
const alert = await alerts.checkAlerts({ species: 'Monstera', humidity: 30 });
console.log(alert); // e.g., { advice: 'Humidity too low', emoji: '⚠️' }
