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

micro-app-home-alarm

v2.0.0

Published

Alarm dashboard written in node

Downloads

5

Readme

MQTT/Node base home alarm system

This is a port of the HomeAlarm project over to the micro-app framwork so that you can get the native look and feel on desktop and mobile devices with the micro-app-cordova-launcher and micro-app-electron-launcher projects.

This projects provides a home based alarm system using Node and MQTT. It provides a GUI that allows you to:

  • arm/disarm the alarm
  • see the status of the zones
  • ask that a picture be taken
  • view the last 4 pictures taken
  • view pictures from multiple cameras
  • view the log of alarm events

When the alarm is triggered it will take pictures every 10 second for 5 minutes, pushing them to a remote webserver. It can also be configured to send sms messages to notify the owner than an alarm has occured.

In a browser:

picture of alarm main window

Native application:

picture of alarm main window

On a phone:

picture of alarm main window on phone

The following projects can be used to connect sensors such motion detectors, door contacts and webcams.

Additional views when alarm is active and triggered

picture of alarm when armed picture of alarm when triggered

View when using GUI to display pictures taken by camera

sample camera picture view

The server requires Node along with the modules defined in the package.json file to be installed.

It also requires:

  • an mqtt server
  • a remote webserver to serve up the pictures taken
  • twillio account (If you want SMS notifications)

Configuration

Most configuration is done in the config.json file which supports the following configuration options:

  • title - title used to name the page for the app
  • alarmSite - Name assigned to this instance of the alarm
  • serverPort - port on which micro-app is listening for connections
  • tls - set to the string "true" if you want to force tls when connecting
  • authenticate - set to "true" to enable basic authentication. If set to true then you must provide the "authInfo" values described below
  • scrollBars - set this to "true" so that you can scroll when viweing the log file
  • authInfo - object with username, password and realm values. authInfo.password is the hashed password that will be used to authenticate to the micro-app. This can be generated with the utility in the micro-app framework which is called: .../node_modules/micro-app-framework/lib/gen_password.js. The first parameter is the password to be hashed.
  • mqtt - object with serverUrl, rootTopic and certsDir. If the serverUrl uses tls (ex mqtts: then certsDir must contain the required certificates etc. needed to connect to the mqtt server using tls)
  • zone - array objects, each of which specifies the topic, zoneId and label for one of the alarm zones
  • camera - object with topic used to communicate with the camera server and topics and messages used to communicate with an IR illuminator (see https://github.com/mhdawson/PI433WirelessTXManager for the circuit used to turn on/off the power supply for the IR illuminator)
  • eventLogPrefix - directory in which log for alarm will be written
  • notify - configuration for notification options
    • mqttSmsBridge - element with the following sub-elements:
      • enabled - set to true if you want notifications to be sent using this provider.
      • serverUrl - url for the mqtt server to which the bridge is connected.
      • topic - topic on which the bridge listens for notification requests.
      • certs - directory which contains the keys/certs required to connect to the mqtt server if the url is of type mqtts.
    • voipms - element with the following sub-elements:
      • enabled - set to true if you want notifications to be sent using this provider.
      • user - voip.ms API userid.
      • password - voip.ms API password.
      • did - voip.ms did(number) from which the SMS will be sent.
      • dst - number to which the SMS will be sent.
    • twilio - element with the following sub-elements:
      • enabled - set to true if you want notifications to be sent using this provider.

For example this is my configuration file with some key elements masked out:

Installation

The easiest way to install is to run:

and then configure the default config.json file in the lib directory as described in the configuration section above.

Running

Simply cd to the directory where the npm was installed and type:

Key Depdencies

micro-app-framework

As a micro-app the micro-app-alert-dashboard app depends on the micro-app-framework:

See the documentation on the micro-app-framework for more information on general configurtion options that are availble (ex using tls, authentication, serverPort, etc)

micro-app-notify-client

The micro-app-notify-client is used to send notifications through sms and other means when necessary.

TODOs

  • Add more doc on how to configure, setup and run, including the required mqtt server