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 🙏

© 2025 – Pkg Stats / Ryan Hefner

presence-controller

v1.0.4

Published

Vodafone Station 6 WiFi Presence Controller

Downloads

275

Readme

Presence Controller

The presence-controller library provides two functions to interact with devices connected to a WiFi router (Vodafone Station 6). These functions can be used in home automation to automate routines based on the actual presence of one or more individuals connected with their mobile phones to the home WiFi network.

Functions

getMACs

The getMACs function retrieves all MAC addresses of devices connected to the WiFi router.

getPresences

The getPresences function checks for the presence of specified MAC addresses among the devices connected to the WiFi router.

Usage

Environment Variables

The following environment variables need to be set:

  • ROUTER_ADDRESS: The address of the router.
  • OVERVIEW_PAGE: The overview page of the router (default: /overview.html).
  • LOGIN_USERNAME: The username for logging into the router.
  • LOGIN_PASSWORD: The password for logging into the router.
  • PRESENCE_MAC_ADDRESSES: A comma-separated list of MAC addresses to check for presence [OPTIONAL].

Function Parameters

Alternatively, you can pass the configuration as an object to the functions:

  • ROUTER_ADDRESS: The address of the router.
  • OVERVIEW_PAGE: The overview page of the router (default: /overview.html).
  • LOGIN_USERNAME: The username for logging into the router.
  • LOGIN_PASSWORD: The password for logging into the router.
  • PRESENCE_MAC_ADDRESSES: A comma-separated list of MAC addresses to check for presence [OPTIONAL].

Examples

getMACs

import { getMACs } from "presence-controller";

const config = {
  ROUTER_ADDRESS: "192.168.1.1",
  OVERVIEW_PAGE: "/overview.html",
  LOGIN_USERNAME: "admin",
  LOGIN_PASSWORD: "password"
};

getMACs(config)
  .then((macs) => {
    console.log(`Connected MAC addresses: ${Array.from(macs).join(", ")}`);
  })
  .catch((error) => {
    console.error(`Error: ${error.message}`);
  });

getPresences

import { getPresences } from "presence-controller";

const config = {
  ROUTER_ADDRESS: "192.168.1.1",
  OVERVIEW_PAGE: "/overview.html",
  LOGIN_USERNAME: "admin",
  LOGIN_PASSWORD: "password",
  PRESENCE_MAC_ADDRESSES: "00:11:22:33:44:55,66:77:88:99:AA:BB"
};

getPresences(config)
  .then((presence) => {
    console.log(`Presence detected: ${presence}`);
  })
  .catch((error) => {
    console.error(`Error: ${error.message}`);
  });

Result

getMACs

The function returns a promise that resolves to a set containing all the MAC addresses found among the connected devices.

getPresences

The function returns a promise that resolves to a boolean value indicating whether all specified MAC addresses are present among the connected devices.

Applications

These functions can be used in home automation to automate routines based on the actual presence of one or more individuals connected with their mobile phones to the home WiFi network. For example, you can use them to:

  • Turn on lights when someone arrives home.
  • Adjust the thermostat based on who is present.
  • Enable or disable security systems.
  • Start automatic cleaning robots when no one is home.
  • Send notifications when specific individuals arrive or leave.