node-red-contrib-m-bus
Version:
Node-Red node for M-Bus protocol
73 lines (62 loc) • 2.44 kB
HTML
<script type="text/javascript">
RED.nodes.registerType('mbus-out', {
category: 'M Bus',
color: '#03A9F4',
defaults: {
name: {value: ''},
client: {type: 'mbus-client', required: true},
},
inputs: 0,
outputs: 1,
align: "right",
icon: 'bridge.png',
paletteLabel: 'M-Bus',
label: function () {
return this.name || 'M-Bus'
},
oneditprepare: function () {
}
})
</script>
<script type="text/x-red" data-template-name="mbus-out">
<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-out">
<p>Subscribes to a M-Bus client events and publishes updates to output.</p>
<h3>Outputs</h3>
<ol class="node-ports">
<li>Output
<dl class="message-properties">
<dt>payload <span class="property-type">Json</span></dt>
<dd>The data of the event.</dd>
</dl>
<dl class="message-properties">
<dt>topic <span class="property-type">String</span></dt>
<dd>Event name.</dd>
</dl>
</li>
</ol>
<h3>Output</h3>
<code>msg.topic</code> contains the event name. Used topics are are:
<ul>
<li><b>scanComplete</b> - When the scan is completed, <code>msg.payload</code>
will contains an array of <code>string</code> with secondary IDs of found devices</li>
<li><b>deviceUpdated</b> - When the a device is updated, <code>msg.payload</code>
will contains an <code>Object</code> with device data</li>
<li><b>devicesLoaded</b> - When the client has `storeDevices` option set to <code>true</code> this event is triggered once the Array of devices is loaded, <code>msg.payload</code>
will contains an <code>Array</code> of Devices found</li>
</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>