@smartplant/lighting
v3.0.5
Published
Placement, exposure-hour and grow-light recommendations.
Maintainers
Readme
☀️ @smartplant/lighting
Advises on placement, exposure hours and grow-light use.
A plugin for smartplant — a bridge between AI and plants.
Install
npm install smartplant @smartplant/lightingUse
import { createPlant } from 'smartplant'
import lighting from '@smartplant/lighting'
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( lighting )
await plant.read()
const result = await plant.plugin( 'lighting' ).optimizeLight( { windowDirection : 'north' } )
console.log( result.advice, result.emoji )API
optimizeLight( input? )
Returns { advice, emoji, severity, hoursNeeded, needsGrowLight }.
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
plant:too-dark, emitslighting:insufficient.
Daily light hours, computed locally
plant.plugin( 'lighting' ).dailyLightHours( 200 ) // hours above 200 lux in the last 24hTest
npm testRuns against the mock sensor and mock AI provider — no hardware, no API key, no network.
📜 License
MIT — see LICENSE.

