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

node-red-contrib-time-controller

v0.0.17

Published

time controller node

Downloads

105

Readme

Time Controller

Time Controller is a node-red node for light controller (or other devices) that can fade the light or color channels in a specified time range. It is possible to control each channel separately or in rgb mode. It calculates the values depending on the start and end value and time.
The input values can be an integer or an array. The range doesn't matter, so it is possible to use percentages or rgb values or what ever you'd like.

Configuration

Data

At the moment Data is defined as an array of objects including the start time and value, the end time and value and the topic. The values can be an integer or an array of integers. It doesn't matter whether they are percentages or color values.
See example.json for a full set of a RGBWW controller.

Each object has the following format:

 {
    "start": {
        "time": "06:00:10",
        "value": 0
    },
    "end": {
        "time": "solarNoon",
        "offset": 10,
        "value": 78
    },
    "topic": "rgbw/cmnd/channel1"
},
{
   "start": {
       "time": "06:00",
       "value": [80, 50, 10, 100, 100]
   },
   "end": {
       "time": "solarNoon",
       "offset": 10,
       "value": [500, 50, 10, 1, 255]
   },
   "topic": "light-entity"
}

Example for the home-assistant call service node if the input is defined as array

Data:

{
    "rgbw_color": [
        "{{payload.0}}",
        "{{payload.1}}",
        "{{payload.2}}",
        "{{payload.3}}"
    ],
    "brightness": "{{payload.4}}"
}

Or:

{
    "brightness_pct": "{{payload.0}}",
    "color_temp": "{{payload.1}}"
}

Entity id:

{{topic}}

| data object | description | | -------------- | ---------------------------------------------------------------------------------| | start.time | start time, begin fading, "hh:mm:ss" or "suncalc event" | | start.offset | start offset in minutes, integer | | start.value | start value, integer or array [red, green, blue, brigthness, ...] | | end.time | end time, stop fading, "hh:mm:ss" or "suncalc event" | | end.offset | end offset in minutes, integer | | end.value | end value, integer or array [red, green, blue, brigthness, ...] | | topic | topic, e.q. a MQTT topic/ command like a channel or the light entity |

Interval

The interval in seconds to refresh the topics. Default: 1

Latitude and Longitude

The coordinates of the location to calculate the correct sun events.

Use previous state of event on reload

If enabled then the Time Controller will emit the state of the previous event. Default: false

Output type

If enabled then the input values must be in percentage and will be returned as color value (0 - 255).

possible suncalc events

https://github.com/mourner/suncalc

| sunclac event | datetime | | ---------------- | ------------------------ | | nadir | 2020-04-13T01:14:05.769Z | | nightEnd | 2020-04-13T04:14:23.086Z | | nauticalDawn | 2020-04-13T05:02:54.596Z | | dawn | 2020-04-13T05:46:23.778Z | | sunrise | 2020-04-13T06:21:37.913Z | | sunriseEnd | 2020-04-13T06:25:11.302Z | | goldenHourEnd | 2020-04-13T07:06:30.077Z | | solarNoon | 2020-04-13T13:14:05.769Z | | goldenHour | 2020-04-13T19:21:41.462Z | | sunsetStart | 2020-04-13T20:03:00.236Z | | sunset | 2020-04-13T20:06:33.626Z | | dusk | 2020-04-13T20:41:47.761Z | | nauticalDusk | 2020-04-13T21:25:16.942Z | | night | 2020-04-13T22:13:48.453Z |

Inputs

| msg.payload | description | | ----------------- | ------------------------------------------------- | | "on" | start the timecontroller interval | | "off" | stop the timecontroller interval | | "hh:mm:ss" | emit events at given time once without interval | | "suncalc event" | emit events at given time once without interval |

Programmatic Control

todo

Coming soon/ Todo

  • fullcalendar to define the time events in the frontend
  • programmatic control
  • instant on/ off events