2015-11-02 18:24:27 +01:00
|
|
|
node-red-node-timeswitch
|
|
|
|
========================
|
|
|
|
|
|
|
|
A <a href="http://nodered.org" target="_new">Node-RED</a> node to provide a
|
|
|
|
simple timeswitch node to schedule daily on/off events.
|
|
|
|
|
|
|
|
Install
|
|
|
|
-------
|
|
|
|
|
2016-03-02 14:27:48 +01:00
|
|
|
Run the following command in your Node-RED user directory - typically `~/.node-red`
|
2015-11-02 18:24:27 +01:00
|
|
|
|
|
|
|
npm install node-red-node-timeswitch
|
|
|
|
|
|
|
|
Usage
|
|
|
|
-----
|
|
|
|
|
2016-02-15 12:12:29 +01:00
|
|
|
Sets `msg.payload` to *1* during on times, and *0* during off times.
|
2015-11-02 18:24:27 +01:00
|
|
|
|
|
|
|
Also uses the suncalc module to allow use of dawn and dusk.
|
|
|
|
|
|
|
|
Dawn and dusk times can be offset both positively (+ve) for minutes after dawn
|
|
|
|
or dusk, and negatively (-ve) for minutes before dawn or dusk..
|
|
|
|
|
2016-02-15 12:12:29 +01:00
|
|
|
The output emits a `msg.payload` of *1* or *0* every minute depending on
|
2015-11-02 18:24:27 +01:00
|
|
|
whether the current time is during the selected on time or off time.
|
|
|
|
|
|
|
|
If you just need the transitions from 0->1 or 1->0 then follow this node with an RBE node.
|
|
|
|
|
2016-02-15 12:12:29 +01:00
|
|
|
You may also optionally specify a `msg.topic` if required.
|
2015-11-02 18:24:27 +01:00
|
|
|
|
|
|
|
**Note**: For a more complex version with more built-in options see Pete Scargill's
|
|
|
|
[node-red-contrib-bigtimer](http://flows.nodered.org/node/node-red-contrib-bigtimer) node.
|