# node-red-contrib-suncalcinput

> A Node-RED node to provide a signal at sunrise and sunset. Supports sepcifying position via input.

Latest version **1.0.0** (published 2018-04-03) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install node-red-contrib-suncalcinput
pnpm add node-red-contrib-suncalcinput
yarn add node-red-contrib-suncalcinput
bun add node-red-contrib-suncalcinput
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-04-03 |
| First published | 2018-04-03 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Magnus Spånggård |
| Maintainers | spanken |
| Keywords | node-red, suncalc, suncalcinput |

## Links

- npm: https://www.npmjs.com/package/node-red-contrib-suncalcinput
- Repository: https://github.com/technocreatives/node-red-contrib-suncalcinput
- Homepage: https://github.com/technocreatives/node-red-contrib-suncalcinput#readme
- Issues: https://github.com/technocreatives/node-red-contrib-suncalcinput/issues
- npm.io page: https://npm.io/package/node-red-contrib-suncalcinput

## Dependencies (1)

- [suncalc](https://npm.io/package/suncalc.md) ^1.8.0

## Recent versions

- 1.0.0 (latest) — 2018-04-03

## README

node-red-contrib-suncalcinput
=====================

A <a href="http://nodered.org" target="_new">Node-RED</a> node to provide a signal at sunrise and sunset. Where location can be changed with the input.

Install
-------

Run the following command in your Node-RED user directory - typically `~/.node-red`

    npm install node-red-contrib-suncalcinput


Usage
-----

Uses the suncalc npm to generate an output at sunrise and sunset based on a specified location.

Several choices of definition of sunrise and sunset are available, see the
<i><a href = "https://github.com/mourner/suncalc" target="_new">suncalc</a></i> module for details.

The node provide two outputs. The first output emits a `msg.payload` of <i>1</i> or <i>0</i> every minute
depending if day-time (1) or night-time (0).

The second output emits only on the transition between night to day (<i>-> 1</i>) or day to night (<i>-> 0</i>).

It also sets the `msg.topic` to <i>sun</i> and `msg.moon` to the fraction of the moon currently visible
(a value between 0 for no moon and 1 for full moon).</p>

The node provide one input. Setting `msg.lat` to latitude and `msg.lon` to longitude will change the position.

Acknowledgement
---------------

This node is based on <a href="https://github.com/node-red/node-red-nodes/tree/master/time/suncalc" target="_new">node-red-node-suncalc</a> which offers the same functionality except for the posibility to change position dynamically.

---
_Source: https://npm.io/package/node-red-contrib-suncalcinput · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
