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

thingzi-logic-twinkly

v1.3.7

Published

Twinkly lights control via node red

Downloads

85

Readme

Twinkly lights integration for node red as its that time of year again!!

Supports on/off, brightness & color settings for local lights based on IP address. I originally made these nodes so i could attach the lights to my overall christmas timers and twinkly lights only have a single timer. I have since added some color control so my christmas tree turns red when my build pipeline fails :)

Usage

Enter the IP address of your twinkly lights in the address field. On deployment the ON/OFF state of the lights or an error will be shown on the node status. To control the lights...

  • Send ON or OFF in the 'payload' property to set the power state of the lights.
  • Send a value 0->100 in the 'brightness' property to set the brightness.
  • Send off, movie, effect or colorin the 'mode' property.
  • Send a color template in the 'color' property to set the led colors. 3 simple color modes are currently supported.

These nodes use the twinkly local API so your node red instance must be on the same local network. Also, as the API is not event based, you can use the twinkly-get node to read or poll the state 7 details of a light as required.

Color Template

The color template is a JSON object used to control the LEDs and has the following properties

  • mode, color mode to use, either...
    • solid LEDs are alternated along the length of the lights and remain static
    • blink All LEDs are set to the same color and transition through all colors.
    • Loop LEDs are alternated along the length of the lights and animated.
  • delay, time between each color change in ms. If using a larger number of steps, lower this value to change colours more quickly. Not used in solid mode.
  • steps, number of steps between each color change. Allows for smoother transitions between colours without the need to define each step manually.
  • colors, array of colours to use of the form [ R, G, B, W ]. If you only have RGB lights, W will be ignored or it can be ommitted.

The example below animates between red & blue using 10 steps. This results in 20 frames overall animating from red to blue and back to red again with 50ms between each frame.

{. 
    "mode": "blink",  
    "delay": 50,  
    "steps": 10,  
    "colors": [. 
        [ 255, 0, 0, 0 ],  
        [ 0, 0, 255, 0 ]. 
    ]. 
}. 

You can add as many colors or steps as required but there will be a limit to what the twinkly device can hold in memory which i havent tested yet.

If you like/use this node, coffee makes me happy and it keeps me coding when i should be sleeping...

Releases https://github.com/thingzi/thingzi-logic-twinkly/releases