UNPKG

node-red-contrib-amazon-echo

Version:

Alexa-controlled Node-RED nodes for the latest Amazon Echo devices.

117 lines (95 loc) 4.04 kB
<script type="text/javascript"> RED.nodes.registerType('amazon-echo-device', { category: "input", color: "#31C4F3", defaults: { name: { value: "", required: true }, topic: { value: "", required: false }, }, inputs: 1, outputs: 1, icon: "amazon-echo-device.png", label: function() { return this.name || "Amazon Echo Device"; } }); </script> <script type="text/x-red" data-template-name="amazon-echo-device"> <style media="screen"> .form-row label { width: 140px !important; max-width: 40% !important; } .form-row input, .form-row select { width: 260px !important; max-width: 50% !important; margin-left: 20px !important; } .form-row.spaced, .form-tips.spaced { margin-top: 30px; } </style> <div class="form-row spaced"> <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> <input type="text" id="node-input-name" placeholder="Device Name (must be unique)"> </div> <div class="form-tips"> <small>Alexa uses this <strong>Name</strong> to identify your device by voice. It must be unique for each device. If you rename your device, please ask Alexa to discover it again.</small> </div> <div class="form-row spaced"> <label for="node-input-topic"><i class="fa fa-tasks"></i> Topic</label> <input type="text" id="node-input-topic"> </div> </script> <script type="text/x-red" data-help-name="amazon-echo-device"> <p>Amazon Echo Device</p> <h3>Outputs</h3> <dl class="message-properties"> <dt>deviceid <span class="property-type">string</span></dt> <dd>Device ID</dd> <dt>devicename <span class="property-type">string</span></dt> <dd>Device Name</dd> <dt>payload <span class="property-type">string</span></dt> <dd>On state of the light (on - true, off - false)</dd> <dt>on <span class="property-type">boolean</span></dt> <dd>On/Off state of the light</dd> <dt>bri <span class="property-type">number</span></dt> <dd>Brightness of the light (min 1, max 254)</dd> <dt>hue <span class="property-type">number</span></dt> <dd>Hue of the light (min 0, max 65535)</dd> <dt>sat <span class="property-type">number</span></dt> <dd>Saturation of the light (min 0, max 254)</dd> <dt>ct <span class="property-type">string</span></dt> <dd>The mired color temperature of the light (min 153, max 500)</dd> <dt>xy <span class="property-type">array</span></dt> <dd>The x and y coordinates of a color in CIE color space (Both x and y are between 0 and 1)</dd> <dt>rgb <span class="property-type">array</span></dt> <dd>The light color in RGB format</dd> <dt>colormode <span class="property-type">string</span></dt> <dd>Indicates the color mode (ct - Color Temperature | hs - Hue and Saturation)</dd> <dt>percentage <span class="property-type">number</span></dt> <dd>The brightness % level (min 1, max 100)</dd> <dt>meta <span class="property-type">array</span></dt> <dd>Meta data hashmap</dd> <dt>meta.insert.by <span class="property-type">string</span></dt> <dd>The insert type (alexa | input)</dd> <dt>meta.insert.date <span class="property-type">string</span></dt> <dd>The insert date and time</dd> <dt>meta.insert.details.ip <span class="property-type">string</span></dt> <dd>Alexa master device IP address.<br/>Only if <b>meta.insert.by</b>=<i>alexa</i></li></dd> <dt>meta.insert.details.user_agent <span class="property-type">string</span></dt> <dd>Alexa master device user agent.<br/>Only if <b>meta.insert.by</b>=<i>alexa</i></dd> <dt>meta.input <span class="property-type">array</span></dt> <dd>Hashmap with all input attributes</dd> <dt>meta.changes <span class="property-type">array</span></dt> <dd>Hashmap of all changed attributes and the corresponding old values</dd> </dl> </script>