UNPKG

node-red-contrib-mobius-flow-thingsboard

Version:

Node-RED nodes to work with MOBiUSFlow and ThingsBoard.io

109 lines (96 loc) 4.43 kB
<!-- Copyright (c) 2017, IAconnects Technology Limited All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --> <script type="text/x-red" data-template-name="mobius thingsboard provision"> <div class="form-row"> <label for="node-input-connection"><i class="fa fa-globe"></i> Thingsboard</label> <input type="text" id="node-input-connection"> </div> <div class="form-row"> <label for="node-input-provision"><i class="fa fa-bars"></i> Provision As</label> <select type="text" id="node-input-provision" style="display: inline-block; width: auto; vertical-align: center;"> <option value="device">Thingsboard Device</option> <option value="asset">Thingsboard Asset</option> </select> </div> <hr> <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/javascript"> RED.nodes.registerType('mobius thingsboard provision', { category: 'thingsboard', color: '#c6d0eb', defaults: { connection: { type: 'mobius thingsboard connection v2', required: true }, provision: { required: true, value: 'device' }, name: { value: '' }, }, inputs: 1, outputs: 0, icon: 'thingsboard.png', align: 'right', paletteLabel: 'thingsboard provision', label: function () { if (this.name) { return this.name; } else { return `thingsboard provision`; } }, labelStyle: function () { return this.name ? 'node_label_italic' : ''; }, oneditprepare: function () { $('#enableMqttCheckbox').hide(); }, }); </script> <script type="text/x-red" data-help-name="mobius thingsboard provision"> <p>Provision Thingsboard devices and assets. If the device or asset does not exist in Thingsboard it is created, else it is updated.</p> <h3>Configuration Page</h3> <dl class="message-properties"> <dt>Thingsboard <span class="property-type">string</span></dt> <dd>The Thingsboard connection manager configuration node.</dd> <dt>Provision As <span class="property-type">option</span></dt> <dd>Select whether to provision MOBiUS objects as Thingsboard devices or assets.</dd> </dl> <h3>Inputs</h3> <ol class="node-ports"> Refresh Registration of Devices or Assets <dl class="message-properties"> <dt>topic <span class="property-type">string</span></dt> <dd>refresh</dd> </dl> Provision / Update Devices or Assets <dl class="message-properties"> <dt>topic <span class="property-type">string</span></dt> <dd>The URI of the object.</dd> <dt>payload <span class="property-type">object</span></dt> <dd>A Mobius object from the output of a discover object list node. The discover object list node must be set to MOBiUS Objects and Individual Items.</dd> </dl> </ol> <br> <p align="center" style="color:#000080">mobiusflow 2024</p> </script>