npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@smartplant/presence

v3.0.5

Published

Makes the plant aware of whether anybody is in the room, and behave accordingly.

Readme

📡 @smartplant/presence

HEADER

Occupancy from a WiFi radio: the UV-B interlock, and motion as a control on electrical events.

A plugin for smartplant — a bridge between AI and plants.

Install

npm install smartplant @smartplant/presence

Use

import { createPlant } from 'smartplant'
import presence from '@smartplant/presence'

const plant = await createPlant( { name : 'Ivy', species : 'Ficus', sensor : 'mock', ai : { provider : 'ollama' } } )
await plant.use( presence )

await plant.attachSensor( {
  driver  : 'presence',
  sensing : 'rssi',              // or 'csi'
  sample  : async () => readRadio(),
} )

if ( plant.plugin( 'presence' ).uvbAllowed().allowed ) await lamp.uvb()

This is not here to watch people

The radio reports one number: how disturbed the channel is compared to this room's own quietest. No identity, no count, no position. Two things about a plant depend on it.

The UV-B interlock. UV-B burns skin and eyes, a plant on a shelf sits at eye height, and until now the library could only know the room was empty if somebody told it.

Motion as a negative control. Brushing past a plant produces an action potential; so does the draught from a door. Both look like the opening of a wound response for the first few minutes. The defence estimate already discounts an event the weather explains, and "somebody walked past at that exact moment" belongs in the same column.

Unknown is a refusal

uvbAllowed() returns false while the radio is settling, while it is stuck, and whenever occupancy is unknown. An interlock that opens when it cannot see is not an interlock: the cost of refusing is a plant missing an optional dose, and the cost of allowing is somebody at eye height getting one.

And "empty" means nobody moving. A person sitting perfectly still is the case a WiFi radio cannot see, so this belongs alongside a physical guard rather than instead of one.

API

room()

{ occupancy, motion, settled, ratio, why }.

uvbAllowed()

{ allowed, why }.

explains( at )

{ explains, why } — did anything move within ±30 s of an electrical event.

capability()

What this radio honestly supports. CSI gives motion fine enough to notice somebody reaching past the plant; RSSI gives gross motion. Neither gives direction or pose, whatever a datasheet claims.

Hardware

No radio is talked to directly — there is no portable way, and the hardware that exposes CSI does so through its own firmware. sample returns a number (RSSI) or an array of numbers (CSI subcarriers). An ESP32-S3 with CSI firmware feeds this happily.

Presence is judged against this room's own quiet baseline rather than a threshold from a table: two rooms with identical occupancy read completely different RSSI.

Test

npm test

Runs against the mock sensor and mock AI provider — no hardware, no API key, no network.

📜 License

MIT — see LICENSE.