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

@mschaeffler/node-red-dualled

v1.3.1

Published

control dual (CCT) LEDs.

Downloads

11

Readme

@mschaeffler/node-red-dualled

Two nodes to control dual (CCT) LEDs.

image of example flow

Install

$ npm install @mschaeffler/node-red-dualled

Usage

With this nodes you can control pairs of warm and cold leds (called dual leds or CCT leds), which are controled by two independant drivers, and use the feedback from the drivers.

ctrlDualLed

This node drives the dual led by calculating the individual brightness values. It works on base of topics so that with each different topic another led can be controlled.

Input

All inputs are stored in a node local context variable, to always output a complete data set.

|msg. | type | description | |:-------|:-------|:----------------------------------| |payload | string | on, off, toggle | | | boolean| switch on or off. | | | object | set turn, temp, brightness or transition according to key.|

Output

All values of the msg (incl. topic) are preserved, except the payload.

control warm LED

|msg. | type | description | |:-------|:-------|:----------------------------------| |payload.turn | string | on or off for the warm led.| |payload.brightness | number | brightness for the warm led.| |payload.transition | number | transition time. |

control cold LED

|msg. | type | description | |:-------|:-------|:----------------------------------| |payload.turn | string | on or off for the cold led.| |payload.brightness | number | brightness for the cold led.| |payload.transition | number | transition time. |

Parameters

|config| type | description | |:-----|:-------|:----------------------------------| | dual Led |confDualLed| configuration node to define one pair of dual LEDs.|

feedbackDualLed

This node converts brightness values of two individually controlled leds into a brightness / temp tuple.

Input

All input values are organized in objects with the parameters iWarm and iCold as indexes.

|msg. | type | description | |:-------|:-------|:----------------------------------| |payload.output[iWarm]| string | state of warm led. | |payload.output[iCold]| string | state of cold led. | |payload.brightness[iWarm]| number | brightness of warm led.| |payload.brightness[iCold]| number | brightness of cold led.| |payload.power[iWarm]| number | actual power of warm led.| |payload.power[iCold]| number | actual power of cold led.| |payload.energy[iWarm]| number | total energy of warm led.| |payload.energy[iCold]| number | total energy of cold led.|

{
    "output":{
        "Warm":"off",
        "Cold":"off"
    },
    "brightness":{
        "Warm":42,
        "Cold":38
    },
    "power":{
        "Warm":0,
        "Cold":0
    },
    "energy":{
        "Warm":45.56666666666667,
        "Cold":9.8
    }
}

Output

All values of the msg (incl. topic) are preserved, only this vales are chaged in the payload.

|msg. | type | description | |:-------|:-------|:----------------------------------| |payload.output| | output of warm led | |payload.brightness| summed brightness | |payload.temp| number | interpolated color temperature.| |payload.power| number | summed power of both leds. | |payload.energy| number | summed energy of both leds. |

Parameters

|config| type | description | |:-----|:-------|:----------------------------------| | dual Led |confDualLed| configuration node to define one pair of dual LEDs.| | Index Warm | string | Index to the payload properties for the warm led.| | Index Cold | string | Index to the payload properties for the cold led.|

confDualLed

This configuration node stores data about a dual white LED.

Parameters

|config| type | description | |:-----|:-------|:----------------------------------| | Temp_warm | number | Color temperature of the warm white LED.| | Temp_cold | number | Color temperature of the cold white LED.|

Example Flow

example flow

Author

Mathias Schäffler

License

LGPL-2.1