Devices

-
Name
-
Description
+
Name
+
Description
Actions
<% devices.forEach(function(device){ %> -
+
+
<%= device.friendlyName %>
<%= device.friendlyDescription %>
@@ -15,8 +16,11 @@ <% }); %>
+
+
+
<% }); %>
@@ -32,16 +36,16 @@
- +
Actions -
+
-
+
@@ -49,7 +53,7 @@
-
+
@@ -58,14 +62,14 @@
-
+

-
+

@@ -73,6 +77,17 @@
+
+ + +
+ + + + + + +
@@ -176,6 +191,7 @@ function addDevice() { clearDevice(); + checkCapability(); $("#dialog").dialog("open"); } @@ -236,13 +252,21 @@ var l = lock | qLock; - if (p & t || p & l || t & l) { - alert("You can not control percentage and temperature, percentage and lock or temperature and lock on the same device"); + var color = $('#setColor').prop('checked'); + var colorTemp = $('#setColorTemp').prop('checked'); + var incColorTemp = $('#incrementColorTemp').prop('checked'); + var decColorTemp = $('#decrementColorTemp').prop('checked'); + + var c = color | colorTemp | incColorTemp | decColorTemp; + + if (p & t || p & l || t & l || t & c || l & c) { + alert("You can not control percentage and temperature, percentage and lock, temperature and lock or temperatur and color or lock and color on the same device"); return false; } if (p) { $('#percentCheck').removeAttr('disabled'); + $('#lighting').removeAttr('disabled'); $('#temperatureCheck').attr('disabled', ''); $('#queryTemperature').attr('disabled', ''); $('#lockControl').attr('disabled', ''); @@ -251,16 +275,25 @@ $('#queryTemperature').removeAttr('disabled'); $('#lockControl').attr('disabled', ''); $('#percentCheck').attr('disabled', ''); + $('#lighting').attr('disabled', ''); } else if (l) { $('#lockControl').removeAttr('disabled'); $('#temperatureCheck').attr('disabled', ''); $('#queryTemperature').attr('disabled', ''); $('#percentCheck').attr('disabled', ''); + $('#lighting').attr('disabled', ''); + } else if (c) { + $('#percentCheck').removeAttr('disabled'); + $('#lighting').removeAttr('disabled'); + $('#lockControl').attr('disabled', ''); + $('#temperatureCheck').attr('disabled', ''); + $('#queryTemperature').attr('disabled', ''); } else { $('#percentCheck').removeAttr('disabled'); $('#temperatureCheck').removeAttr('disabled'); $('#queryTemperature').removeAttr('disabled'); $('#lockControl').removeAttr('disabled'); + $('#lighting').removeAttr('disabled'); } } diff --git a/views/pages/docs.ejs b/views/pages/docs.ejs index 8b833f3..342c85a 100644 --- a/views/pages/docs.ejs +++ b/views/pages/docs.ejs @@ -85,7 +85,7 @@ npm install node-red-contrib-alexa-home-skill

Building Flows

Alexa Home

-

The Alexa Home node outputs a message that looks like this:

+ + +

