UNPKG

@pilot-things/node-red-contrib-pilot-things

Version:
107 lines (103 loc) 4.71 kB
<script type="text/javascript" src="/pilot-things.js"></script> <script type="text/javascript"> var pilotThingsDecodeData = "decode studio"; RED.nodes.registerType("pilot-things-decode-data", { category: pilotThingsNodeCategory, color: pilotThingsNodeColor, defaults: { endpoint: { value: "", validate: pilotThingsValidateURL }, format: { value: "hex" }, name: { value: "" } }, credentials: { username: { type: "text" }, password: { type: "password" } }, inputs: 1, outputs: 1, icon: pilotThingsIcon, paletteLabel: pilotThingsDecodeData, label: pilotThingsNameOr(pilotThingsDecodeData), labelStyle: pilotThingsItalicIfName }); </script> <script type="text/html" data-template-name="pilot-things-decode-data"> <style> .pilot-things-label { width: 166px !important; } .pilot-things-input { width: 50% !important; } </style> <div class="form-row"> <label for="node-input-endpoint" class="pilot-things-label"><i class="fa fa-globe"></i> Pilot Things instance</label> <input type="text" id="node-input-endpoint" class="pilot-things-input" required> </div> <div class="form-row"> <label for="node-input-username" class="pilot-things-label"><i class="fa fa-user"></i> Username</label> <input type="text" id="node-input-username" class="pilot-things-input"> </div> <div class="form-row"> <label for="node-input-password" class="pilot-things-label"><i class="fa fa-lock"></i> Password</label> <input type="password" id="node-input-password" class="pilot-things-input"> </div> <div class="form-row"> <label for="node-input-format" class="pilot-things-label"><i class="fa fa-file"></i> Data string format</label> <select type="text" id="node-input-format" class="pilot-things-input"> <option value="hex">Hexadecimal</option> <option value="base64">Base64</option> <option value="ascii">ASCII</option> </select> </div> <div class="form-row"> <label for="node-input-name" class="pilot-things-label"><i class="fa fa-tag"></i> Name</label> <input type="text" id="node-input-name" placeholder="Name" class="pilot-things-input"> </div> </script> <script type="text/html" data-help-name="pilot-things-decode-data"> <p>Decode the payload using a Pilot Things Studio decoder.</p> <h3>Inputs</h3> <dl class="message-properties"> <dt>payload <span class="property-type">{ timestamp?: number, data?: string | Buffer, metadata?: object, productId: string }</span> <dd> The data to decode and the ID of the source product (<a href="https://www.pilot-things.com/smart-platform/sensor-library" target="_blank">list here</a>).<br> <b>Note:</b> <ul> <li>Omitting <code>timestamp</code> will result in using the current time as timestamp.</li> <li>Omitting <code>data</code> will result in an empty payload being sent.</li> </ul> </dd> </dt> </dl> <h3>Properties</h3> <dl class="message-properties"> <dt>Pilot Things instance <span class="property-type">URL</span> <dd> The address at which Pilot Things is installed.<br> <b>Example:</b> <code>https://kerlink.pilot-things.com/</code> </dd> </dt> <dt>Username <span class="property-type">string</span> <dd>The username used for authentication.</dd> </dt> <dt>Password <span class="property-type">string</span> <dd>The password used for authentication.</dd> </dt> <dt>Data string format <span class="property-type">enum</span> <dd> The format in which the data is, if it's a string (ignored if the data is a <code>Buffer</code>).<br> <b>Note:</b> See the <a href="https://github.com/PilotThings/node-red-contrib-pilot-things#my-data-is-in-a-non-supported-data-format-how-do-i-submit-it-to-the-pilot-things-nodes">FAQ</a> if your data is not in a supported format. </dd> </dt> <dt>Name <span class="property-type">string</span> <dd>The name used by the node in Node-RED flow editor.</dd> </dt> </dl> </script>