node-red-nodes/time/suncalc
Dave Conway-Jones 911f739005
fix suncalc not handling summer nights.
to Close #463
2018-07-17 10:24:40 +01:00
..
icons Start making non-red-nodes tolerant to missing payloads 2015-03-31 13:18:25 +01:00
79-suncalc.html bump suncalc package 2017-01-29 17:47:06 +00:00
79-suncalc.js fix suncalc not handling summer nights. 2018-07-17 10:24:40 +01:00
LICENSE Update licenses and packages for all nodes 2016-11-06 20:26:19 +00:00
README.md update parser and time nodes info style 2016-03-02 13:27:52 +00:00
package.json fix suncalc not handling summer nights. 2018-07-17 10:24:40 +01:00

README.md

node-red-node-suncalc

A Node-RED node to provide a signal at sunrise and sunset.

Install

Run the following command in your Node-RED user directory - typically ~/.node-red

npm install node-red-node-suncalc

Usage

Uses the suncalc npm to generate an output at sunrise and sunset based on a specified location.

Several choices of definition of sunrise and sunset are available, see the suncalc module for details.

The node provide two outputs. The first output emits a msg.payload of 1 or 0 every minute depending if day-time (1) or night-time (0).

The second output emits only on the transition between night to day (-> 1) or day to night (-> 0).

It also sets the msg.topic to sun and msg.moon to the fraction of the moon currently visible (a value between 0 for no moon and 1 for full moon).