UNPKG

node-red-contrib-mobius-flow-thingsboard

Version:

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

147 lines (134 loc) 6.4 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 connection v2"> <div class="form-row"> <label for="node-config-input-site"><i class="fa fa-tag"></i> Site</label> <input type="text" id="node-config-input-site" placeholder="Thingsboard site"> </div> <div class="form-row"> <label for="node-config-input-customerId"><i class="fa fa-tag"></i> Customer ID</label> <input type="text" id="node-config-input-customerId" placeholder="Thingsboard customer ID"> </div> <div class="form-row"> <label for="node-config-input-gatewayId"><i class="fa fa-tag"></i> Gateway ID</label> <input type="text" id="node-config-input-gatewayId" placeholder="MOBiUS Gateway ID"> </div> <div class="form-row"> <label for="node-config-input-gatewayAccessToken"><i class="fa fa-tag"></i> Access Token</label> <input type="text" id="node-config-input-gatewayAccessToken" placeholder="Thingsboard gateway device access token"> </div> <div class="form-row"> <label for="node-config-input-username"><i class="fa fa-tag"></i> Username</label> <input type="text" id="node-config-input-username" placeholder="Thingsboard username"> </div> <div class="form-row"> <label for="node-config-input-password"><i class="fa fa-tag"></i> Password</label> <input type="password" id="node-config-input-password" placeholder="Thingsboard password"> </div> <div class="form-row"> <label style="width:auto" for="node-config-input-allowSelfCert"><i class="fa fa-pencil"></i> Allow Self Signed Certificates </label> <input type="checkbox" id="node-config-input-allowSelfCert" style="display:inline-block; width:auto; vertical-align:top;"> </div> <hr> <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" placeholder="Name"> </div> </script> <script type="text/javascript"> RED.nodes.registerType('mobius thingsboard connection v2', { category: 'config', defaults: { name: { value: '' }, site: { required: true }, customerId: { required: true }, gatewayId: { required: true }, gatewayAccessToken: { required: true }, username: { required: true }, password: { required: true }, allowSelfCert: { value: false }, }, label: function () { if (this.name && this.name.length > 0) { return this.name; } return this.site; }, }); </script> <script type="text/x-red" data-help-name="mobius thingsboard connection v2"> <p>Manage the HTTPS and MQTTS connections from Mobius to Thingsboard.</p> <h3>Configuration Page</h3> <dl class="message-properties"> <dt>Site <span class="property-type">string</span></dt> <dd>The Thingsboard site to connect to. The should be the site URL only without any HTTPS or MQTTS prefix.</dd> <dt>Customer ID <span class="property-type">string</span></dt> <dd>The Thingsboard customer ID who owns the devices and assets</dd> <dt>Gateway ID <span class="property-type">string</span></dt> <dd>The name of the gateway device you created in Thingsboard.</dd> <dt>Access Token <span class="property-type">string</span></dt> <dd>The Thingsboard gateway device access token.</dd> <dt>Username <span class="property-type">string</span></dt> <dd>The Thingsboard user username you created in Thingsboard.</dd> <dt>Password<span class="property-type">string</span></dt> <dd>The Thingsboard user password.</dd> <dt>Allow Self Signed Certificates<span class="property-type">checkbox</span></dt> <dd>Check to allow self signed certificates for MQTTS.</dd> </dl> <h3>Details</h3> <p>The Thingsboard HTTPS API will be used to provision (create) devices in Thingsboard, and the Thingsboard MQTTS broker will be used to update attributes and telemetry.</p> <p>Before connecting Mobius to Thingsboard make sure that you have done the following in your Thingsboard instance: <ul> <li>Add a device to Thingsboard and tick the <b>Is Gateway</b> checkbox. Name this device the same as the Mobius Hub ID of the Mobius instance which will connect. e.g. A00001</li> <li>Create a Thingsboard user with roles listed below.</li> </ul> </p> <p>Required User Roles: <p>Device: <ul> <li>Create</li> <li>Read Credentials</li> <li>Read</li> <li>Write</li> <li>Write Attributes</li> <li>Write Telemetry</li> </ul> </p> <p>Asset: <ul> <li>Create</li> <li>Read</li> <li>Write</li> <li>Write Attributes</li> <li>Write Telemetry</li> </ul> </p> <p>Customer: <ul> <li>Read</li> </ul> </p> </p> <br> <p align="center" style="color:#000080">mobiusflow 2024</p> </script>