-
Notifications
You must be signed in to change notification settings - Fork 2
/
htu21d.html
71 lines (66 loc) · 2.75 KB
/
htu21d.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
<!--
Copyright 2015 Maxwell Hadley
See accompanying LICENSE file for terms of use
-->
<!-- Edit dialog -->
<script type="text/x-red" data-template-name="htu21d">
<div class="form-row">
<label for="node-input-device"><i class="fa fa-cog"></i> Device</label>
<input type="text" id="node-input-device" placeholder="Device">
</div>
<div class="form-row">
<label for="node-input-updateInterval"><i class="fa fa-repeat"></i> Update at</label>
<input type="text" id="node-input-updateInterval" style="width:15%">
<label style="width:50%">second intervals</label>
</div>
<div class="form-row">
<label><i class="fa fa-tachometer"></i> Units</label>
<label for="node-input-dewpointUnits" style="width:16%">Dewpoint:</label>
<select id="node-input-dewpointUnits" style="width:12%">
<option value="degC">˚C</option>
<option value="degF">˚F</option>
</select>
<label for="node-input-temperatureUnits"> Temperature:</label>
<select id="node-input-temperatureUnits" style="width:12%">
<option value="degC">˚C</option>
<option value="degF">˚F</option>
</select>
</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="Name">
</div>
</script>
<!-- Help text -->
<script type="text/x-red" data-help-name="htu21d">
<p>Reads data from a Measurement Specialities HTU21D Humidity sensor using the I2C interface</p>
Periodically reads the sensor and sends a message containing temperature, relative humidity and dewpoint
(<b>payload.temperature</b>, <b>payload.humidity</b> and <b>payload.dewpoint</b>).
Relative humidity is always given in percent; the temperature and dewpoint units
of measurement can be selected as required.</p>
<p>The dewpoint is calculated from the measured temperature and relative humidity.</p>
<p>Measurements regularly update at the specified interval.</p>
</script>
<!-- Register node type -->
<script type="text/javascript">
RED.nodes.registerType('htu21d', {
category: 'hardware',
defaults: {
device: {value: '\/dev\/i2c-1', required:false},
updateInterval: {value: '15', required:true},
dewpointUnits: {value: 'degC', required:true},
temperatureUnits: {value: 'degC', required:true},
name: {value: ''}
},
color:'#d8bfd8',
inputs:0,
outputs:1,
icon: 'chip.png',
label: function () {
return this.name || 'HTU21D';
},
labelStyle: function () {
return this.name ? 'node_label_italic' : '';
}
});
</script>