-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmbus-controller.html
101 lines (87 loc) · 3.84 KB
/
mbus-controller.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
<script type="text/javascript">
RED.nodes.registerType('mbus-controller', {
category: 'M Bus',
color: '#03A9F4',
defaults: {
name: {value: ''},
client: {type: 'mbus-client', required: true},
},
inputs: 1,
outputs: 1,
align: "right",
icon: 'bridge.png',
paletteLabel: 'M-Bus Controller',
label: function () {
return this.name || 'M-Bus Controller'
},
oneditprepare: function () {
}
})
</script>
<script type="text/x-red" data-template-name="mbus-controller">
<div class="form-row">
<label for="node-input-client"><i class="icon-globe"></i> <span data-i18n="mbus.label.client"></span></label>
<input type="text" id="node-input-client">
</div>
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
</script>
<script type="text/x-red" data-help-name="mbus-controller">
<p>Used to manually send commands to an M-Bus client.</p>
<h3>Inputs</h3>
<ol class="node-ports">
<li>Input
<dl class="message-properties">
<dt>payload <span class="property-type">Object</span></dt>
<dd>Command data.</dd>
</dl>
<dl class="message-properties">
<dt>topic <span class="property-type">String</span></dt>
<dd>Command name.</dd>
</dl>
</li>
</ol>
<h3>Outputs</h3>
<ol class="node-ports">
<li>Output
<dl class="message-properties">
<dt>payload <span class="property-type">Object</span></dt>
<dd>Response data of the command.</dd>
</dl>
<dl class="message-properties">
<dt>topic <span class="property-type">String</span></dt>
<dd>Command name.</dd>
</dl>
</li>
</ol>
<h3>Input</h3>
<code>msg.topic</code> contains the command name. Allowed commands are:
<ul>
<li><b>restart</b> - Restarts the client connection.
<li><b>scan</b> - Used to trigger a new scan of M-Bus network (will update <code>mbus_devices_<clientName>.json</code> file if <code>storeDevices</code> option is set to true)
<li><b>setDevices</b> - Used to manually set the array with the devices IDs (primary and/or secondary) to read. <code>msg.payload</code> must be a valid array of strings/numbers
<li><b>getDevices</b> - Used to get the Object with devices all datas and errors.
<li><b>getDevice</b> - Read a specific device ID specified in <code>msg.payload.address</code>.
<li><b>setPrimary</b> - Set device Primary ID. <code>msg.payload</code> needs <code>oldAddr</code> and <code>newAddr</code> properties:
<code>oldAddr</code> can be the primary or the secondary ID of the device,
<code>newAddr</code> must be a valid primary ID <code>Int</code> between 0-250,
<code>{newAddr: 'theNewAddr', oldAddr: 'theOldAddress'}</code>.
</ul>
<h3>Outputs</h3>
<code>msg.topic</code> contains the command name. Outputs of commands are:
<ul>
<li><b>scan</b> - If success, <code>msg.payload</code> will contain the Array of devices found
<li><b>getDevices</b> - <code>msg.payload.devices</code> will contains the Devices data Object, <code>msg.payload.errors will contain a list of devices with an error</code>.
<li><b>getDevice</b> - If success, <code>msg.payload</code> will contain requested device ID data.
<li><b>setPrimary</b> - If success, <code>msg.payload</code> will contain the same info as input payload
<code>{newAddr: 'theNewAddr', oldAddr: 'theOldAddress'}</code>.
</ul>
<p>For more info about the payload of messages check
<a href="https://github.com/robertsLando/node-red-contrib-m-bus#nodes">Nodes</a> section</p>
<h3>References</h3>
<ul>
<li><a href="https://github.com/robertsLando/node-red-contrib-m-bus">GitHub</a> - the node github repository</li>
</ul>
</script>