-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcircadian.html
82 lines (79 loc) · 2.96 KB
/
circadian.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!--
Copyright 2016 IBM Corp.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/x-red" data-template-name="Circadian Light">
<div class="form-row">
<label for="node-input-lat"><i class="fa fa-map"></i> Latitude</label>
<input type="text" id="node-input-lat" >
</div>
<div class="form-row">
<label for="node-input-lon"><i class="fa fa-map"></i> Longditude</label>
<input type="text" id="node-input-lon" >
</div>
<div class="form-row">
<label for="node-input-period"><i class="fa fa-clock"></i> Period</label>
<input type="text" id="node-input-period" >
</div>
<div class="form-row">
<label for="node-input-topic"><i class="fa"></i> Topic</label>
<input type="text" id="node-input-topic">
</div>
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Temperature">
</div>
</script>
<script type="text/x-red" data-help-name="Circadian Light">
<p>A node to give the suns relative position for a given location.</p>
<p><strong>Inputs:</strong></p>
<ul>
<li>Latitude: The Latitude of the location you are interested in.</li>
<li>Longditude: The Longditude of the location you are interested in.</li>
<li>Period: Time in minutes to output data (defaults to 5mins).</li>
</ul>
<p><strong>Outputs:</strong></p>
<pre>{
"azimuth": 0.36900883056765676,
"altitude": 0.36796818774968365,
"percent": 89.8566247170534
}</pre>
<p>Where:</p>
<ul>
<li>azimuth: The position of the Sun in radians (direction along the
horizon, measured from south to west), e.g. 0 is south and Math.PI * 3/4 is
northwest.</li>
<li>altitude: The hight of the Sun above the horizon in radians. Where 0 is
at the horizon and PI/2 is directly overhead.</li>
<li>percent: How close the Sun is to it's highest position of the day, so 0%
is at sun rise and 100% will be the highest point the sun reaches for the
given position and day.</li>
</ul>
</script>
<script type="text/javascript">
RED.nodes.registerType('Circadian Light',{
category: 'Lighting',
defaults: {
lat: {value: 0.0, required: true},
lon: {value: 0.0, required: true},
period: {value: 5, required: true},
topic: {},
name: {}
},
outputs: 1,
inputs: 0,
label: function(){
return this.name || "Circadian";
},
color: 'yellow',
icon: 'sun.png'
});
</script>