@smartplant/watering
v1.0.0
Published
Plugin for predictive watering based on sensor data in SmartPlant
Readme
@smartplant/watering
This plugin extends SmartPlant to provide predictive watering based on sensor data. It uses real-time humidity and temperature readings from DHT22 sensors to forecast watering needs, integrating with all supported AI models (Gemini, OpenAI, Grok, Claude, Ollama) for intelligent recommendations. The plugin calculates a "thirst level" and triggers alerts or automations.
Functionality
- Monitors humidity and temperature via registered sensors.
- Uses AI to predict watering intervals based on trends.
- Supports switching AI models via configuration.
- Visualizes predictions with SmartPlant's emoji scale (e.g., 🍂 for dry).
Installation
- Install the base library:
npm install -g smartplant - Install this plugin:
npm install @smartplant/watering - In your project:
const watering = require('@smartplant/watering'); watering.init({ model: 'grok' });
Usage Example
const smartplant = require('smartplant');
const watering = require('@smartplant/watering');
watering.init({ model: 'ollama' });
const prediction = await watering.predictWatering({ humidity: 40, temperature: 25 });
console.log(prediction); // e.g., { advice: 'Water in 2 days', emoji: '🍂' }