The Alexa Home node supports the following commands, click on the command name to see a sample output message or toggle all by clicking here:

    -
  • TurnOnRequest
  • -
  • TurnOffRequest
  • -
  • SetPercentageRequest
  • -
  • IncrementPercentageRequest
  • -
  • DecrementPercentageRequest
  • -
  • SetTargetTemperatureRequest
  • -
  • IncrementTargetTemperatureRequest
  • -
  • DecrementTargetTemperatureRequest
  • -
  • GetTemperatureReadingRequest 1,2
  • -
  • GetTargetTemperatureRequests 1,2
  • -
  • SetLockState 1
  • -
  • GetLockState 1,2
  • +
  • TurnOnRequest +
    +
    {
    +  '_messageId': 'd6734865-6a96-4967-8504-6056e75ba5c3',
    +  '_applianceId': '3',
    +  '_confId': 'cc670790.9f0eb8',
    +  'command': 'TurnOnRequest',
    +  'extraInfo': {},
    +  'payload': true
    +}
    +
    +
  • +
  • TurnOffRequest +
    +
    {
    +  '_messageId': 'd6734865-6a96-4967-8504-6056e75ba5c3',
    +  '_applianceId': '3',
    +  '_confId': 'cc670790.9f0eb8',
    +  'command': 'TurnOffRequest',
    +  'extraInfo': {},
    +  'payload': true
    +}
    +
    +
  • +
  • SetPercentageRequest +
    +
    {
    +  '_messageId': 'd6734865-6a96-4967-8504-6056e75ba5c3',
    +  '_applianceId': '3',
    +  '_confId': 'cc670790.9f0eb8',
    +  'command': 'SetPercentageRequest',
    +  'extraInfo': {},
    +  'payload': 50
    +}
    +
    +
  • +
  • IncrementPercentageRequest +
    +
    {
    +  '_messageId': 'd6734865-6a96-4967-8504-6056e75ba5c3',
    +  '_applianceId': '3',
    +  '_confId': 'cc670790.9f0eb8',
    +  'command': 'IncrementPercentageRequest',
    +  'extraInfo': {},
    +  'payload': 10
    +}
    +
    +
  • +
  • DecrementPercentageRequest +
    +
    {
    +  '_messageId': 'd6734865-6a96-4967-8504-6056e75ba5c3',
    +  '_applianceId': '3',
    +  '_confId': 'cc670790.9f0eb8',
    +  'command': 'DecrementPercentageRequest',
    +  'extraInfo': {},
    +  'payload': -10
    +}
    +
    +
  • +
  • SetTargetTemperatureRequest +
    +
    {
    +  '_messageId': 'd6734865-6a96-4967-8504-6056e75ba5c3',
    +  '_applianceId': '3',
    +  '_confId': 'cc670790.9f0eb8',
    +  'command': 'SetTargetTemperatureRequest',
    +  'extraInfo': {},
    +  'payload': 22
    +}
    +
    +
  • +
  • IncrementTargetTemperatureRequest +
    +
    {
    +  '_messageId': 'd6734865-6a96-4967-8504-6056e75ba5c3',
    +  _applianceId': '3',
    +  '_confId': 'cc670790.9f0eb8',
    +  'command': 'IncrementTargetTemperatureRequest',
    +  'extraInfo': {},
    +  'payload': 5
    +}
    +
    +
  • +
  • DecrementTargetTemperatureRequest +
    +
    {
    +  '_messageId': 'd6734865-6a96-4967-8504-6056e75ba5c3',
    +  '_applianceId': '3',
    +  '_confId': 'cc670790.9f0eb8',
    +  'command': 'DecrementTargetTemperatureRequest',
    +  'extraInfo': {},
    +  'payload': -5
    +}
    +
    +
  • +
  • GetTemperatureReadingRequest 2,3 +
    +
    {
    +  '_messageId': 'd6734865-6a96-4967-8504-6056e75ba5c3',
    +  '_applianceId': '3',
    +  '_confId': 'cc670790.9f0eb8',
    +  'command': 'GetTemperatureReadingRequest',
    +  'extraInfo': {}
    +}
    +
    +
  • +
  • GetTargetTemperatureRequests 2,3 +
    +
    {
    +  '_messageId': 'd6734865-6a96-4967-8504-6056e75ba5c3',
    +  '_applianceId': '3',
    +  '_confId': 'cc670790.9f0eb8',
    +  'command': 'GetTargetTemperatureRequests',
    +  'extraInfo': {}
    +}
    +
    +
  • +
  • SetLockState 1 +
    +
    {
    +  '_messageId': 'd6734865-6a96-4967-8504-6056e75ba5c3',
    +  '_applianceId': '3',
    +  '_confId': 'cc670790.9f0eb8',
    +  'command': 'SetLockState',
    +  'extraInfo': {},
    +  'payload': 'LOCKED'
    +}
    +
    +
  • +
  • GetLockState 1,3 +
    +
    {
    +  '_messageId': 'd6734865-6a96-4967-8504-6056e75ba5c3',
    +  '_applianceId': '3',
    +  '_confId': 'cc670790.9f0eb8',
    +  'command': 'GetLockState',
    +  'extraInfo': {}
    +}
    +
    +
  • +
    -
  1. Only available in to US users at the moment
  2. -
  3. Can not be Auto Acknoledged as they need to return a value
  4. +
  5. Amazon documentation say only available to US users at the moment
  6. +
  7. Amazon documentation say only available to US & UK users at the moment
  8. +
  9. Can not be Auto Acknowledged as they need to return a value

The payload field will hold positive numbers for the Set and Increment versions of commands and negative numbers @@ -212,7 +350,7 @@ npm install node-red-contrib-alexa-home-skill

This enforces a temperature range between 10°C and 30°C, sending the Alexa response to the second output and if the input is in range the control message is sent to the first function output. Note: All values are passed in Degrees C even if the input voice commands are in Degrees F when using Alexa in the US.

-

A recent update added Lock support, Both the set and query can be answered with a msg.extra of either "LOCKED" +

A recent update added Lock support, Both the set and query can be answered with a msg.extra.lockState of either "LOCKED" or "UNLOCKED" as follows:

{
     lockState: "LOCKED"
diff --git a/views/pages/oauth.ejs b/views/pages/oauth.ejs
index 1c4b5b5..978fff0 100644
--- a/views/pages/oauth.ejs
+++ b/views/pages/oauth.ejs
@@ -24,6 +24,9 @@
         
<% if (user) { %> + <% if (errors) { %> +

<%= errors %>

+ <% } %>

Signed in as <%= user.name%>.

Not <%= user.username %>? diff --git a/views/pages/register.ejs b/views/pages/register.ejs index 0879425..e1705e5 100644 --- a/views/pages/register.ejs +++ b/views/pages/register.ejs @@ -14,7 +14,7 @@

Please enter password again

- +