Socket
Socket
Sign inDemoInstall

node-red-contrib-sun-position

Package Overview
Dependencies
Maintainers
1
Versions
136
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-contrib-sun-position - npm Package Compare versions

Comparing version 1.0.9 to 1.0.11

13

CHANGELOG.md
# node-red-contrib-sun-position
#### 1.0.11: enhancement
- blind-control + clock-time + time-inject + within-time
- implement #92 additional date restriction
#### 1.0.10: bug fix
- general
- next try for #102
- sun-position + moon-position
- implements #81 - now it is possible to have `msg.latitude` and `msg.longitude` (or `msg.lat` and `msg.lon`) to override settings in configuration node. The configuration Node still needs to be configured properly.
#### 1.0.9: bug fix

@@ -4,0 +17,0 @@

112

nodes/clock-timer.js

@@ -76,7 +76,7 @@ /********************************************

* @param {*} node node data
* @param {Date} now the current timestamp
* @param {Date} dNow the current timestamp
* @param {number} expire the expiring time, (if it is NaN, default time will be tried to use) if it is not used, nor a Number or less than 1 no expiring activated
*/
function setExpiringOverwrite(node, now, expire) {
node.debug(`setExpiringOverwrite now=${now}, expire=${expire}`);
function setExpiringOverwrite(node, dNow, expire) {
node.debug(`setExpiringOverwrite now=${dNow}, expire=${expire}`);
if (node.timeOutObj) {

@@ -99,3 +99,3 @@ clearTimeout(node.timeOutObj);

}
node.timeClockData.overwrite.expireTs = (now.getTime() + expire);
node.timeClockData.overwrite.expireTs = (dNow.getTime() + expire);
node.timeClockData.overwrite.expireDate = new Date(node.timeClockData.overwrite.expireTs);

@@ -119,8 +119,8 @@ node.timeClockData.overwrite.expireDateISO = node.timeClockData.overwrite.expireDate.toISOString();

* @param {*} msg message object
* @param {*} now current timestamp
* @param {*} dNow current timestamp
*/
function checkOverrideReset(node, msg, now, prioOk) {
function checkOverrideReset(node, msg, dNow, prioOk) {
if (node.timeClockData.overwrite &&
node.timeClockData.overwrite.expires &&
(node.timeClockData.overwrite.expireTs < now.getTime())) {
(node.timeClockData.overwrite.expireTs < dNow.getTime())) {
timePosOverwriteReset(node);

@@ -331,2 +331,3 @@ }

* @param {*} rule the rule data
* @return {number} timestamp of the rule
*/

@@ -408,19 +409,34 @@ function getRuleTimeData(node, msg, rule, now) {

/**
* calculates the times
* @param {*} node node data
* @param {*} msg the message object
* @param {*} config the configuration object
* @returns the active rule or null
*/
function checkRules(node, msg, now, tempData) {
* check all rules and determinate the active rule
* @param {Object} node node data
* @param {Object} msg the message object
* @param {Date} dNow the *current* date Object
* @param {Object} tempData the object storing the temporary caching data
* @returns
*/
function checkRules(node, msg, dNow, tempData) {
// node.debug('checkRules --------------------');
const livingRuleData = {};
const nowNr = now.getTime();
const dayNr = now.getDay();
const dateNr = now.getDate();
const monthNr = now.getMonth();
const dayId = hlp.getDayId(now);
const nowNr = dNow.getTime();
const dayNr = dNow.getDay();
const dateNr = dNow.getDate();
const monthNr = dNow.getMonth();
const dayId = hlp.getDayId(dNow);
prepareRules(node, msg, tempData);
// node.debug(`checkRules now=${now.toISOString()}, nowNr=${nowNr}, rules.count=${node.rules.count}, rules.lastUntil=${node.rules.lastUntil}`); // {colors:true, compact:10}
// node.debug(`checkRules now=${dNow.toISOString()}, nowNr=${nowNr}, rules.count=${node.rules.count}, rules.lastUntil=${node.rules.lastUntil}`); // {colors:true, compact:10}
/**
* Timestamp compare function
* @name ICompareTimeStamp
* @function
* @param {number} timeStamp The timestamp which should be compared
* @returns {Boolean} return true if if the timestamp is valid, otherwise false
*/
/**
* function to check a rule
* @param {object} rule a rule object to test
* @param {ICompareTimeStamp} cmp a function to compare two timestamps.
* @returns {Object|null} returns the rule if rule is valid, otherwhise null
*/
const fktCheck = (rule, cmp) => {

@@ -455,9 +471,7 @@ // node.debug('rule ' + util.inspect(rule, {colors:true, compact:10}));

if (rule.timeDateStart || rule.timeDateEnd) {
rule.timeDateStart.setFullYear(now.getFullYear());
const startnum = rule.timeDateStart.getTime();
rule.timeDateEnd.setFullYear(now.getFullYear());
const endnum = rule.timeDateEnd.getTime();
if (endnum > startnum) {
rule.timeDateStart.setFullYear(dNow.getFullYear());
rule.timeDateEnd.setFullYear(dNow.getFullYear());
if (rule.timeDateEnd > rule.timeDateStart) {
// in the current year
if (nowNr < startnum || nowNr >= endnum) {
if (dNow < rule.timeDateStart || dNow > rule.timeDateEnd) {
return null;

@@ -467,3 +481,3 @@ }

// switch between year from end to start
if (nowNr < startnum && nowNr >= endnum) {
if (dNow < rule.timeDateStart && dNow > rule.timeDateEnd) {
return null;

@@ -473,5 +487,5 @@ }

}
const num = getRuleTimeData(node, msg, rule, now);
const num = getRuleTimeData(node, msg, rule, dNow);
// node.debug(`pos=${rule.pos} type=${rule.timeOpText} - ${rule.timeValue} - num=${num}- rule.timeData = ${ util.inspect(rule.timeData, { colors: true, compact: 40, breakLength: Infinity }) }`);
if (dayId === rule.timeData.dayId && num >=0 && cmp(num)) {
if (dayId === rule.timeData.dayId && num >=0 && (cmp(num) === true)) {
return rule;

@@ -533,3 +547,3 @@ }

}
const num = getRuleTimeData(node, msg, rule, now);
const num = getRuleTimeData(node, msg, rule, dNow);
if (num > nowNr) {

@@ -708,4 +722,3 @@ const diff = num - nowNr;

try {
node.debug(`--------- clock-timer - input msg.topic=${msg.topic} msg.payload=${msg.payload}`);
// node.debug('input ' + util.inspect(msg, { colors: true, compact: 10, breakLength: Infinity })); // Object.getOwnPropertyNames(msg)
node.debug(`--------- clock-timer - input msg.topic=${msg.topic} msg.payload=${msg.payload} msg.ts=${msg.ts}`);
if (!this.positionConfig) {

@@ -734,3 +747,3 @@ node.status({

node.reason.code = NaN;
const now = hlp.getNowTimeStamp(node, msg);
const dNow = hlp.getNowTimeStamp(node, msg);
if (node.autoTrigger) {

@@ -746,7 +759,7 @@ node.autoTrigger.time = node.autoTrigger.deaultTime;

};
// node.debug(`start pos=${node.payload.current} manual=${node.timeClockData.overwrite.active} reasoncode=${node.reason.code} description=${node.reason.description}`);
// check for manual overwrite
if (!checkTCPosOverwrite(node, msg, now)) {
if (!checkTCPosOverwrite(node, msg, dNow)) {
// calc times:
timeCtrl.rule = checkRules(node, msg, now, tempData);
timeCtrl.rule = checkRules(node, msg, dNow, tempData);
ruleId = timeCtrl.rule.id;

@@ -762,3 +775,3 @@ }

node.reason.state = RED._('clock-timer.states.startDelay');
node.reason.description = RED._('clock-timer.reasons.startDelay');
node.reason.description = RED._('clock-timer.reasons.startDelay', {dateISO:node.startDelayTimeOut.toISOString()});
}

@@ -924,2 +937,3 @@ setState(node.payload.current);

}
if (!rule.timeMonths || rule.timeMonths === '*') {

@@ -945,9 +959,12 @@ rule.timeMonths = null;

rule.timeDateStart = new Date(rule.timeDateStart);
rule.timeDateStart.setHours(0, 0, 0, 1);
} else {
rule.timeDateStart = new Date(2000,0,1);
rule.timeDateStart = new Date(2000,0,1,0, 0, 0, 1);
}
if (rule.timeDateEnd) {
rule.timeDateEnd = new Date(rule.timeDateEnd);
rule.timeDateStart.setHours(23, 59, 59, 999);
} else {
rule.timeDateStart = new Date(2000,11,31);
rule.timeDateStart = new Date(2000,11,31, 23, 59, 59, 999);
}

@@ -1001,18 +1018,9 @@ }

}
/* if (node.rules.data) {
node.rules.data.sort((a, b) => {
if (a.timeLimited && b.timeLimited) { // both are time limited
const top = (a.timeOp - b.timeOp);
if (top !== 0) { // from/until type different
return top; // from before until
}
}
return a.pos - b.pos;
});
node.debug('node.rules.data =' + util.inspect(node.rules.data, { colors: true, compact: 10, breakLength: Infinity }));
} */
if (node.autoTrigger || (node.startDelayTime)) {
const delay = node.startDelayTime || (30000 + Math.floor(Math.random() * 30000)); // 30s - 1min
node.startDelayTimeOut = new Date(Date.now() + delay);
setTimeout(() => {
delete node.startDelayTime;
delete node.startDelayTimeOut;
node.emit('input', {

@@ -1023,3 +1031,3 @@ topic: 'autoTrigger/triggerOnly/start',

});
}, node.startDelayTime || (20000 + Math.floor(Math.random() * 30000))); // 20s - 50s
}, delay);
}

@@ -1026,0 +1034,0 @@ }

@@ -350,5 +350,6 @@ /*

* @param {number} lng longitude for calculating sun-times
* @param {boolean} [inUTC] defines if the calculation should be in utc or local time (default is local)
* @return {suntimes} result object of sunTime
*/
SunCalc.getSunTimes = function (dateValue, lat, lng, noDeprecated) {
SunCalc.getSunTimes = function (dateValue, lat, lng, noDeprecated, inUTC) {
// console.log(`getSunTimes dateValue=${dateValue} lat=${lat}, lng=${lng}, noDeprecated=${noDeprecated}`);

@@ -361,5 +362,11 @@ if (isNaN(lat)) {

}
const t = new Date(dateValue);
if (inUTC) {
t.setUTCHours(12, 0, 0, 0);
} else {
t.setHours(12, 0, 0, 0);
}
const lw = rad * -lng;
const phi = rad * lat;
const d = toDays(dateValue);
const d = toDays(t.valueOf());
const n = julianCycle(d, lw);

@@ -622,5 +629,6 @@ const ds = approxTransit(0, lw, n);

* @param {number} lng longitude for calculating moon-times
* @param {boolean} [inUTC] defines if the calculation should be in utc or local time (default is local)
* @return {moontimes} result object of sunTime
*/
SunCalc.getMoonTimes = function (dateValue, lat, lng) {
SunCalc.getMoonTimes = function (dateValue, lat, lng, inUTC) {
if (isNaN(lat)) {

@@ -632,2 +640,9 @@ throw new Error('latitude missing');

}
const t = new Date(dateValue);
if (inUTC) {
t.setUTCHours(0, 0, 0, 0);
} else {
t.setHours(0, 0, 0, 0);
}
dateValue = t.valueOf();
// console.log(`getMoonTimes lat=${lat} lng=${lng} dateValue=${dateValue} t=${t}`);

@@ -634,0 +649,0 @@

@@ -171,3 +171,4 @@ {

"ruleMin": "__org__ (__level__ ist unter minimum) [__number__] __name__",
"ruleMax": "__org__ (__level__ ist über maximum) [__number__] __name__"
"ruleMax": "__org__ (__level__ ist über maximum) [__number__] __name__",
"startDelay": "verzögerter Start bis __dateISO__"
},

@@ -193,3 +194,4 @@ "states": {

"ruleMin": "__org__ [min rule __number__]",
"ruleMax": "__org__ [max rule __number__]"
"ruleMax": "__org__ [max rule __number__]",
"startDelay": "verzögerter Start"
},

@@ -196,0 +198,0 @@ "errors": {

@@ -98,3 +98,4 @@ {

"ruleMin": "__org__ (__level__ ist unter minimum) [__number__] __name__",
"ruleMax": "__org__ (__level__ ist über maximum) [__number__] __name__"
"ruleMax": "__org__ (__level__ ist über maximum) [__number__] __name__",
"startDelay": "verzögerter Start bis __dateISO__"
},

@@ -110,3 +111,4 @@ "states": {

"ruleMin": "__org__ [min rule __number__]",
"ruleMax": "__org__ [max rule __number__]"
"ruleMax": "__org__ [max rule __number__]",
"startDelay": "verzögerter Start"
},

@@ -113,0 +115,0 @@ "errors": {

@@ -51,5 +51,10 @@ {

"invalid-propertyStart-type": "Invalid Property Type for alternate start: __type__",
"invalid-propertyEnd-type": "Invalid Property Type for alternate end: __type__"
"invalid-propertyEnd-type": "Invalid Property Type for alternate end: __type__",
"invalid-day": "Tag ist nicht gültig.",
"invalid-month": "Monat ist nicht gewählt.",
"invalid-daterange": "Tag ist im nicht erlaubten Zeitraum.",
"only-odd-day": "Kein ungerader Tag!",
"only-even-day": "Kein gerader Tag"
}
}
}

@@ -172,3 +172,3 @@ {

"ruleMax": "__org__ (__level__ is above maximum) [__number__] __name__",
"startDelay": "node in startup"
"startDelay": "node in startup until __dateISO__"
},

@@ -175,0 +175,0 @@ "states": {

@@ -99,3 +99,3 @@ {

"ruleMax": "__org__ (__level__ is above maximum) [__number__] __name__",
"startDelay": "node in startup"
"startDelay": "node in startup until __dateISO__"
},

@@ -102,0 +102,0 @@ "states": {

@@ -77,5 +77,6 @@ {

"failed": "inject failed, see log for details",
"invalid-property-type": "Invalid Property Type: __type__"
"invalid-property-type": "Invalid Property Type: __type__",
"invalid-daterange": "Day is not in valid range."
}
}
}

@@ -65,2 +65,3 @@ {

"invalid-month": "Month is not selected.",
"invalid-daterange": "Day is not in valid range.",
"only-odd-day": "Not an odd Day!",

@@ -67,0 +68,0 @@ "only-even-day": "Not an even Day!"

@@ -45,3 +45,3 @@ /********************************************

ports[0] = RED.util.cloneMessage(msg);
ports[0].payload = this.positionConfig.getMoonCalc(now,false);
ports[0].payload = this.positionConfig.getMoonCalc(now,false, msg.latitude || msg.lat, msg.longitude || msg.lon);
ports[0].topic = this.topic;

@@ -48,0 +48,0 @@ if (!ports[0].payload.azimuth) {

@@ -41,3 +41,3 @@ /********************************************

let errorStatus = '';
const now = hlp.getNowTimeStamp(this, msg);
const dNow = hlp.getNowTimeStamp(this, msg);

@@ -56,3 +56,3 @@ if (!this.positionConfig) {

ports[0] = RED.util.cloneMessage(msg);
ports[0].payload = this.positionConfig.getSunCalc(now, true, false);
ports[0].payload = this.positionConfig.getSunCalc(dNow, true, false, msg.latitude || msg.lat, msg.longitude || msg.lon);
ports[0].topic = this.topic;

@@ -76,3 +76,5 @@ if (!ports[0].payload.azimuth) {

multiplier : node.startOffsetMultiplier,
now
now: dNow,
latitude: msg.latitude || msg.lat,
longitude: msg.longitude || msg.lon
});

@@ -98,3 +100,5 @@

multiplier : node.endOffsetMultiplier,
now
now: dNow,
latitude: msg.latitude || msg.lat,
longitude: msg.longitude || msg.lon
});

@@ -113,3 +117,3 @@

if (ports[0].payload.startTime && ports[0].payload.endTime) {
const nowMillis = now.getTime();
const nowMillis = dNow.getTime();
ports[0].payload.sunInSky = nowMillis > ports[0].payload.startTime && nowMillis < ports[0].payload.endTime;

@@ -116,0 +120,0 @@ }

@@ -21,4 +21,4 @@ /********************************************

function tsGetScheduleTime(time, limit) {
const now = new Date();
let millisec = time.getTime() - now.getTime();
const dNow = new Date();
let millisec = time.getTime() - dNow.getTime();
if (limit) {

@@ -173,2 +173,3 @@ while (millisec < limit) {

let errorStatus = '';
let warnStatus = '';
let isAltFirst = false;

@@ -183,3 +184,38 @@ let isFixedTime = true;

}
if (config.timedatestart || config.timedateend) {
let dStart, dEnd;
const dNow = new Date();
if (config.timedatestart) {
dStart = new Date(config.timedatestart);
dStart.setFullYear(dNow.getFullYear());
dStart.setHours(0, 0, 0, 0);
} else {
dStart = new Date(dNow.getFullYear(), 0, 0, 0, 0, 0, 1);
}
if (config.timedateend) {
dEnd = new Date(config.timedateend);
dEnd.setFullYear(dNow.getFullYear());
dEnd.setHours(23, 59, 59, 999);
} else {
dEnd = new Date(dNow.getFullYear(), 11, 31, 23, 59, 59, 999);
}
if (dStart < dEnd) {
// in the current year - e.g. 6.4. - 7.8.
if (dNow < dStart || dNow > dEnd) {
node.nextTime = new Date(dStart.getFullYear() + ((dNow >= dEnd) ? 1 : 0), dStart.getMonth(), dStart.getDate(), 0, 0, 1);
warnStatus = RED._('time-inject.errors.invalid-daterange') + ' [' + node.positionConfig.toDateString(node.nextTime)+ ']';
node.timeType = 'none';
node.timeAltType = 'none';
}
} else {
// switch between year from end to start - e.g. 2.11. - 20.3.
if (dNow < dStart && dNow > dEnd) {
node.nextTime = new Date(dStart.getFullYear(), dStart.getMonth(), dStart.getDate(), 0, 0, 1);
warnStatus = RED._('time-inject.errors.invalid-daterange') + ' [' + node.positionConfig.toDateString(node.nextTime)+ ']';
node.timeType = 'none';
node.timeAltType = 'none';
}
}
}
if (node.timeType !== 'none' && node.positionConfig) {

@@ -247,3 +283,3 @@ node.nextTimeData = node.positionConfig.getTimeProp(node, undefined, {

if (!hlp.isValidDate(node.nextTime)) {
hlp.handleError(this, 'Invalid time format', undefined, 'internal error!');
hlp.handleError(this, 'Invalid time format "' + node.nextTime + '"', undefined, 'internal error!');
return { state:'error', done: false, statusMsg: 'Invalid time format!', errorMsg: 'Invalid time format'};

@@ -336,2 +372,8 @@ }

// if an error occurred, will retry in 10 minutes. This will prevent errors on initialization.
} else if ((warnStatus !== '')) {
node.status({
fill: 'red',
shape: 'dot',
text: warnStatus + ((node.intervalObj) ? ' ↺🖩' : '')
});
} else if (node.nextTimeAlt && node.timeOutObj) {

@@ -383,3 +425,3 @@ if (isAltFirst) {

msg._srcid = node.id;
node.debug('input ');
node.debug('--------- time-inject - input');
doCreateTimeout(node);

@@ -386,0 +428,0 @@ msg.topic = config.topic;

@@ -115,3 +115,3 @@ /********************************************

*/
function calcWithinTimes(node, msg, config, now) {
function calcWithinTimes(node, msg, config, dNow) {
// node.debug('calcWithinTimes');

@@ -129,4 +129,4 @@ const result = {

if (config.timeDays && config.timeDays !== '*' && !config.timeDays.includes(now.getDay())) {
node.debug('invalid Day config. today=' + now.getDay() + ' timeDays=' + util.inspect(config.timeDays, Object.getOwnPropertyNames(config.timeDays)));
if (config.timeDays && config.timeDays !== '*' && !config.timeDays.includes(dNow.getDay())) {
node.debug('invalid Day config. today=' + dNow.getDay() + ' timeDays=' + util.inspect(config.timeDays, Object.getOwnPropertyNames(config.timeDays)));
result.warn = RED._('within-time-switch.errors.invalid-day');

@@ -137,4 +137,4 @@ return result;

const mn = config.timeMonths.split(',');
if (!mn.includes(now.getMonth())) {
node.debug('invalid Day config. today=' + now.getMonth() + ' timeMonths=' + util.inspect(config.timeMonths, Object.getOwnPropertyNames(config.timeMonths)));
if (!mn.includes(dNow.getMonth())) {
node.debug('invalid Day config. today=' + dNow.getMonth() + ' timeMonths=' + util.inspect(config.timeMonths, Object.getOwnPropertyNames(config.timeMonths)));
result.warn = RED._('within-time-switch.errors.invalid-month');

@@ -144,3 +144,33 @@ return result;

}
const dateNr = now.getDate();
if (config.timedatestart || config.timedateend) {
let dStart,dEnd;
if (config.timedatestart) {
dStart = new Date(config.timedatestart);
dStart.setFullYear(dNow.getFullYear());
dStart.setHours(0, 0, 0, 1);
} else {
dStart = new Date(dNow.getFullYear(), 0, 0, 0, 0, 0, 1);
}
if (config.timedateend) {
dEnd = new Date(config.timedateend);
dEnd.setFullYear(dNow.getFullYear());
dEnd.setHours(23, 59, 59, 999);
} else {
dEnd = new Date(dNow.getFullYear(), 11, 31, 23, 59, 59, 999);
}
if (dStart < dEnd) {
// in the current year - e.g. 6.4. - 7.8.
if (dNow < dStart || dNow > dEnd) {
result.warn = RED._('within-time-switch.errors.invalid-daterange');
return result;
}
} else {
// switch between year from end to start - e.g. 2.11. - 20.3.
if (dNow < dStart && dNow > dEnd) {
result.warn = RED._('within-time-switch.errors.invalid-daterange');
return result;
}
}
}
const dateNr = dNow.getDate();
if (node.timeOnlyOddDays && (dateNr % 2 === 0)) { // even

@@ -242,4 +272,4 @@ result.warn = RED._('within-time-switch.errors.only-odd-day');

function getScheduleTime(time) {
const now = new Date();
let millis = time.getTime() - now.getTime();
const dNow = new Date();
let millis = time.getTime() - dNow.getTime();
while (millis < 10) {

@@ -327,2 +357,3 @@ millis += 86400000; // 24h

try {
node.debug('--------- within-time-switch - input');
if (!node.positionConfig) {

@@ -329,0 +360,0 @@ node.error(RED._('node-red-contrib-sun-position/position-config:errors.pos-config'));

{
"name": "node-red-contrib-sun-position",
"version": "1.0.9",
"version": "1.0.11",
"description": "NodeRED nodes to get sun and moon position",

@@ -5,0 +5,0 @@ "keywords": [

@@ -19,50 +19,50 @@ # node-red-contrib-sun-position for NodeRED

## Table of contents
* [node-red-contrib-sun-position for NodeRED](#node-red-contrib-sun-position-for-nodered)
* [Table of contents](#table-of-contents)
* [Preconditions](#preconditions)
* [Installation](#installation)
* [General](#general)
* [Saving resources](#saving-resources)
* [second based accuracy](#second-based-accuracy)
* [Implemented Nodes](#implemented-nodes)
* [sun-position](#sun-position)
* [sun-position - Node settings](#sun-position---node-settings)
* [Node Input](#node-input)
* [sun-position - Node Output](#sun-position---node-output)
* [moon-position](#moon-position)
* [moon-position - Node settings](#moon-position---node-settings)
* [moon-position - Node Output](#moon-position---node-output)
* [time-inject](#time-inject)
* [time-inject - Node settings](#time-inject---node-settings)
* [time-inject - Node Input](#time-inject---node-input)
* [time-inject - Node Output](#time-inject---node-output)
* [time-inject - Node Status](#time-inject---node-status)
* [within-time](#within-time)
* [within-time - Node settings](#within-time---node-settings)
* [time-comp](#time-comp)
* [time-comp - Node settings](#time-comp---node-settings)
* [time-span](#time-span)
* [time-span - Node settings](#time-span---node-settings)
* [blind-control](#blind-control)
* [clock-timer](#clock-timer)
* [Times definitions](#times-definitions)
* [sun times](#sun-times)
* [remarks](#remarks)
* [blue hour](#blue-hour)
* [amateurDawn /amateurDusk](#amateurdawn-amateurdusk)
* [alternate properties](#alternate-properties)
* [moon times](#moon-times)
* [message, flow or global property or JSONATA expression](#message-flow-or-global-property-or-jsonata-expression)
* [input parse formats](#input-parse-formats)
* [output timestamp formats](#output-timestamp-formats)
* [output timespan formats](#output-timespan-formats)
* [Conditions](#conditions)
* [CHANGELOG](#changelog)
* [TODO](#todo)
* [Support, Bugs and Feedback](#support-bugs-and-feedback)
* [LICENSE](#license)
* [Other](#other)
- [node-red-contrib-sun-position for NodeRED](#node-red-contrib-sun-position-for-nodered)
- [Table of contents](#table-of-contents)
- [Preconditions](#preconditions)
- [Installation](#installation)
- [General](#general)
- [Saving resources](#saving-resources)
- [second based accuracy](#second-based-accuracy)
- [Implemented Nodes](#implemented-nodes)
- [sun-position](#sun-position)
- [sun-position - Node settings](#sun-position---node-settings)
- [sun-position - Node Input](#sun-position---node-input)
- [sun-position - Node Output](#sun-position---node-output)
- [moon-position](#moon-position)
- [moon-position - Node settings](#moon-position---node-settings)
- [moon-position - Node Input](#moon-position---node-input)
- [moon-position - Node Output](#moon-position---node-output)
- [time-inject](#time-inject)
- [time-inject - Node settings](#time-inject---node-settings)
- [time-inject - Node Input](#time-inject---node-input)
- [time-inject - Node Output](#time-inject---node-output)
- [time-inject - Node Status](#time-inject---node-status)
- [within-time](#within-time)
- [within-time - Node settings](#within-time---node-settings)
- [time-comp](#time-comp)
- [time-comp - Node settings](#time-comp---node-settings)
- [time-span](#time-span)
- [time-span - Node settings](#time-span---node-settings)
- [blind-control](#blind-control)
- [clock-timer](#clock-timer)
- [Times definitions](#times-definitions)
- [sun times](#sun-times)
- [remarks](#remarks)
- [blue hour](#blue-hour)
- [amateurDawn /amateurDusk](#amateurdawn-amateurdusk)
- [alternate properties](#alternate-properties)
- [moon times](#moon-times)
- [message, flow or global property or JSONATA expression](#message-flow-or-global-property-or-jsonata-expression)
- [input parse formats](#input-parse-formats)
- [output timestamp formats](#output-timestamp-formats)
- [output timespan formats](#output-timespan-formats)
- [Conditions](#conditions)
- [CHANGELOG](#changelog)
- [TODO](#todo)
- [Support, Bugs and Feedback](#support-bugs-and-feedback)
- [LICENSE](#license)
- [Other](#other)

@@ -113,6 +113,8 @@ ## Preconditions

#### Node Input
#### sun-position - Node Input
The Input is for triggering the calculation. If limits are defined the input message will send to the output associated to the limit.
It is possible that the incoming message have properties `msg.latitude` and `msg.longitude` (or `msg.lat` and `msg.lon`) defined to override settings in configuration node. The configuration Node still needs to be configured properly.
#### sun-position - Node Output

@@ -171,2 +173,8 @@

#### moon-position - Node Input
The Input is for triggering the calculation.
It is possible that the incoming message have properties `msg.latitude` and `msg.longitude` (or `msg.lat` and `msg.lon`) defined to override settings in configuration node. The configuration Node still needs to be configured properly.
#### moon-position - Node Output

@@ -299,3 +307,3 @@

* green
* the color opf the status is green, if the next trigger time is soon (< 36h).
* the color of the status is green, if the next trigger time is soon (< 36h).
* type of the status

@@ -679,10 +687,10 @@ * **dot** The next trigger time is normal time. (But that doesn't mean that an inject really takes place.)

- see [here the releases at npm](https://github.com/rdmtc/node-red-contrib-sun-position/releases).
- see [here the changelog of master](https://github.com/rdmtc/node-red-contrib-sun-position/blob/HEAD/CHANGELOG.md)
- see [here the changelog of dev](https://github.com/rdmtc/node-red-contrib-sun-position/blob/dev/CHANGELOG.md)
* see [here the releases at npm](https://github.com/rdmtc/node-red-contrib-sun-position/releases).
* see [here the changelog of master](https://github.com/rdmtc/node-red-contrib-sun-position/blob/HEAD/CHANGELOG.md)
* see [here the changelog of dev](https://github.com/rdmtc/node-red-contrib-sun-position/blob/dev/CHANGELOG.md)
## TODO
- [ ] add possibility to select input/output timezone
- [ ] Add new node time-control as a stripped down node of the blind control with only rules for control other devices like dimmer and thermostats
* [ ] add possibility to select input/output timezone
* [ ] Add new node time-control as a stripped down node of the blind control with only rules for control other devices like dimmer and thermostats

@@ -689,0 +697,0 @@ ## Support, Bugs and Feedback

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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