UNPKG

node-red-contrib-knx-ultimate

Version:

Control your KNX and KNX Secure intallation via Node-Red! A bunch of KNX nodes, with integrated Philips HUE control, ETS group address importer, KNX AI for diagnosticsand KNX routing between interfaces. Easy to use and highly configurable.

67 lines (61 loc) 2.01 kB
<script type="text/javascript"> RED.nodes.registerType('knxUltimateHATranslator', { category: 'KNX Ultimate', defaults: { name: { value: "" }, payloadPropName: { value: "payload", required: false }, commandText: { value: 'on:true\noff:false\nactive:true\ninactive:false\nopen:true\nclosed:false\nclose:false\n1:true\n0:false\ntrue:true\nfalse:false\nhome:true\nnot_home:false', required: false } }, inputs: 1, outputs: 1, icon: "node-ha-icon.svg", label: function () { return (this.name || 'HA -> KNX'); }, color: '#AED6F1', paletteLabel: "Home Assistant translator", oneditprepare: function () { // Go to the help panel try { RED.sidebar.show("help"); } catch (error) { } var node = this; node.editor = RED.editor.createEditor({ id: 'node-input-editorcommandText', mode: 'ace/mode/text', value: node.commandText }); }, oneditsave: function () { var node = this; node.commandText = node.editor.getValue(); node.editor.destroy(); delete node.editor; }, oneditcancel: function () { // Return to the info tab try { RED.sidebar.show("info"); } catch (error) { } var node = this; node.editor.destroy(); delete node.editor; }, }); </script> <script type="text/html" data-template-name="knxUltimateHATranslator"> <div class="form-row"> <label for="node-config-input-name"> <i class="fa fa-tag"></i> Name </label> <input type="text" id="node-config-input-name"> </div> <div class="form-row"> <label for="node-input-payloadPropName"><i class="fa fa-ellipsis-h"></i> Input</label> <input type="text" id="node-input-payloadPropName"> </div> <div class="form-row"> <label style="width:300px;" for="node-input-commandText"><i class="fa fa-tasks"></i> Translate (Homassistant:KNX)</label> <div style="height: 250px; min-height:150px;" class="node-text-editor" id="node-input-editorcommandText"></div> </div> </script>