Nectar of the Programming Masses
Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »


0.0.5 • Public • Published

A node for node-red that generates events based on the location of the Sun at the appropriate time of day.

Outputs an object called msg containing the event name in msg.payload and the event date & time in msg.datetime. The msg.topic can be set in the node's configuration or it will default to the node name or "sun events".

Calculations are performed using the excellent SunCalc module ( and the following sun events are output from this node:

  • sunrise: sunrise (top edge of the sun appears on the horizon)
  • sunriseEnd: sunrise ends (bottom edge of the sun touches the horizon)
  • goldenHourEnd: morning golden hour (soft light, best time for photography) ends
  • solarNoon: solar noon (sun is in the highest position)
  • goldenHour: evening golden hour starts
  • sunsetStart: sunset starts (bottom edge of the sun touches the horizon)
  • sunset: sunset (sun disappears below the horizon, evening civil twilight starts)
  • dusk: dusk (evening nautical twilight starts)
  • nauticalDusk: nautical dusk (evening astronomical twilight starts)
  • night: night starts (dark enough for astronomical observations)
  • nightEnd: night ends (morning astronomical twilight starts)
  • nauticalDawn: nautical dawn (morning nautical twilight starts)
  • dawn: dawn (morning nautical twilight ends, morning civil twilight starts)
  • nadir: nadir (darkest moment of the night, sun is in the lowest position)


npm i node-red-contrib-sunevents

Downloadsweekly downloads








last publish


  • avatar
Report a vulnerability