UNPKG

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

Version:
138 lines (134 loc) 6.1 kB
<script type="text/javascript" src="/pilot-things.js"></script> <script type="text/javascript"> var pilotThingsSendData = "send to studio"; RED.nodes.registerType("pilot-things-send-data", { category: pilotThingsNodeCategory, color: pilotThingsNodeColor, defaults: { endpoint: { value: "", validate: pilotThingsValidateURL }, connectivity: { value: "UNKNOWN" }, format: { value: "hex" }, name: { value:"" } }, credentials: { username: { type: "text" }, password: { type: "password" } }, inputs: 1, outputs: 0, icon: pilotThingsIcon, paletteLabel: pilotThingsSendData, label: pilotThingsNameOr(pilotThingsSendData), labelStyle: pilotThingsItalicIfName }); </script> <script type="text/html" data-template-name="pilot-things-send-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> Endpoint</label> <input type="text" id="node-input-endpoint" class="pilot-things-input"> </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-connectivity" class="pilot-things-label"><i class="fa fa-plug"></i> Connectivity</label> <select type="text" id="node-input-connectivity" class="pilot-things-input"> <option value="LORA">LoRaWaN</option> <option value="SIGFOX">Sigfox</option> <option value="CELLULAR">Cellular</option> <option value="ETHERNET">Ethernet</option> <option value="WIFI">Wi-Fi</option> <option value="BLUETOOTH">Bluetooth</option> <option value="BACNET">BACnet</option> <option value="MODBUS">Modbus</option> <option value="IO_ANALOG">Analog IO</option> <option value="IO_DIGITAL">Digital IO</option> <option value="ENOCEAN">EnOcean</option> <option value="ZIGBEE">ZigBee</option> <option value="ZWAVE">Z-Wave</option> <option value="NFC">NFC</option> <option value="USB">USB</option> <option value="IEEE_LR_WPAN">LR-WPAN</option> <option value="DALI">DALI</option> <option value="UNKNOWN">Unknown</option> </select> </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-send-data"> <p>Sends the payload to a Pilot Things Studio device.</p> <h3>Inputs</h3> <dl class="message-properties"> <dt>payload <span class="property-type">{ timestamp?: number, data?: string | Buffer, metadata?: object, deviceId: string }</span> <dd> The data to send to the specified device on Pilot Things.<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>Endpoint <span class="property-type">URL</span> <dd> The address at which to send the data.<br> <b>Example:</b> <code>http://kerlink.pilot-things.com:8787/ipe-http/up-link</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>Connectivity <span class="property-type">enum</span> <dd> The protocol that was used to get the data.<br> <b>Note:</b> If unsure, set to <code>Unknown</code>. </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>