forked from steffenmllr/node-red-contrib-sonoff-tasmota
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsonoff.html
94 lines (84 loc) · 3.99 KB
/
sonoff.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
83
84
85
86
87
88
89
90
91
92
93
94
<script type="text/javascript">
RED.nodes.registerType('Sonoff device Enhanced', {
category: 'Sonoff',
color: '#28AFB0',
defaults: {
mode:{ value: '0'},
channel:{ value: 'POWER', required: true},
broker: { type: 'mqtt-broker', required: true },
device: { value: 'sonoff', required: true },
name: { value: ''},
onValue: { value: 'ON' },
offValue: { value: 'OFF' },
toggleValue: { value: 'toggle'},
cmdPrefix: { value: 'cmnd' },
statPrefix: { value: 'stat' },
telePrefix: { value: 'tele' }
},
icon: 'bridge.png',
inputs: 1,
outputs: 1,
label: function() {
return this.name || this.device;
}
});
</script>
<script type="text/x-red" data-template-name="Sonoff device Enhanced">
<div class="form-row">
<label for="node-input-channel"><i class="fa fa-exchange"></i><span> Channel</span></label>>
<select type="text" id="node-input-channel" style="width:70%;">
<option value="POWER">POWER (single channel modules)</option>
<option value="POWER1">POWER1</option>
<option value="POWER2">POWER2</option>
<option value="POWER3">POWER3</option>
<option value="POWER4">POWER4</option>
<option value="POWER5">POWER5</option>
<option value="POWER6">POWER6</option>
<option value="POWER7">POWER7</option>
<option value="POWER8">POWER8</option>
</select>
</div>
<div class="form-row">
<label for="node-input-mode"><i class="fa fa-wrench"></i><span> Mode</span></label>
<select type="text" id="node-input-mode" style="width:70%;">
<option value="0">%prefix%/%topic%/</option>
<option value="1">%topic%/%prefix%/</option>
</select>
</div>
<div class="form-row">
<label for="node-input-device"><i class="icon-tag"></i> Id</label>
<input type="text" id="node-input-device" placeholder="Sonoff id (Default: sonoff)">
</div>
<div class="form-row">
<label for="node-input-broker"><i class="fa fa-globe"></i> Mqtt</label>
<input type="text" id="node-input-broker">
</div>
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-toggleValue"><i class="fa fa-toggle"></i> Toggle</label>
<input type="text" id="node-input-toggleValue" placeholder="toggleValue (Default: Toggle)">
</div>
<div class="form-row">
<label for="node-input-onValue"><i class="fa fa-toggle-on"></i> On</label>
<input type="text" id="node-input-onValue" placeholder="onValue (Default: On)">
</div>
<div class="form-row">
<label for="node-input-offValue"><i class="fa fa-toggle-off"></i> Off</label>
<input type="text" id="node-input-offValue" placeholder="offValue (Default: OFF)">
</div>
<div class="form-row">
<label for="node-input-cmdPrefix"><i class="fa fa-comment"></i> cmd</label>
<input type="text" id="node-input-cmdPrefix" placeholder="cmdPrefix (Default: cmd)">
</div>
<div class="form-row">
<label for="node-input-statPrefix"><i class="fa fa-comment"></i> stat</label>
<input type="text" id="node-input-statPrefix" placeholder="statPrefix (Default: stat)">
</div>
<div class="form-row">
<label for="node-input-telePrefix"><i class="fa fa-comment"></i> tele</label>
<input type="text" id="node-input-telePrefix" placeholder="telePrefix (Default: tele)">
</div>
</script>