prisme-flow
Version:
prisme platform flow engine
139 lines (124 loc) • 5.23 kB
HTML
<!--
Created by prisme.io on 09/06/2017.
@author <a href="mailto:hello@prisme.io">savane vamara</a> (prisme.io)
-->
<script type="text/x-red" data-template-name="knx-controller">
<div class="form-row">
<label for="node-config-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-config-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-config-input-host"><i class="icon-bookmark"></i> knx Host</label>
<input type="text" id="node-config-input-host">
</div>
<div class="form-row">
<label for="node-config-input-port"><i class="icon-bookmark"></i> knx Port</label>
<input type="text" id="node-config-input-port">
</div>
<div class="form-row">
<label for="node-config-input-mode"><i class="icon-bookmark"></i> knx Mode</label>
<select id="node-config-input-mode">
<option value="tunnel/unicast">tunnel/unicast</option>
<option value="routing/multicast">routing/multicast</option>
</select>
</div>
</script>
<script type="text/x-red" data-template-name="knx-out">
<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-controller"><i class="icon-bookmark"></i> Controller</label>
<input type="text" id="node-input-controller">
</div>
</script>
<script type="text/x-red" data-template-name="knx-in">
<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-controller"><i class="icon-bookmark"></i> Controller</label>
<input type="text" id="node-input-controller">
</div>
</script>
<script type="text/x-red" data-help-name="knx-out">
<p>Use this to <b>send</b> KNX telegrams to a KNX/EIB network.<br/>
<b>msg.topic</b> can be:
<p> - 'read': to send a read request to the bus</p>
<p> - 'respond': to send a response to another read request to the bus</p>
<p> - 'write': (<b>default</b>) to write a value to the bus. Can be omitted.</p>
<br/>
<p><b>msg.payload</b> must be a JavaScript object or a string in JSON format</p>
<p> - 'dstgad': the destination <b>group</b> address (eg."1/2/3")</p>
<p> - 'value': the actual value to send (eg."1"), for datapoint 3 this must be an object with
attribute c = a boolean for an up increment, and attribute amount = value <=7 to increment by.</p>
<p> - 'dpt': the datapoint type (eg."1")</p>
<br/>
<p>for example: {"dstgad":"1/2/3", "value":"1", "dpt":"1"}</p>
<p>for DPT3 correct message: {"dstgad":"3/2/2", "value":{"c":"true", "amount":"4"}, "dpt":"3"} ("c" - "true"/"false" or "1"/"0", "amount" - "0".."7" or <br/>
{"dstgad":"3/2/2", "value":"15", "dpt":"3"} ("value" - "0".."15")</p>
</p>
</script>
<script type="text/x-red" data-help-name="knx-in">
<p>Use this to <b>inject</b> flows from KNX telegrams on the bus<br/>
<b>msg.topic</b> will be:
<p> - 'read': when a read request arrives on the bus</p>
<p> - 'respond': when another KNX device responds to a read request on the bus</p>
<p> - 'write': when somebody writes a value to a KNX group address.</p>
<br/>
<b>msg.payload</b> will have the format: {width: X, value: Y}
<p> - srcphy: source <b>physical</b> address (eg.'1.1.100')</p>
<p> - dstgad: destination <b>group</b> address (eg.'1/2/3')</p>
<p> - value: the actual value received</p>
<p> - dpt: the datapoint type <b>bits</b> of the telegram</p>
</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('knx-controller', {
category: 'config',
defaults: {
name: {value: ""},
host: {value: "127.0.0.1", required: true},
port: {value: 3671, required: true, validate: RED.validators.number()},
mode: {value: "tunnel/unicast", required: true}
},
label: function () {
return (this.name || 'knx' ) + "@" + this.host + ":" + this.port;
}
});
</script>
<script type="text/javascript">
RED.nodes.registerType('knx-out', {
category: 'plc-output',
color: '#ffffff',
defaults: {
name: {value: ""},
controller: {value: "", type: "knx-controller"}
},
inputs: 1,
outputs: 0,
align: 'right',
icon: "knx.png",
label: function () {
return (this.groupaddr || this.name || "knx");
}
});
</script>
<script type="text/javascript">
RED.nodes.registerType('knx-in', {
category: 'plc-input',
color: '#ffffff',
defaults: {
name: {value: ""},
controller: {value: "", type: "knx-controller"}
},
inputs: 0,
outputs: 1,
icon: "knx.png",
label: function () {
return (this.groupaddr || this.name || "knx");
}
});
</script>