UNPKG

node-red-contrib-xiaomi-smart-devices

Version:
72 lines (63 loc) 2.14 kB
<script type="text/javascript"> RED.nodes.registerType('xiaomi-window-door-sensor', { category: 'xiaomi', color: 'rgb(192, 222, 237)', defaults: { gateway: {value: "", type: "xiaomi-gateway-config"}, name: {value: ""}, sid: {value: "", required: true}, key: {value: "", required: true} }, inputs: 0, outputs: 1, outputLabels: ["Status"], paletteLabel: "door", icon: "window-door-sensor.png", label: function () { return this.name || "Xiaomi Window Door Sensor"; } }); </script> <script type="text/x-red" data-template-name="xiaomi-window-door-sensor"> <div class="form-row"> <label for="node-input-gateway"><i class="icon-tag"></i> Gateway</label> <input type="text" id="node-input-gateway" placeholder="xiaomi gateway"> </div> <div class="form-row"> <label for="node-input-name"><i class="icon-tag"></i> Name</label> <input type="text" id="node-input-name" placeholder="Name"> </div> <div class="form-row"> <label for="node-input-sid"><i class="icon-tag"></i> SID</label> <input type="text" id="node-input-sid" placeholder="SID"></input> </div> <div class="form-row"> <label for="node-input-key"><i class="icon-tag"></i> Device</label> <input type="text" id="node-input-key" placeholder="Device Key/Name"></text> </div> </script> <script type="text/x-red" data-help-name="xiaomi-window-door-sensor"> <p>The Xiaomi contact sensor node</p> <h3>Outputs</h3> <ol class="node-ports"> <li>State output <dl class="message-properties"> <dt>payload <span class="property-type">string | json</span></dt> <dd>raw data, value or template.</dd> </dl> </li> </ol> <h3>Details</h3> <p>Sample message:</p> <p><pre> { cmd: "read_ack" model: "window-door-sensor" sid: "158d000112fb5d" short_id: 50301 data: "{ "voltage":3015, "status":"close" }" }</pre></p> </script>