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-remote-control

v0.9.0

Published

Remote control in node

Downloads

3

Readme

micro-app-remote-control - mqtt based remote control

This remote control provides a remote control GUI that can be used to control devices that can be signaled through mqtt. This can be be used with X10 based devices, 433Mhz devices as well as IR controlled devices through the [micro-app-mqtt-x10-bridge] (https://github.com/mhdawson/micro-app-mqtt-x10-bridge), [arduino-sensors/ACRemote/] (https://github.com/mhdawson/arduino-sensors/tree/master/ACRemote), and [PI433WirelessTXManager] (https://github.com/mhdawson/PI433WirelessTXManager) projects. It can also be used with any other device which an be controlled through mqtt.

The buttons on the remote control are fully customizable in terms of location, size, color and what mqtt topic/message is invoked when the button is pressed.

The remote can be realized as a browser window by simply pointing a browser at the appropriate server/port or as a native desktop application or native mobile app using the [micro-app-electron-launcher] (https://github.com/mhdawson/micro-app-electron-launcher), or [micro-app-cordova-launcher] (https://github.com/mhdawson/micro-app-cordova-launcher) projects.

These are examples of my initial remote as a browser window and native android application:

![remote control browser] (https://raw.githubusercontent.com/mhdawson/micro-app-remote-control/master/pictures/browser-remote.jpg)

![remote control phone] (https://raw.githubusercontent.com/mhdawson/micro-app-remote-control/master/pictures/phone-remote.jpg)

Right now I've configured it to allow me to turn on/off lights in our living room and dining room, turn off all lights at once and to turn on/off the split air conditioner in our bedroom.

Usage

After installation modify ../lib/config.json to match your configuration.

The configuration entries that must be updated include:

  • title - title for the remote (optional)
  • mqttServerUrl - url of the mqtt server to connect to. This can either start with tcp:// or mqtts://. If it starts with mqtts:// there must be a subdirectory in the lib directory called mqttclient which contains ca.cert, client.cert, client.key which contain the key and associated certificates for a client which is authorized to connect to the mqtt server.
  • serverPort - port on which the dashboard listens for connections
  • size - object with x and y fields that define the size used for the remote window
  • buttons - array in which each entry defines a button on the remote. Each entry is an object with the following values:
    • label - text to be shown on the button
    • size - object with x and y fields for the sizes of the button
    • position - object with x and y fields for the position of the button
    • color - color for the button
    • commands - array of objects which define the message(s) to be sent when the button is pressed. Each object has the following values:
      • topic - topic on which message wil be sent when button is pressed
      • message - message sent on topic when button is pressed
      • delay - delay after the button is pressed when the message is sent.
        Often when a button invokes multiple actions you will need to have a delay in order to avoid conflicts (for example sending X10 messages to close together can mess things up).

As a micro-app the dashboard also supports other options like authentication and tls for the connection to the GUI. See the documentation for the [micro-app-framework] (https://github.com/mhdawson/micro-app-framework) for additional details.

The following is an example configuration file:

Installation

Simply run:

and then configure as described in the section above. Alternatively you can clone the github repo and then run "npm install" from the directory for the project.

Running

To run the micro-app-remote-control app, add node.js to your path (currently requires 4.x or better) and then run:

from the directory in the micro-app-remote-control was installed.

Once the server is started. Point your browser at the host/port for the server. If you have configured your browser to allow javascript to close the current page the original window will be closed and one with the correct size of the alert-dashboard app page will be created.

Key Depdencies

micro-app-framework

As a micro-app the micro-app-remote-control 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)