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

homebridge-kasa-cam

v0.5.2

Published

HomeKit on/off (privacy) control for TP-Link Kasa cameras (EC70, KC-series, etc.). Reads state locally over UDP; writes via the reverse-engineered Tapo cloud passthrough API, since current Kasa camera firmware has no local control path.

Readme

homebridge-kasa-cam

HomeKit on/off (privacy) control for TP-Link Kasa cameras (EC70 "Spot Pan Tilt", and other models using the same protocol).

Each camera shows up in HomeKit with up to three switches:

  • Camera on/off (always present) — On = enabled, Off = privacy mode (same as "Camera Off" in the app)
  • Status LED (optional) — toggle the camera's indicator LED
  • Motion detection (optional) — enable/disable motion detection

The LED and motion switches are on by default and can each be turned off via exposeLed / exposeMotionDetection.

Setup is just your TP-Link account email + password and each camera's local IP. No app capture, no rooted phone.

Optionally, it can also expose a live video tile (see Video below).

Configuration

{
  "platforms": [
    {
      "platform": "KasaCam",
      "name": "Kasa Cam",
      "email": "[email protected]",
      "password": "your-tplink-account-password",
      "pollSeconds": 30,
      "exposeLed": true,
      "exposeMotionDetection": true,
      "cameras": [
        { "ip": "192.168.1.50" },
        { "ip": "192.168.1.51", "name": "Bedroom" }
      ]
    }
  ]
}

That's it — deviceId, model, and the default name are auto-detected from each camera's local get_sysinfo. (If a camera isn't reachable on the same LAN as Homebridge, give its deviceId explicitly and omit ip; state will then be read via the cloud.)

Video (optional)

Kasa cameras have no RTSP/ONVIF and use a proprietary stream, so point this plugin at a feed that ffmpeg can read — easiest is a go2rtc RTSP endpoint (go2rtc's kasa:// source does the hard demuxing). Set source (ffmpeg input args, like homebridge-camera-ffmpeg) on a camera and a HomeKit camera tile appears:

{
  "ip": "192.168.1.50",
  "source": "-rtsp_transport tcp -i rtsp://127.0.0.1:8554/living_room",
  "stillImageSource": "-i http://127.0.0.1:1984/api/frame.jpeg?src=living_room"
}

Requirements / notes:

  • ffmpeg must be installed on the Homebridge host (set ffmpegPath if it's not on PATH).
  • source / stillImageSource are ffmpeg input arg strings; stillImageSource defaults to source if omitted.
  • Native privacy via HKSV: with video, the camera is exposed as a HomeKit Secure Video camera, so the device on/off lives in the camera's native mode control (Settings → set When Home/When Away to Off). HKSV recording needs an iCloud+ plan + a home hub; the on/off works regardless.
    • privacySwitch: true — also add a standalone on/off switch alongside the native mode (both stay in sync) if you want a one-tap toggle.
    • privacyAsSwitch: true — disable HKSV entirely and use only the standalone switch.
  • HKSV is experimental here (hard to validate without an iOS device/hub); if the camera misbehaves, privacyAsSwitch: true falls back to the simple streaming camera + switch.
  • Video only for now — HomeKit audio needs AAC-ELD (libfdk_aac), which most ffmpeg builds lack.
  • Set copyVideo: true to pass H.264 through without re-encoding (much lower CPU); turn it off if the picture is glitchy.
  • The camera tile is a separate accessory from the on/off switch.

How it works

Current Kasa camera firmware (e.g. EC70 2.3.x) has no local control path:

  • UDP/TCP 9999 answers get_sysinfo (read) but ignores set_* commands.
  • The HTTPS API on 19443 serves only the video stream — no control endpoint.
  • The official app controls the camera exclusively via the TP-Link cloud (confirmed by packet capture: block the cloud while keeping LAN, and the app's on/off spins forever and never touches the camera locally).

So this plugin:

  • Reads on/off state locally over UDP 9999 (get_sysinfocamera_switch) — fast, works offline.
  • Writes on/off via the TP-Link cloud passthrough API, signed exactly like the Tapo app signs its requests.

Auth & signing (baked in)

Login and request signing use HMAC-SHA1 with app-global signing keys that ship inside the official app — not per-user secrets — so they're built into this plugin and you never configure them:

Content-MD5    = base64(MD5(body))
stringToSign   = Content-MD5 + "\n" + "9999999999" + "\n" + Nonce + "\n" + <request-path>
Signature      = hex( HMAC-SHA1(secret, stringToSign) )
X-Authorization: Timestamp=9999999999, Nonce=<uuid>, AccessKey=<key>, Signature=<sig>

The on/off command relayed through passthrough is:

{ "smartlife.cam.ipcamera.switch": { "set_is_enable": { "value": "on" } } }

The plugin generates and persists its own terminalUUID on first run.

Status

  • ✅ Local state read (EC70, UDP 9999)
  • ✅ Cloud login + signed passthrough (email + password only)
  • ✅ On/off command verified end-to-end
  • Tested against: EC70(US) fw 2.3.27

License

MIT