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

eufy-security-snapshotter

v1.0.1

Published

Modular Node.js SDK for capturing snapshots from Eufy Pan/Tilt cameras (including custom support for eufyCam C31) with offline local ONNX weather classification.

Readme

Eufy Security Snapshotter with Local Weather Classification

A modular Node.js SDK and utility for capturing snapshots from Eufy Pan/Tilt cameras (including fully custom support for the eufyCam C31 / T817L), rotating the camera to specific preset angles, and running fully offline local AI image inference using ONNX to classify weather conditions.

Key Features

  • Object-Oriented SDK Design: Exports a reusable, developer-friendly class that integrates seamlessly into larger applications.
  • Persistent Sessions: Automatically saves authentication tokens locally to minimize 2FA prompt frequency.
  • Preset Position Control: Moves Pan/Tilt cameras to specific preset indices before taking the capture.
  • Efficient Frame Capturing: Establishes local P2P livestreaming, captures a single high-quality frame with FFmpeg, and instantly shuts down the stream. Falling back to Eufy Cloud image URLs if livestreaming is unsupported.
  • Local ONNX Weather Inference: Runs a lightweight 5.9MB pre-trained 14-class ResNet50 model offline in under 650ms.
  • Re-normalized Prediction Filtering: Restricts predictions to 6 core atmospheric weather classes (cloudy, fogsmog, rain, shine (sunny), rainbow, and snow), re-normalizing their relative confidence to 100% and discarding misleading classifications like lens condensation or dew.

SDK API Reference

Installation

npm install eufy-security-snapshotter

Usage Example

const EufySecuritySnapshotter = require('eufy-security-snapshotter');

async function main() {
    // 1. Instantiate the class with your credentials and config
    const snapshotter = new EufySecuritySnapshotter({
        username: "[email protected]",
        password: "your-password",
        deviceSerial: "T817LT002605061C", // Camera serial number
        presetIndex: 3,                   // Preset to rotate to (optional)
        snapshotsDir: "./custom_snapshots",// Where to save files (optional)
        tokenPath: "./persistent.json"    // Session cache (optional)
    });

    try {
        // 2. Initialize and connect to the Eufy Cloud & Local P2P
        console.log("Connecting...");
        await snapshotter.initialize();

        // 3. Option A: Capture a standard raw image snapshot (returns Buffer)
        const imageBuffer = await snapshotter.takeSnapshot();
        console.log(`Captured image buffer of size: ${imageBuffer.length} bytes`);

        // 4. Option B: Capture snapshot AND run local weather analysis (returns Buffer + Metadata Object)
        const { imageBuffer, metadata } = await snapshotter.takeSnapshotWithWeather();
        console.log(`Captured image buffer of size: ${imageBuffer.length} bytes`);
        console.log(`Detected Weather: ${metadata.weather.label} (${(metadata.weather.confidence * 100).toFixed(2)}%)`);

    } catch (error) {
        console.error("Snapshot failed:", error.message);
    } finally {
        // 5. Cleanly close the session
        await snapshotter.close();
    }
}

main();

Demo Utility

This repository includes a standalone demo utility (demo.js) allowing you to trigger on-demand snapshots and verify your setup.

1. Prerequisites

  • Node.js: Latest LTS version.
  • FFmpeg: Must be installed on your system path.
    • Amazon Linux / RHEL / Fedora:
      sudo dnf install ffmpeg-free -y
    • Ubuntu / Debian:
      sudo apt update && sudo apt install ffmpeg -y

2. Setup Configuration

  1. Clone the repository and install dependencies:

    git clone https://github.com/elijahparker/eufy-security-snapshotter.git
    cd eufy-security-snapshotter
    npm install
  2. Copy the environment template:

    cp .env.example .env
  3. Open .env and fill in your details:

    EUFY_USERNAME="[email protected]"
    EUFY_PASSWORD="your-eufy-account-password"
    DEVICE_SERIAL="T817LT002605061C"
    PRESET_INDEX=3

3. Run the Demo

To capture a snapshot and run the ONNX weather classification (saves a .jpg and .json in ./snapshots):

node demo.js

To run a raw snapshot only without loading the ONNX model or running classification:

node demo.js --only-snapshot

4. View Saved Weather Logs

A companion .json file is saved with each capture preserving the complete list of normalized class scores:

# Print the results of the newest snapshot weather analysis
cat $(ls -t snapshots/*.json | head -n 1)

Example JSON metadata output:

{
  "timestamp": "2026-06-18T14:01:49.389Z",
  "camera": {
    "name": "Garage",
    "serial": "T817LT002605061C",
    "model": "T817L"
  },
  "weather": {
    "label": "cloudy",
    "confidence": 0.6898,
    "scores": {
      "cloudy": 0.6898,
      "rain": 0.2014,
      "fogsmog": 0.0542,
      "shine": 0.0315,
      "snow": 0.0182,
      "rainbow": 0.0049
    }
  }
}

License

MIT License.