node-red-contrib-mobius-flow-thingsboard
Version:
Node-RED nodes to work with MOBiUSFlow and ThingsBoard.io
132 lines (118 loc) • 5.96 kB
HTML
<!--
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 devices">
<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>
<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 devices',{
category: 'thingsboard',
color: "#a1b0de",
defaults: {
connection: {type:"mobius thingsboard connection", required:true},
name: {value: ""}
},
inputs:1,
outputs:0,
outputLabels: [],
icon: 'thingsboard.png',
align: "right",
paletteLabel: 'provision devices',
label: function() {
if(this.name) {
return this.name;
} else {
return "provision devices";
}
},
labelStyle: function() {
return this.name ? "node_label_italic":"";
}
});
</script>
<script type="text/x-red" data-help-name="mobius thingsboard provision devices">
<p>Send occupancy data to iOffice via the iOffice API.</p>
<h3>Configuration Page</h3>
<dl class="message-properties">
<dt>Site <span class="property-type">string</span></dt>
<dd>The iOffice site to connect to. The should not include the <i>HTTPS://</i> prefix or the <i>/api/v3/sensors/utilization-data</i> suffix.</dd>
<dt>User Name <span class="property-type">string</span></dt>
<dd>The iOffice connection user name.</dd>
<dt>Password <span class="property-type">string</span></dt>
<dd>The iOffice connection password.</dd>
<dt>RID <span class="property-type">string</span></dt>
<dd>The MOBiUS object resource which contains the occupancy data. This must be a boolean resource.</dd>
<dt>Timeout - Send Every<span class="property-type">number</span></dt>
<dd>Time period between data transmissions to iOffice.</dd>
<dt>Timeout - Unoccupied<span class="property-type">number</span></dt>
<dd>Timeout after sensor reports unoccupied and before reporting unoccupied to iOffice.</dd>
<dt>Timeout - Delete<span class="property-type">number</span></dt>
<dd>If a sensor does not send data to the gateway during this period it is removed from the
iOffice data packet as it is assumed to be removed from the system or broken. Set this to zero to disable this function</dd>
</dl>
<h3>Inputs</h3>
COV messages from sensors
<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>The object COV in the standard format output from a mobius flow inject node.</dd>
</dl>
Repeat messages from the store and forward node
<dl class="message-properties">
<dt>topic <span class="property-type">string</span></dt>
<dd>When receiving a repeat message from the store and forward node this must be <code>iOfficeRepeat</code>.</dd>
<dt>payload <span class="property-type">object</span></dt>
<dd>An array of sensor values in the iOffice API format. This will be sent to iOffice as is.</dd>
</dl>
<h3>Outputs</h3>
<ol class="node-ports">
<li>Output 1 - use as input to a store and forward node
<dl class="message-properties">
<dt>topic <span class="property-type">string</span></dt>
<dd>If the send was successful no topic is sent, else <code>iOfficeRepeat</code>.</dd>
<dt>storeFwdControl <span class="property-type">string</span></dt>
<dd>If the send was successful <code>forward</code>, else <code>store</code>.</dd>
<dt>payload <span class="property-type">array</span></dt>
<dd>If the send failed, an array of sensor values in the iOffice API format to be stored in the store and forward node.</dd>
</dl>
</li>
<li>Output 2
<dl class="message-properties">
<dt>topic <span class="property-type">string</span></dt>
<dd>Always <code>data</code></dd>
<dt>payload <span class="property-type">any</span></dt>
<dd>The array of sensor values sent to iOffice, in the iOffice API format.</dd>
</dl>
</li>
</ol>
<br>
<p align="center" style="color:#000080">iaconnects © 2019</p>
</script>