1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00
node-red-nodes/time/timeswitch
Dave Conway-Jones b33571b240 correct output for timeswitch
(simple typo)
Also tidied up info etc…
push to close #176
2016-02-15 11:12:29 +00:00
..
LICENSE Initial push of timeswitch node 2015-11-02 17:24:27 +00:00
package.json correct output for timeswitch 2016-02-15 11:12:29 +00:00
README.md correct output for timeswitch 2016-02-15 11:12:29 +00:00
timeswitch.html correct output for timeswitch 2016-02-15 11:12:29 +00:00
timeswitch.js correct output for timeswitch 2016-02-15 11:12:29 +00:00

node-red-node-timeswitch

A Node-RED node to provide a simple timeswitch node to schedule daily on/off events.

Install

Run the following command in the root directory of your Node-RED install. Usually this is ~/.node-red

    npm install node-red-node-timeswitch

Usage

Sets msg.payload to 1 during on times, and 0 during off times.

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..

The output emits a msg.payload of 1 or 0 every minute depending on 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.

You may also optionally specify a msg.topic if required.

Note: For a more complex version with more built-in options see Pete Scargill's node-red-contrib-bigtimer node.