Makes your RGB(W) controllable lights or ledstrips follow the sun color and a warm color at night. Also offers color animations (Disco & Rainbow)
This node offers the possibility to control the color of a RGBW ledstrip according to the time of day. This is done by calculating the angle of the sun with the horizon and project that on a color temperature scale. Therefore it is important to correctly configure your longitude and lattitude.
Typically you choose a color tempurature of around 1000K for sunrise/sunset (sun at horizon) and a color temperature around 5500K for the highest point of the sun.
But to tune it for your specific RGBW source you can tune these settings in the configuration. The white level is kept constant (for now) and can be configured too.
When the item is switched off, it will still update the RGBW colors, so that when the light source is switched on it will drectly be set to the correct colors.
The typical setup is shown below:
Also see this link for an importable version of the example.
Note: Minimum Node version is now at 14.x . It might work on earlier versions, but this is no longer tested or supported.
This example follows the rules below:
For instance the Inject Node offers this. Choose to provide the timestamp by interval to determine how often the colors will be updated.
This way you prevent the light source to come on each time when the colors are updated. This node is optimized to work directly with OpenHab2 nodes, but will work with any node as long as the topic is set to item-switch.
You can output RGBW separate components (port 1,2,3,4) and/or make use of the colorTemp output (port 5)
The current implementation will output percentages. If you need a range 0-255 you need to rescale. You do not need to use port 4 if you do not have a White channel.
The result will internally be caculated in Kelvin.
A second node within this package offers RGB animations. Currently 2 modes exist: disco (random colors) and rainbow (walking all possible colors)
First go to your .node-red directory, then run the command below (or just install from the palette manager)
npm install node-red-contrib-daylight-rgbw