New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-red-contrib-suncron

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-contrib-suncron

A Node-RED node that triggers configurable outgoing messages based on the position of the sun

  • 1.0.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
162
increased by7.28%
Maintainers
1
Weekly downloads
 
Created
Source

SunCron

A Node-RED node that can output configurable messages at significant sun events

Supported Sun Events

  • Sunrise
  • Sunrise End
  • Golden Hour End
  • Solar Noon
  • Golden Hour
  • Sunset Start
  • Sunset
  • Dusk
  • Nautical Dusk
  • Night
  • Nadir
  • Night End
  • Nautical Dawn
  • Dawn

Configuration

For each of the above sun events a distinct msg.payload and msg.topic can be configured. It is also possible to specify an offset to adjust the event time.

The location (lat / lon) can either be entered manually or retrieved automatically via the location button.

example

Outgoing messages

The node will eject messages at the specified times (respecting offsets), which will have a msg.payload and msg.topic as configured in the editor. Outgoing messages also have a schedule attribute containing an object with details about the schedule of the current date. The schedule contains only events which have been configured with a payload.

Each event has the following attributes:

  • event is the name of the sun event
  • sunEventTime refers to the unadjusted time of the respective sun event.
  • cronTime refers to the adjusted time, i.e. taking the offset into account.
  • offset referst to the configured offset in seconds.

Example msg.schedule object

{
  "sunrise": {
      "event": "sunrise",
      "sunEventTime": "2019-09-08T06:29:51",
      "cronTime": "2019-09-08T07:31:51",
      "offset": 0
  },
  "sunriseEnd": {
      "event": "sunriseEnd",
      "sunEventTime": "2019-09-08T06:33:24",
      "cronTime": "2019-09-08T03:33:24",
      "offset": 3600
  },
  "dawn": {
      "event": "dawn",
      "sunEventTime": "2019-09-08T05:54:49",
      "cronTime": "2019-09-08T06:54:49",
      "offset": -600
  }
  //...
}

Contributions and Suggestions

... are always welcome! Just file a GitHub issue or pull request!

Keywords

FAQs

Package last updated on 30 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc