-
Notifications
You must be signed in to change notification settings - Fork 0
/
mqtt-flex.html
244 lines (221 loc) · 8.91 KB
/
mqtt-flex.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<script type="text/javascript">
RED.nodes.registerType('mqtt-flex-connect',{
category: 'network',
color: "#e8bfd8",
defaults: {
name: {value:""}
},
inputs:1,
outputs:1,
icon: "bridge.svg",
label: function() {
return this.name||"mqtt-flex-connect";
}
});
RED.nodes.registerType('mqtt-flex-disconnect',{
category: 'network',
color: "#e8bfd8",
defaults: {
name: {value:""}
},
inputs:1,
outputs:0,
icon: "bridge.svg",
label: function() {
return this.name||"mqtt-flex-disconnect";
}
});
RED.nodes.registerType('mqtt-flex-subscribe',{
category: 'network',
color: "#e8bfd8",
defaults: {
name: {value:""}
},
inputs:1,
outputs:1,
icon: "bridge.svg",
label: function() {
return this.name||"mqtt-flex-subscribe";
}
});
RED.nodes.registerType('mqtt-flex-publish',{
category: 'network',
color: "#e8bfd8",
defaults: {
name: {value:""}
},
inputs:1,
outputs:1,
icon: "bridge.svg",
label: function() {
return this.name||"mqtt-flex-publish";
}
});
RED.nodes.registerType('mqtt-flex-unsubscribe',{
category: 'network',
color: "#e8bfd8",
defaults: {
name: {value:""}
},
inputs:1,
outputs:0,
icon: "bridge.svg",
label: function() {
return this.name||"mqtt-flex-unsubscribe";
}
});
RED.nodes.registerType('mqtt-flex-status',{
category: 'network',
color: "#e8bfd8",
defaults: {
name: {value:""}
},
inputs:1,
outputs:1,
icon: "bridge.svg",
label: function() {
return this.name||"mqtt-flex-status";
}
});
</script>
<script type="text/html" data-template-name="mqtt-flex-unsubscribe">
<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>
<script type="text/html" data-help-name="mqtt-flex-subscribe">
<p> Subscribes to a topic using an established client connection.<br/>
Emitts received messages.</p>
<h3>Inputs</h3>
<dl class="message-properties">
<dt>client_id
<span class="property-type">string</span>
</dt>
<dd> The client id to be used for the Subscription.</dd>
<dt>topic
<span class="property-type">string</span>
</dt>
<dd> The topic to be subscribed.</dd>
</dl>
<h3>Outputs</h3>
The node will emitt messages on every message that was received on subscribed topics.
<dl class="message-properties">
<dt>payload <span class="property-type">any</span></dt>
<dd>The message payload as received.</dd>
<dt>client_id<span class="property-type">string</span></dt>
<dd>Id of the client the subscription belonged to.</dd>
<dt>topic<span class="property-type">string</span></dt>
<dd>topic at which the message was received.</dd>
</dl>
<h3>References</h3>
<ul>
<li><a href="https://github.com/promd/node-red-contrib-mqtt-flex">GitHub</a> - the nodes github repository</li>
</ul>
</script>
<script type="text/html" data-template-name="mqtt-flex-subscribe">
<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>
<script type="text/html" data-help-name="mqtt-flex-connect">
<p>Connects to a MQTT broker and keeps track of the status.</p>
<h3>Inputs</h3>
<dl class="message-properties">
<dt>payload <span class="property-type">object</span></dt>
<dd> Contains settings required for the MQTT connection to be created.<br/>
The Module will automatically switch between mqtt:// and mqtts://, depending on the configured attributes.
<dl class="message-properties">
<dt>client_id
<span class="property-type">string</span>
</dt>
<dd> The client id to be used for the MQTT connection.<br/>
This is also used as a unique identification of open clients.<br/>
Each distict Connection should have a separate client_id. </dd>
<dt>host
<span class="property-type">string</span>
</dt>
<dd> The hostname / ip of the MQTT broker.<br/>
Should include the port number if needed (= deviating from default)</dd>
<dt class="optional">key
<span class="property-type">string</span>
</dt>
<dd> [TLS] Path to the priate key that shall be used to authenticate.<br/>
Only files are supported currently, no strings that contain the key!</dd>
<dt class="optional">cert
<span class="property-type">string</span>
</dt>
<dd> [TLS] Path to the certificate that shall be used to authenticate.<br/>
Only files are supported currently, no strings that contain the certificate!</dd>
<dt class="optional">ca
<span class="property-type">string</span>
</dt>
<dd> [TLS] Path to the root certificate that shall be used.<br/>
Only files are supported currently, no strings that contain the ca!</dd>
<dt class="optional">reconnect
<span class="property-type">integer</span>
</dt>
<dd> If specified, this enables the automatic re-connects of the mqtt library.<br/>
Defaults to "0" (= off). Note: No testing has been done with reconnects turned on!</dd>
</dl>
</dd>
</dl>
<h3>Outputs</h3>
The node will emitt messages on every status change that any of the managed clients had.
<ol class="node-ports">
<li>Standard output
<dl class="message-properties">
<dt>payload <span class="property-type">string</span></dt>
<dd>The New status of the MQTT connection.</dd>
<dt>client_id <span class="property-type">string</span></dt>
<dd>Id of the client of which the status changed.</dd>
</dl>
</li>
</ol>
<h3>Details</h3>
<p>On input, <code>msg.payload</code> is used to specify the parameters that should be used for connecting.</p>
<p>By default, the connections will not be automatically re-connected.</p>
<h3>References</h3>
<ul>
<li><a href="https://github.com/promd/node-red-contrib-mqtt-flex">GitHub</a> - the nodes github repository</li>
</ul>
</script>
<script type="text/html" data-template-name="mqtt-flex-connect">
<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>
<script type="text/html" data-help-name="mqtt-flex-disconnect">
<p>Ends connection to a MQTT broker that has previously been established.</p>
<h3>Inputs</h3>
<dl class="message-properties">
<dt>client_id
<span class="property-type">string</span>
</dt>
<dd> The client id identifying the MQTT connection.</dd>
</dl>
<h3>References</h3>
<ul>
<li><a href="https://github.com/promd/node-red-contrib-mqtt-flex">GitHub</a> - the nodes github repository</li>
</ul>
</script>
<script type="text/html" data-template-name="mqtt-flex-disconnect">
<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>
<script type="text/html" data-template-name="mqtt-flex-publish">
<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>
<script type="text/html" data-template-name="mqtt-flex-status">
<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>