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 🙏

© 2024 – Pkg Stats / Ryan Hefner

openhab-netgear

v0.9.1

Published

Control your Netgear Wifi router (Nighthawk and others) from home automation system OpenHAB

Downloads

4

Readme

openhab-netgear

An OpenHab add-on that that acts as a wrapper for the Netgear node module to allow managing of wifi access points from OpenHab Sitemaps and Rules.

The provided examples allow you to create an interface to easily turn on/off the guest wifi network from your OpenHAB interface and rules to do this for a set period of time (eg. 1hr) - perfect for giving the kids a limited time window for internet usage.

Requirements

  • OpenHAB 2.x (tested on 2.3.0)
  • The OpenHAB Exec Binding
  • NodeJS 8+
  • Yarn or NPM

Installation

  1. Ensure you have the requirements installed on the same server as OpenHAB
  2. Go to your OpenHAB scripts directory (on Linux this is /etc/openhab2/scripts)
  3. Install this package using yarn/npm: yarn add openhab-netgear
  4. You should now have a folder in your scripts dir for openhab-netgear
  5. Depending on your setup, you probably need to change the file ownership of the new folder chown -R openhab: node_modules/

Setup

Things

You need to setup two Things in OpenHAB to connect the node script to OpenHAB.

| Thing | Command | Transform | Interval | Timeout | Autorun | | ----------------|----------------------------------------------------------------------------------|-------------|----------|---------|---------| | wifiGuestSwitch | /usr/bin/node /etc/openhab2/scripts/node_modules/openhab-netgear/manageWifi.js switch-2g %2$s | REGEX((.)) | 0 | 15 | OFF | | wifiStatus | /usr/bin/node /etc/openhab2/scripts/node_modules/openhab-netgear/manageWifi.js guest-status | REGEX((.)) | 60 | 15 | OFF |

You can do this via the web interface OR in the file system - however you normally do this should be fine.

Items

Add the following Items to an existing or new file in /etc/openhab2/items folder

// Netgear Wifi Switching
Switch WifiGuestSwitch  "Guest Wifi" <network> // proxy triggers rule
Number WifiGuestTimer  "Guest Wifi" <network> // timer active ON/OFF
Switch WifiGuestSwitchExec {channel="exec:command:wifiGuestSwitch:run"}  // Exec binding to run execute JS 
String WifiGuestSwitchArgs {channel="exec:command:wifiGuestSwitch:input"} // Argument to pass (ON/OFF) to JS
String WifiGuestStatus {channel="exec:command:wifiStatus:output"} // Second Exec binding to check actual router status
Switch WifiGuestSwitchRunning // Switched to ON for 30 seconds whenever a wifi change is run
DateTime WifiGuestEnabledUntil "Guest Wifi Until: [%1$tH:%1$tM]" // the deadline for wifi access to be automatically disabled
Switch WifiGuestTimerRunning "Wifi timer running" // indicates if a wifi deadline is currently in action

Sitemap

Example Sitemap entries to allow guest wifi to be controlled and managed. Add this to your existing Sitemap as you see fit.

    Frame label="Kids Wifi" icon="network" {
        Switch item=WifiGuestSwitch label="Wifi Status"
        Switch item=WifiGuestTimer label="Enable for" icon="clock" mappings=[30="30m", 60="1h", 90="1.5h", 120="2h"] visibility=[WifiGuestTimerRunning==OFF]
        Switch item=WifiGuestTimerRunning visibility=[WifiGuestTimerRunning==ON]
        Text item=WifiGuestEnabledUntil icon="clock" visibility=[WifiGuestTimerRunning==ON]
    }

Rules

Copy the wifi.rules file from /etc/openhab2/scripts/node_modules/openhab-netgear/wifi.rules into your rules folder (/etc/openhab2/rules/). Edit as you see fit.

Troubleshooting

To confirm the script is installed with all the pre-requisites, from the command line of your OpenHAB server, run the following:

node manageWifi.js info

You should get some output from your router similar to the below. If not, check your steps again and make sure your login and router address details are correct

{ ModelName: 'R8000',
  Description: 'Netgear Smart Wizard 3.0, specification 0.7 version',
  SerialNumber: '3WN34A7000167',
  Firmwareversion: 'V1.0.4.18',
  SmartAgentversion: '3.0',
  FirewallVersion: 'ACOS NAT-Netfilter v3.0.0.5 (Linux Cone NAT Hot Patch 06/11/2010)',
  VPNVersion: 'N/A',
  OthersoftwareVersion: '10.1.49',
  Hardwareversion: 'R8000',
  Otherhardwareversion: 'N/A',
  FirstUseDate: 'Friday, 01 Sep 2006 00:00:00',
  DeviceName: 'R8000',
  FirmwareDLmethod: '',
  FirmwareLastUpdate: '',
  FirmwareLastChecked: '',
  DeviceMode: '1' }