2014-07-06 21:58:52 +02:00
|
|
|
node-red-node-suncalc
|
|
|
|
=====================
|
|
|
|
|
|
|
|
A <a href="http://nodered.org" target="_new">Node-RED</a> node to provide a signal at sunrise and sunset.
|
|
|
|
|
|
|
|
Install
|
|
|
|
-------
|
|
|
|
|
2016-03-02 14:27:48 +01:00
|
|
|
Run the following command in your Node-RED user directory - typically `~/.node-red`
|
2014-07-06 21:58:52 +02:00
|
|
|
|
|
|
|
npm install node-red-node-suncalc
|
|
|
|
|
|
|
|
|
|
|
|
Usage
|
|
|
|
-----
|
|
|
|
|
|
|
|
Uses the suncalc npm to generate an output at sunrise and sunset based on a specified location.
|
|
|
|
|
2016-02-15 12:12:29 +01:00
|
|
|
Several choices of definition of sunrise and sunset are available, see the
|
|
|
|
<i><a href = "https://github.com/mourner/suncalc" target="_new">suncalc</a></i> module for details.
|
2014-07-06 21:58:52 +02:00
|
|
|
|
2016-02-15 12:12:29 +01:00
|
|
|
The node provide two outputs. The first output emits a `msg.payload` of <i>1</i> or <i>0</i> every minute
|
|
|
|
depending if day-time (1) or night-time (0).
|
2014-07-06 21:58:52 +02:00
|
|
|
|
|
|
|
The second output emits only on the transition between night to day (<i>-> 1</i>) or day to night (<i>-> 0</i>).
|
|
|
|
|
2016-02-15 12:12:29 +01:00
|
|
|
It also sets the `msg.topic` to <i>sun</i> and `msg.moon` to the fraction of the moon currently visible
|
|
|
|
(a value between 0 for no moon and 1 for full moon).</p>
|