Socket
Socket
Sign inDemoInstall

node-red-contrib-sun-position

Package Overview
Dependencies
0
Maintainers
1
Versions
136
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.2 to 1.1.3

6

CHANGELOG.md
# node-red-contrib-sun-position
#### 1.1.3: maintenance
only documentation changes
- moved contents of the readme to the wiki
#### 1.1.2: BugFix

@@ -4,0 +10,0 @@

2

package.json
{
"name": "node-red-contrib-sun-position",
"version": "1.1.2",
"version": "1.1.3",
"description": "NodeRED nodes to get sun and moon position",

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

@@ -35,25 +35,3 @@ # node-red-contrib-sun-position for NodeRED

- [second based accuracy](#second-based-accuracy)
- [base functions for all (or the most of the nodes)](#base-functions-for-all-or-the-most-of-the-nodes)
- [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)
- [Documentation of the nodes](#documentation-of-the-nodes)
- [CHANGELOG](#changelog)

@@ -83,326 +61,17 @@ - [TODO](#todo)

## base functions for all (or the most of the nodes)
## Documentation of the nodes
see [here](base_functions.md)
The documentation of the nodes is moved to the [wiki](https://github.com/rdmtc/node-red-contrib-sun-position/wiki):
## Implemented Nodes
- [base functions for all (or the most of the nodes)](https://github.com/rdmtc/node-red-contrib-sun-position/wiki/Base-Functions)
- [Implemented Nodes](https://github.com/rdmtc/node-red-contrib-sun-position/wiki)
- [sun-position](https://github.com/rdmtc/node-red-contrib-sun-position/wiki/moon-position)
- [moon-position](https://github.com/rdmtc/node-red-contrib-sun-position/wiki/moon-position)
- [time-inject](https://github.com/rdmtc/node-red-contrib-sun-position/wiki/time-inject)
- [within-time](https://github.com/rdmtc/node-red-contrib-sun-position/wiki/within-time)
- [time-comp](https://github.com/rdmtc/node-red-contrib-sun-position/wiki/time-comp)
- [time-span](https://github.com/rdmtc/node-red-contrib-sun-position/wiki/time-span)
- [blind-control](https://github.com/rdmtc/node-red-contrib-sun-position/wiki/blind-control)
- [clock-timer](https://github.com/rdmtc/node-red-contrib-sun-position/wiki/clock-timer)
- within-time a switch node, which forwards a message only within a certain period of time.The beginning and the end can also be sunset, sunrise, moonset, moonrise or any other sun times.
- time-inject a inject node, which can send a message on a specified time, which can also be a sun or moon time.
- sun-position a node which calculates sun position. Can be used as a switch node for specific azimuth of the sun.
- moon-position a node which calculates moon position and phases. Can be used as a switch node for specific azimuth of the sun.
### sun-position
The node calculates the current sun position on any input message. This node is compatible to [node-red-contrib-blindcontroller](https://github.com/alisdairjsmyth/node-red-contrib-blindcontroller).
![sun-position-example](https://user-images.githubusercontent.com/12692680/57134504-aa429600-6da6-11e9-9e36-7d1eb80f5589.png)
```json
[{"id":"fc962ea1.197a3","type":"inject","z":"de4e9c38.0d942","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":300,"wires":[["56265aeb.99f034"]]},{"id":"a0d0e562.7ad1d8","type":"debug","z":"de4e9c38.0d942","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":570,"y":300,"wires":[]},{"id":"56265aeb.99f034","type":"sun-position","z":"de4e9c38.0d942","name":"","positionConfig":"2831ba70.55a636","rules":[{"valueLow":"10","valueLowType":"num","valueHigh":"100","valueHighType":"num"}],"onlyOnChange":"true","topic":"","outputs":2,"x":330,"y":300,"wires":[["a0d0e562.7ad1d8","9cc2d51.4ac0828","28e91.9d63d16f6"],["e921e01a.a0fa3"]]},{"id":"9cc2d51.4ac0828","type":"change","z":"de4e9c38.0d942","name":"azimuth","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.azimuth","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":340,"wires":[["e866e950.a7f798"]]},{"id":"28e91.9d63d16f6","type":"change","z":"de4e9c38.0d942","name":"altitude","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.altitude","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":380,"wires":[["5b085e1b.4ec8a"]]},{"id":"e921e01a.a0fa3","type":"debug","z":"de4e9c38.0d942","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":550,"y":420,"wires":[]},{"id":"e866e950.a7f798","type":"debug","z":"de4e9c38.0d942","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":750,"y":340,"wires":[]},{"id":"5b085e1b.4ec8a","type":"debug","z":"de4e9c38.0d942","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":750,"y":380,"wires":[]},{"id":"2831ba70.55a636","type":"position-config","z":"","name":"Kap-Halbinsel","longitude":"-34.357051","latitude":"18.473782","angleType":"deg"}]
```
#### sun-position - Node settings
![sun-position-settings](https://user-images.githubusercontent.com/12692680/57134503-aa429600-6da6-11e9-945b-aa7b6d750267.png)
- **Position** connects to the central configuration node, which contains the current position, but also handles internal shared functions
- **Topic** defines the topic of the first output
- **position container** here you can define multiple lower and upper limits for azimuth. If the calculated value of the azimuth is inside the defined limit the input message will send to the associated output.
- **Name** name of the Node
#### 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
- **first output**
- `msg.payload.azimuth` the azimuth of the sun position relative to the given coordinates.
- `msg.payload.altitude` the altitude/elevation of the sun position relative to the given coordinates.
- `msg.payload.times` the sun times as object.
- `msg.payload.times.astronomicalDawn` night ends (morning astronomical twilight starts)
- `msg.payload.times.amateurDawn` amateur astronomical dawn (sun at 12° before sunrise)
- `msg.payload.times.nauticalDawn` nautical dawn (morning nautical twilight starts)
- `msg.payload.times.blueHourDawnStart` blue Hour start (time for special photography photos starts)
- `msg.payload.times.civilDawn` dawn (morning nautical twilight ends, morning civil twilight starts)
- `msg.payload.times.blueHourDawnEnd` blue Hour end (time for special photography photos starts)
- `msg.payload.times.sunrise` sunrise (top edge of the sun appears on the horizon)
- `msg.payload.times.sunriseEnd` sunrise ends (bottom edge of the sun touches the horizon)
- `msg.payload.times.goldenHourDawnEnd` morning golden hour (soft light, best time for photography) ends
- `msg.payload.times.solarNoon` solar noon (sun is in the highest position)
- `msg.payload.times.goldenHourDuskStart` evening golden hour starts
- `msg.payload.times.sunsetStart` sunset starts (bottom edge of the sun touches the horizon)
- `msg.payload.times.sunset` sunset (sun disappears below the horizon, evening civil twilight starts)
- `msg.payload.times.blueHourDuskStart` nautical dusk start (evening astronomical twilight starts)
- `msg.payload.times.civilDusk` dusk (evening nautical twilight starts)
- `msg.payload.times.blueHourDuskEnd` nautical dusk end (evening astronomical twilight starts)
- `msg.payload.times.amateurDusk` amateur astronomical dusk (sun at 12° after sunrise)
- `msg.payload.times.astronomicalDusk` night starts (dark enough for astronomical observations)
- `msg.payload.times.nadir` nadir (darkest moment of the night, sun is in the lowest position)
- `msg.payload.pos` array with a boolean of every defined limit of the azimuth, which is _true_ if the azimuth is inside the limit.
- `msg.payload.posChanged` boolean which is true if any of the defined limit of the azimuth has changed to the last calculation.
- `msg.payload.startTime` if a start time is defined the start timestamp (inclusive of offset).
- `msg.payload.endTime` if a end time is defined the end timestamp (inclusive of offset).
- `msg.payload.sunInSky` if a start and an end time is defined a boolean value indicating whether it is currently considered daylight hours.
- `msg.payload.altitudePercent` gives the altitude in percent between horizon (0%) and solar noon (100%) (will not calculated if sun position for a time is calculated which is not today or tomorrow).
- **second output** to **... output** if limits for azimuth are defined the incoming message will send to this output. It adds a `msg.posChanged` property of type _boolean_ which is true if in the previous calculation no message was send to this output.
### moon-position
The node calculates the current sun position on any input message.
![moon-position-example](https://user-images.githubusercontent.com/12692680/57134922-f6daa100-6da7-11e9-91f7-6f33ab997df5.png)
```json
[{"id":"d99ac08d.fdb94","type":"moon-position","z":"de4e9c38.0d942","name":"","positionConfig":"2831ba70.55a636","rules":[],"outputs":1,"topic":"","x":340,"y":520,"wires":[["e5e8e9a1.6080e8","e9ec273d.d90168","45563d84.0c4bf4","cce94ccc.b2dd2","65c76f28.3dd49","ac44c210.86465","f2deae49.60015","a9e0a2d1.0633a","948f6e2.8a4a39","cc85e458.447ba8","bff5a621.3fb498"]]},{"id":"124bfd72.dcb2f3","type":"inject","z":"de4e9c38.0d942","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":520,"wires":[["d99ac08d.fdb94"]]},{"id":"e5e8e9a1.6080e8","type":"debug","z":"de4e9c38.0d942","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":590,"y":520,"wires":[]},{"id":"e9ec273d.d90168","type":"change","z":"de4e9c38.0d942","name":"azimuth","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.azimuth","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":560,"wires":[[]]},{"id":"45563d84.0c4bf4","type":"change","z":"de4e9c38.0d942","name":"altitude","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.altitude","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":600,"wires":[[]]},{"id":"cce94ccc.b2dd2","type":"change","z":"de4e9c38.0d942","name":"distance","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.distance","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":640,"wires":[[]]},{"id":"65c76f28.3dd49","type":"change","z":"de4e9c38.0d942","name":"parallacticAngle","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.parallacticAngle","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":680,"wires":[[]]},{"id":"ac44c210.86465","type":"change","z":"de4e9c38.0d942","name":"illumination angle","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.illumination.angle","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":720,"wires":[[]]},{"id":"f2deae49.60015","type":"change","z":"de4e9c38.0d942","name":"illumination fraction","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.illumination.fraction","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":760,"wires":[[]]},{"id":"a9e0a2d1.0633a","type":"change","z":"de4e9c38.0d942","name":"illumination phase","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.illumination.phase.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":800,"wires":[[]]},{"id":"948f6e2.8a4a39","type":"change","z":"de4e9c38.0d942","name":"illumination phase angle","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.illumination.phase.angle","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":840,"wires":[[]]},{"id":"bff5a621.3fb498","type":"change","z":"de4e9c38.0d942","name":"illumination zenithAngle","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.illumination.zenithAngle","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":920,"wires":[[]]},{"id":"cc85e458.447ba8","type":"change","z":"de4e9c38.0d942","name":"illumination phase name","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.illumination.phase.name","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":880,"wires":[[]]},{"id":"2831ba70.55a636","type":"position-config","z":"","name":"Kap-Halbinsel","longitude":"-34.357051","latitude":"18.473782","angleType":"deg"}]
```
#### moon-position - Node settings
![moon-position-settings](https://user-images.githubusercontent.com/12692680/57134923-f6daa100-6da7-11e9-9e1d-a49ecfc4bbcc.png)
- **Position** connects to the central configuration node, which contains the current position, but also handles internal shared functions
- **Topic** defines the topic of the first output
- **position container** here you can define multiple lower and upper limits for azimuth. If the calculated value of the azimuth is inside the defined limit the input message will send to the associated output.
- **Name** name of the Node
#### 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
- **first output**
- `msg.payload.azimuth` the azimuth of the moon position relative to the given coordinates.
- `msg.payload.altitude` the altitude/elevation of the moon position relative to the given coordinates.
- `msg.payload.distance` the distance of the moon.
- `msg.payload.parallacticAngle` the parallacticAngle of the moon.
- `msg.payload.illumination` the illumination of the moon as object.
- `msg.payload.illumination.angle` the illumination angle of the moon.
- `msg.payload.illumination.fraction` the illumination fraction angle of the moon.
- `msg.payload.illumination.zenithAngle` the illumination zenith angle of the moon.
- `msg.payload.illumination.phase` the illumination phase of the moon as object.
- `msg.payload.illumination.phase.value` the current phase of the moon in percent, where 0%/100% is New Moon, from 0% to 50% is growing, 50% is Full Moon and >50% is decreasing.
- `msg.payload.illumination.phase.angle` the current phase angle of the moon.
- `msg.payload.illumination.phase.emoji` the emoji of the current phase of the moon.
- `msg.payload.illumination.phase.code` the code of the emoji for the current phase of the moon.
- `msg.payload.illumination.phase.name` the name of the current phase of the moon.
- `msg.payload.times` the moon times as object.
- `msg.payload.times.rise` the moon rise time.
- `msg.payload.times.set` the moon set time.
- `msg.payload.times.alwaysUp` boolean which is _true_ if the moon never rises/sets and is always above the horizon during the day.
- `msg.payload.times.alwaysDown` boolean which is _true_ if the moon is always below the horizon.
- `msg.payload.pos` array with a boolean of every defined limit of the azimuth, which is _true_ if the azimuth is inside the limit.
- `msg.payload.posChanged` boolean which is true if any of the defined limit of the azimuth has changed to the last calculation.
```json
{
"lastUpdate": "2018-11-11T11:11:11.111Z",
"latitude": "18.473782",
"longitude": "-34.357051",
"angleType": "deg",
"azimuth": 108.71205459404247,
"altitude": -9.578482237780767,
"distance": 400811.8001636167,
"parallacticAngle": -73.92702172116152,
"illumination": {
"angle": -94.27663428960696,
"fraction": 0.14981886026806135,
"phase": {
"emoji": "🌒",
"code": ":waxing_crescent_moon:",
"name": "Waxing Crescent",
"weight": 6.3825,
"value": 0.12651089732280724,
"angle": 45.54392303621061
},
"zenithAngle": -20.349612568445437
},
"times": {
"rise": "2018-11-11T11:44:22.877Z",
"set": "2018-11-11T23:10:07.389Z",
"alwaysUp": false,
"alwaysDown": false
},
"pos": [],
"posChanged": false
}
```
- **second output** to **... output** if limits for azimuth are defined the incoming message will send to this output. It adds a `msg.payload.posChanged` property of type _boolean_ which is true if the limit has changed since the last azimuth calculation.
### time-inject
Injects a message into a flow either manually or at timestamps which can also depending on the sunset, sunrise, or moon set and rise. The message payload can be a variety of types, including strings, JavaScript objects, the current time or the current sun or moon position.
![time-inject-example](https://user-images.githubusercontent.com/12692680/57134517-b4fd2b00-6da6-11e9-914a-30741c285426.png)
```json
[{"id":"d3c04d4e.ce3e3","type":"debug","z":"de4e9c38.0d942","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":570,"y":2100,"wires":[]},{"id":"586e4ae2.5b4f14","type":"debug","z":"de4e9c38.0d942","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":570,"y":2160,"wires":[]},{"id":"1b71d0e5.35b02f","type":"debug","z":"de4e9c38.0d942","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":570,"y":2220,"wires":[]},{"id":"3e4d36c0.620e7a","type":"time-inject","z":"de4e9c38.0d942","name":"","positionConfig":"bdf7c4a.9ca6c38","time":"nadir","timeType":"pdsTime","timeDays":"*","offset":0,"offsetMultiplier":60,"payload":"","payloadType":"date","topic":"","x":320,"y":2100,"wires":[["d3c04d4e.ce3e3"]]},{"id":"c11713e.db07ef","type":"time-inject","z":"de4e9c38.0d942","name":"","positionConfig":"bdf7c4a.9ca6c38","time":"dawn","timeType":"pdsTime","timeDays":"*","offset":0,"offsetMultiplier":60,"payload":"","payloadType":"date","topic":"","x":320,"y":2160,"wires":[["586e4ae2.5b4f14"]]},{"id":"b227cadc.dcf8c8","type":"time-inject","z":"de4e9c38.0d942","name":"","positionConfig":"bdf7c4a.9ca6c38","time":"rise","timeType":"pdmTime","timeDays":"1,4,0","offset":0,"offsetMultiplier":60,"payload":"{\"bool\":true}","payloadType":"json","topic":"","x":340,"y":2220,"wires":[["1b71d0e5.35b02f"]]},{"id":"bdf7c4a.9ca6c38","type":"position-config","z":"","name":"","longitude":"13.71587","latitude":"51.01732","angleType":"deg"}]
```
#### time-inject - Node settings
![time-inject-settings](https://user-images.githubusercontent.com/12692680/57134518-b4fd2b00-6da6-11e9-891a-d62b271b1de3.png)
- **Position** connects to the central configuration node, which contains the current position, but also handles internal shared functions
- **Payload** defines the payload of the message object send to the output
- Compared to the standard inject node, this node has more options for the payload see [Possible Node Output Formats](base_functions.m#possible-node-output-formats) for these options.
- **Topic** defines the topic of the send message
- **Time** An optional property that can be [configured](base_functions.m#times-definitions) when the inject node should emit a message on that timestamp.
- if a time is choose additional settings available
![image](https://user-images.githubusercontent.com/12692680/75716979-8c98d280-5cd0-11ea-9563-5375b7bac53e.png)
- **Offset** An optional property which is only available if an time is chosen. The offset can be a positive or negative and defines a time offset to the chosen time.
- **valid days** There can be defined on which days a msg should be emitted.
- **special days** There can be defined if the msg should only be emitted on even or odd days.
- **valid month** There can be defined on which month a msg should be emitted.
- **valid date range** There can be defined if the message should be only emitted between two dates. The defined year will be ignored. There are two options:
- starting day.month is less than end day.month - then the start and end date will be every time the current year
- end day.month is less than start day.month then the message will be send this year from 1.1. to end month and year and from starting date to end month and day next year
- **Property** _optional_ here can be defined a [condition](base_functions.m#conditions) under which a alternate time should be used.
- **Alternate time** _optional_ defines an alternate start time which will be used if the condition applies. This can be used for different times for example of holidays/weekend.
- **Additional Inject on Start** If this checkbox is set the inject node can emit the message on Node-Red Start or on any deploy of this node. There can be defined a delay after the emit should be done. This can be useful for initializing any flow.
- **Set additional** With this selection you can
- set __global__, __flow__ context or set additional property of the message object (if the property is __payload__ the payload will be overridden.)
- for any timestamp properties like __timestamp__, __sun time__, __moon time__ there are a lot of possibilities to influence this. You can add an offset or select the days wherefore the timestamp should be calculated. The output format could be Unix, ECMA timestamp, object or the time difference between timestamp and emit the message. This is useful to to send a payload of true on sunset with an additional message property as __on time__ with the seconds until sunrise. see [Possible Node Output Formats](base_functions.m#possible-node-output-formats) for possible information
#### time-inject - Node Input
It has only a button as input, where the massage could injected into a flow manually.
#### time-inject - Node Output
The output is a message with the defined payload and topic in the settings.
#### time-inject - Node Status
- red on error
- green
- the color of the status is green, if the next trigger time is soon (< 36h).
- type of the status
- **dot** The next trigger time is normal time. (But that doesn't mean that an inject really takes place.)
- **ring** The next trigger time is alternate time. (But that doesn't mean that an inject really takes place.)
- blue
- the next trigger (alternate or normal time) is far in the future (>36h).
- type of the status
- **dot** The next trigger time is normal time. (But that doesn't mean that an inject really takes place.)
- **ring** The next trigger time is alternate time. (But that doesn't mean that an inject really takes place.)
### within-time
![within-time-example](https://user-images.githubusercontent.com/12692680/57134524-b595c180-6da6-11e9-9208-a5c7cb89d2db.png)
```json
[{"id":"bd9bd279.302eb","type":"inject","z":"de4e9c38.0d942","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":1180,"wires":[["b5c283be.eb945"]]},{"id":"273eb4cb.2715fc","type":"debug","z":"de4e9c38.0d942","name":"out1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":590,"y":1180,"wires":[]},{"id":"78f068d6.2fe9f8","type":"debug","z":"de4e9c38.0d942","name":"out2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":590,"y":1220,"wires":[]},{"id":"b5c283be.eb945","type":"within-time-switch","z":"de4e9c38.0d942","name":"","positionConfig":"bdf7c4a.9ca6c38","startTime":"7:00","startTimeType":"entered","startOffset":0,"startOffsetMultiplier":"60","endTime":"9:00","endTimeType":"entered","endOffset":0,"endOffsetMultiplier":"60","property":"","propertyType":"none","startTimeAlt":"","startTimeAltType":"none","startOffsetAlt":0,"startOffsetAltMultiplier":"60","endTimeAlt":"","endTimeAltType":"none","endOffsetAlt":0,"endOffsetAltMultiplier":"60","x":330,"y":1180,"wires":[["273eb4cb.2715fc"],["78f068d6.2fe9f8"]]},{"id":"bdf7c4a.9ca6c38","type":"position-config","z":"","name":"","longitude":"13.71587","latitude":"51.01732","angleType":"deg"}]
```
#### within-time - Node settings
A simple node that routes messages depending on the time. If the current time falls within the range specified in the node configuration, the message is routed to output 1. Otherwise the message is routed to output 2.
![within-time-settings](https://user-images.githubusercontent.com/12692680/57134525-b62e5800-6da6-11e9-9946-2c6873592026.png)
- **Position** connects to the central configuration node, which contains the current position, but also handles internal shared functions
- **Start time** defines the start time of the time range with with different [configuration possibilities](base_functions.m#times-definitions)
- **Start Offset** allows to define a positive or negative offset in *seconds*, *minutes* or *hours* to the given **Start Time**. This will be useful for sun based times.
- **End time** defines the end time of the time range with with different [configuration possibilities](base_functions.m#times-definitions)
- **End Offset** allows to define a positive or negative offset in *seconds*, *minutes* or *hours* to the given **End Time**. This will be useful for sun based times.
- **Alternate start time** _optional_ defines an alternate start time of the time range which will be used if the [conditions](base_functions.m#conditions) matches. This can be used for different times for example of holidays.
- **Start time** alternate start time
- **Start Offset** offset for the alternate start time
- **Alternate end time** _optional_ defines an alternate end time of the time range which will be used if the [conditions](base_functions.m#conditions) matches. This can be used for different times for example of holidays.
- **End time** alternate end time
- **End Offset** offset for the alternate end time
- **resend start** If this checkbox is checked and a message arrived outside of time, this message will be additional send again some milliseconds after next start time point. This option is only for fixed time definitions available.
- **resend end** If this checkbox is checked and a message arrived within time, this message will be additional send again some milliseconds after next end time point. This option is only for fixed time definitions available.
### time-comp
A enhanced node for time format change and time comparison.
![time-comp-example](https://user-images.githubusercontent.com/12692680/57134514-b4649480-6da6-11e9-9321-9fd1a2927a9b.png)
```json
[{"id":"1a6b5f99.4c928","type":"time-comp","z":"4e9a710a.bf0b9","outputs":1,"name":"","positionConfig":"d9e9ca6a.952218","input":"payload","inputType":"msg","inputFormat":"0","inputOffset":0,"inputOffsetMultiplier":60,"rules":[],"checkall":"true","result1":"payload","result1Type":"msg","result1Value":"","result1ValueType":"input","result1Format":"5","result1Offset":0,"result1OffsetMultiplier":60,"x":350,"y":120,"wires":[["fd45b2d2.eba89"]]},{"id":"fd45b2d2.eba89","type":"debug","z":"4e9a710a.bf0b9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":570,"y":120,"wires":[]},{"id":"f390b758.7dd9b8","type":"inject","z":"4e9a710a.bf0b9","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":120,"wires":[["1a6b5f99.4c928"]]},{"id":"b87a5c79.d4ce3","type":"comment","z":"4e9a710a.bf0b9","name":"change Unix Timestamp to ISO","info":"","x":210,"y":80,"wires":[]},{"id":"20afdf5d.4cd8d","type":"comment","z":"4e9a710a.bf0b9","name":"compare Time","info":"","x":150,"y":180,"wires":[]},{"id":"3d8ee66c.7c86ea","type":"inject","z":"4e9a710a.bf0b9","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":240,"wires":[["f19f0fd9.8ad1d"]]},{"id":"f19f0fd9.8ad1d","type":"time-comp","z":"4e9a710a.bf0b9","outputs":3,"name":"","positionConfig":"d9e9ca6a.952218","input":"payload","inputType":"msg","inputFormat":"0","inputOffset":0,"inputOffsetMultiplier":60,"rules":[{"operator":"5","operatorType":"11,12,13,14,15,16,17,18","operatorText":"","operandType":"str","operandValue":"12:00","format":"ddd MMM dd yyyy HH:mm:ss","formatSelection":"0","offsetType":"none","offsetValue":"","propertyType":"none","propertyValue":""},{"operator":"3","operatorType":"11,12,13,14,15,16,17,18","operatorText":"","operandType":"str","operandValue":"15:00","format":"ddd MMM dd yyyy HH:mm:ss","formatSelection":"0","offsetType":"none","offsetValue":"","propertyType":"none","propertyValue":""}],"checkall":"true","result1":"payload","result1Type":"msg","result1Value":"","result1ValueType":"input","result1Format":"5","result1Offset":0,"result1OffsetMultiplier":60,"x":350,"y":240,"wires":[["723d7d7c.e7a874"],["44ac03f7.fd68fc"],["4d8512cd.73c90c"]]},{"id":"723d7d7c.e7a874","type":"debug","z":"4e9a710a.bf0b9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":570,"y":220,"wires":[]},{"id":"44ac03f7.fd68fc","type":"debug","z":"4e9a710a.bf0b9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":570,"y":260,"wires":[]},{"id":"4d8512cd.73c90c","type":"debug","z":"4e9a710a.bf0b9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":570,"y":300,"wires":[]},{"id":"d9e9ca6a.952218","type":"position-config","z":0,"name":"Entenhausen","longitude":"13.72324","latitude":"51.12381","angleType":"deg"}]
```
#### time-comp - Node settings
A simple node that routes messages depending on the time. If the current time falls within the range specified in the node configuration, the message is routed to output 1. Otherwise the message is routed to output 2.
![time-comp-settings](https://user-images.githubusercontent.com/12692680/57134515-b4fd2b00-6da6-11e9-9d04-0cafb0721ba8.png)
- **Position** connects to the central configuration node, which contains the current position, but also handles internal shared functions
- **Input** defines the input parameter for the time stamp
- **parse format** defines the format for the input parameter, more information see [input parse formats](base_functions.m#input-parse-formats).
- **Offset** allows to define a positive or negative offset to the given **Input Time**.
- **compare with** here can be defined various definitions of times to which the input time should be compared.
- **operator** Drop down to define operator
- **compare type** allows to define what parts of the time string should be compared. Default is a comparison of the complete timestamp. But it is possible to only compare a pat like the only the year.
- **time** defines where the time to which should be compared comes from
- **parse format** defines the format for the time to compare, more information see [input parse formats](base_functions.m#input-parse-formats).
- **Offset** allows to define a positive or negative offset to the given time.
- **limitation** here it is possible to additionally define a parameter. if defined this comparison will only be made if the [conditions](base_functions.m#conditions) matches.
- **result** allows to write the **Input time** to a parameter in a different format. Without defining any **compare with**, the node allows by only defining input and result parameter a simply time format conversation.
### time-span
A enhanced node for time span calculation and time span comparison.
![time-span-example](https://user-images.githubusercontent.com/12692680/57134521-b595c180-6da6-11e9-82fe-01ddaaba0d7b.png)
```json
tbd
```
#### time-span - Node settings
A simple node that routes messages depending on the time. If the current time falls within the range specified in the node configuration, the message is routed to output 1. Otherwise the message is routed to output 2.
![time-span-settings](https://user-images.githubusercontent.com/12692680/57134523-b595c180-6da6-11e9-8146-ce1d7a59792a.png)
- **Position** connects to the central configuration node, which contains the current position, but also handles internal shared functions
- **Input 1** defines the first input parameter for the time span calculation
- **parse format** defines the format for the first input parameter, more information see [input parse formats](base_functions.m#input-parse-formats).
- **Offset** allows to define a positive or negative offset to the given **Input 1 Time**.
- **Input 2** defines the second input parameter for the time span calculation
- **parse format** defines the format for the second input parameter, more information see [input parse formats](base_functions.m#input-parse-formats).
- **Offset** allows to define a positive or negative offset to the given **Input 2 Time**.
- **compare with** here can be defined various time spams to which the time span between timestamp of input 1 and input 2 should be compared.
- **operator** Drop down to define operator for comparison
- **time** defines a number to which should be the timespan be compared
- **time type** the unit of the given time
- **result** ** as result of an incoming message, data could be written to that destination. This could be a message property, a flow or a global context.
- **result value** defines the value which should be written to the result destination. Could be the timestamp, one of the Input times or any other time/data. For timestamp or times the output format or maybe an offset could be defined.
Without defining any comparison, the node allows by only defining inputs and result a simply timespan calculation.
### blind-control
![blind-control](https://user-images.githubusercontent.com/12692680/70033605-1c36c400-15b0-11ea-94db-fbf30eb6d7b7.png)
Used to control a blind with many possibilities. This can be time-dependent and it can calculate the blind position based on the current position of the sun to limit the sun light To limit the sunlight on the floor of a window.
[blind-control](blind_control.md)
### clock-timer
![clock-timer](https://user-images.githubusercontent.com/12692680/70033610-1e991e00-15b0-11ea-8035-8a74164f7d64.png)
Used to control a flow time based with many possibilities. This can be used to switch something which is time-dependent (e.g. Christmas lights).
[clock-timer](clock_timer.md)
## CHANGELOG

@@ -417,3 +86,2 @@

- [ ] 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

@@ -420,0 +88,0 @@ ## Support, Bugs and Feedback

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc