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

wirenboard-module-ledstrip

v1.3.1

Published

Ledstrip manager

Downloads

7

Readme

Ledstrip manager

This module allows to create RGBW virtual devices automatically, and supports the following features:

  • Wirenboard: Control ledstrip RGB channels
  • Wirenboard: Control ledstrip white channel
  • Wall switch: Single click - On/Off white channel
  • Wall switch: Long click - Change brightness of white or RGB channels
  • Wall switch: Double click - Select RGB channel mode / change color
  • Separate modes: Select white or RGB channels
  • Homebridge: Control white channel - On/Off, Brightness
  • Homebridge: Control RGB channel - On/Off, Brightness, Color, Temperature

Preparation

Please connect your device to the internet

Install NodeJS, if it is not yet

curl -sL https://deb.nodesource.com/setup_12.x | bash -
apt-get install -y nodejs git make g++ gcc build-essential

Install

To install this packet use wirenboard-module command. Install it if necessary

npm i -g wirenboard-module

Add ledstrip module and rule

wirenboard-module ledstrip

Usage

Wirenboard Rule

wirenboard-module automatically creates wirenboard rule, where declared two ledstrips

var ledstrip_manager = require("ledstrip");

//  ledledstrip 1  //
ledstrip_manager.start({
	id:     "ledstrip_1",
	title:  "Ledstrip 1",
	button: { device: "wb-gpio",        control: "EXT1_IN1" },
	rgb:    { device: "wb-mrgbw-d_152", control: "RGB" },
	white:  { device: "wb-mrgbw-d_152", control: "White" }
});

//  ledledstrip 2  //
ledstrip_manager.start({
	id:     "ledstrip_2",
	title:  "Ledstrip 2",
	button: { device: "wb-gpio",        control: "EXT1_IN2" },
	rgb:    { device: "wb-mrgbw-d_198", control: "RGB" },
	white:  { device: "wb-mrgbw-d_198", control: "White", default_level: 80 }
});
  • id - Wirenboard id
  • title - Wirenboard title, what we will see in UI
  • button - wall switch device and control names, where the value readings will be from
  • rgb - RGB channel device and control names, which runs the ledstrip
  • white - white channel device and control names, which runs the ledstrip
  • white.default_level - default brightness level of white channel, when using wall switch

After that we will see virtual device, where we can control RGB and White channels manually. Also we can emulate button click, long click and double click

  • button_click - emulate wall switch click

  • button_doubleClick - emulate wall switch double click

  • button_longClick - emulate wall switch long click

  • hb_rgb - homebridge RGB channel (using "R,G,B")

  • hb_rgb_state - homebridge RGB channel state (On/Off)

  • hb_white_level - homebridge white channel

  • hb_white_state - homebridge white channel state (On/Off)

  • rgb - control ledstrip RGB channels manually (using "R;G;B")

  • white - control ledstrip white channel manually

Homebridge configuration

{
    "comment": "-------------------------  RGBW 1  -------------------------",
    "type": "lightbulb",
    "name": "Лента 1",
    "topics": {
        "getOn": "/devices/ledstrip_1/controls/hb_white_state",
        "setOn": "/devices/ledstrip_1/controls/hb_white_state/on",
        "getBrightness": "/devices/ledstrip_1/controls/hb_white_level",
        "setBrightness": "/devices/ledstrip_1/controls/hb_white_level/on"
    },
    "integerValue": true,
    "accessory": "mqttthing"
},
{
    "type": "lightbulb",
    "name": "Лента 1 RGB",
    "topics": {
        "getOn": "/devices/ledstrip_1/controls/hb_rgb_state",
        "setOn": "/devices/ledstrip_1/controls/hb_rgb_state/on",
        "getRGB": "/devices/ledstrip_1/controls/hb_rgb",
        "setRGB": "/devices/ledstrip_1/controls/hb_rgb/on"
    },
    "integerValue": true,
    "accessory": "mqttthing"
},
{
    "comment": "-------------------------  RGBW 2  -------------------------",
    "type": "lightbulb",
    "name": "Лента 2",
    "topics": {
        "getOn": "/devices/ledstrip_2/controls/hb_white_state",
        "setOn": "/devices/ledstrip_2/controls/hb_white_state/on",
        "getBrightness": "/devices/ledstrip_2/controls/hb_white_level",
        "setBrightness": "/devices/ledstrip_2/controls/hb_white_level/on"
    },
    "integerValue": true,
    "accessory": "mqttthing"
},
{
    "type": "lightbulb",
    "name": "Лента 2 RGB",
    "topics": {
        "getOn": "/devices/ledstrip_2/controls/hb_rgb_state",
        "setOn": "/devices/ledstrip_2/controls/hb_rgb_state/on",
        "getRGB": "/devices/ledstrip_2/controls/hb_rgb",
        "setRGB": "/devices/ledstrip_2/controls/hb_rgb/on"
    },
    "integerValue": true,
    "accessory": "mqttthing"
}

Best regards