1.1.1 • Published 3 years ago

node-red-contrib-time-switch v1.1.1

Weekly downloads
55
License
MIT
Repository
github
Last release
3 years ago

Project Stage License

Build Status Maintenance

Maintainability Coverage Status Dependencies Status

Node-RED Time Switch (Contribution package)

A simple Node-RED node that routes messages depending on the time or sun position.

Node

It is possible to specify a time, the sun position (requires your geo location to be configured) or even a value of the message, the flow or the instance of node red.

Config

Installation

Change directory to your node red installation and run the following command:

NPM

Configuration

The times can be a 24 hour time or a suncalc event:

TimeDescription
00:00 ... 23:5924hr time (without seconds)
sunrisesunrise (top edge of the sun appears on the horizon)
sunriseEndsunrise ends (bottom edge of the sun touches the horizon)
goldenHourEndmorning golden hour (soft light, best time for photography) ends
solarNoonsolar noon (sun is in the highest position)
goldenHourevening golden hour starts
sunsetStartsunset starts (bottom edge of the sun touches the horizon)
sunsetsunset (sun disappears below the horizon, evening civil twilight starts)
duskdusk (evening nautical twilight starts)
nauticalDusknautical dusk (evening astronomical twilight starts)
nightnight starts (dark enough for astronomical observations)
nadirnadir (darkest moment of the night, sun is in the lowest position)
nightEndnight ends (morning astronomical twilight starts)
nauticalDawnnautical dawn (morning nautical twilight starts)
dawndawn (morning nautical twilight ends, morning civil twilight starts)
{{msg.fieldName}}Access a field of the message (mustache template syntax)
{{flow.fieldName}}Access a field of the flow (mustache template syntax)
{{global.fieldName}}Access a global field (mustache template syntax)

Placeholders with prefix msg, flow or global are replaced by the corresponding field value.

Offsets

The start and end time can have an offset. You can use fields here aswell.

This is specified in minutes:

  • Negative numbers are bringing the time back. E.g. if the time is dusk and offset is -60, the start time will be 60 minutes before dusk.
  • Positive numbers are delaying the time by the specified number of minutes

The offset also supports placeholders:

PlaceholderDescription
{{msg.fieldName}}Access a field of the message (mustache template syntax)
{{flow.fieldName}}Access a field of the flow (mustache template syntax)
{{global.fieldName}}Access a global field (mustache template syntax)

Geo location

Specify the latitude and longitude of your geo location or use one of the followng placeolders as value:

PlaceholderDescription
{{msg.fieldName}}Access a field of the message (mustache template syntax)
{{flow.fieldName}}Access a field of the flow (mustache template syntax)
{{global.fieldName}}Access a global field (mustache template syntax)
1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.5-beta.1

4 years ago

1.0.4

5 years ago