0.0.17 • Published 3 years ago

node-red-contrib-time-controller v0.0.17

Weekly downloads
27
License
MIT
Repository
github
Last release
3 years ago

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 objectdescription
start.timestart time, begin fading, "hh:mm:ss" or "suncalc event"
start.offsetstart offset in minutes, integer
start.valuestart value, integer or array [red, green, blue, brigthness, ...]
end.timeend time, stop fading, "hh:mm:ss" or "suncalc event"
end.offsetend offset in minutes, integer
end.valueend value, integer or array [red, green, blue, brigthness, ...]
topictopic, 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 eventdatetime
nadir2020-04-13T01:14:05.769Z
nightEnd2020-04-13T04:14:23.086Z
nauticalDawn2020-04-13T05:02:54.596Z
dawn2020-04-13T05:46:23.778Z
sunrise2020-04-13T06:21:37.913Z
sunriseEnd2020-04-13T06:25:11.302Z
goldenHourEnd2020-04-13T07:06:30.077Z
solarNoon2020-04-13T13:14:05.769Z
goldenHour2020-04-13T19:21:41.462Z
sunsetStart2020-04-13T20:03:00.236Z
sunset2020-04-13T20:06:33.626Z
dusk2020-04-13T20:41:47.761Z
nauticalDusk2020-04-13T21:25:16.942Z
night2020-04-13T22:13:48.453Z

Inputs

msg.payloaddescription
"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
0.0.17

3 years ago

0.0.16

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago