Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions INSTALL-QUICKSTART.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ cd ~
npm install alexa-app alexa-app-server request
```

#### Patch alexa-utterances module (a temporary fix for ASK custom slot support!)
```
cd ~/node_modules/alexa-app/node_modules/alexa-utterances/
wget https://github.com/unityfire/alexa-ha/files/155821/alexa-utterances_custom_slot_support.patch.txt
patch -p1 < alexa-utterances_custom_slot_support.patch.txt
```

#### Copy Alexa-App-Server's examples directory to a new 'stub' server
```
cp -R ~/node_modules/alexa-app-server/examples/ ~/node_modules/alexa-app-server/api/
Expand Down
160 changes: 22 additions & 138 deletions config_default.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
/* Default Alexa HA configuration file. Copy this to 'config.js' and adapt as needed! */
var config = {};
//change here for the required language

var configuredLanguage = './language/languageGER'
var language = require(configuredLanguage);

/******************************** GENERAL CONFIGURATION *****************************************/
// Name of the application/skill, which does not need to match the skills 'Invocation Name',
// Defines both the Alexa-App-Server endpoint and the skills own name used in cards.
config.applicationName = 'Alexa-HA';

// AWS ASK applicationId, resembles 'amzn1.echo-sdk-ams.app.[your-unique-value-here]'
config.applicationId = 'amzn1.echo-sdk-ams.app.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
config.applicationId = 'amzn1.ask.skill.xxxxxx';

// AWS ASK userID, resembles 'amzn1.echo-sdk-account.[your-unique-value-here]'
config.userId = 'amzn1.echo-sdk-account.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';

config.userId = 'amzn1.ask.account.xxxxxxxxx'
// AWS ASK password, randomly generated password to be included in the Skill's endpoint URL (i.e. '?password=XXXXXXXXXXXX')
config.password = 'XXXXXXXXXXXX';
config.password = '';

// Greeting, when saying 'Alexa, open...'
config.greeting = "OpenHAB, at your service";
Expand All @@ -33,19 +36,19 @@ config.wolframAppId ='XXXXXX-XXXXXXXXXX';
config.HA_name = 'OpenHAB';

// HA server protocol (http/https)
config.HA_protocol = 'https';
config.HA_protocol = 'http';

// HA server username
config.HA_user = 'USERNAME';
config.HA_user = '';

// HA server password
config.HA_password = 'PASSWORD';
config.HA_password = '';

// HA server FQDN/IP
config.HA_host = 'HA_SERVER_IP';
config.HA_host = '';

// HA server port
config.HA_port = 'HA_SERVER_PORT';
config.HA_port = '';

// HA server URL with credentials - i.e. 'http(s)://USERNAME:PASSWORD@HA_SERVER_IP:HA_SERVER_PORT' (constructed from above variables)
config.HA_server = config.HA_protocol + '://' + config.HA_user + ':' + config.HA_password + '@' + config.HA_host + ':' + config.HA_port;
Expand All @@ -66,18 +69,20 @@ config.HA_item_voicecmd = 'ECHO_VoiceCMD';
config.HA_item_answer = 'ECHO_Answer';

// Array of available rooms that HA has devices in, used for validations & re-prompts
config.HA_locations = ['all','house','living','great','kitchen','master bedroom','guest bedroom','data center','garage','office','foyer','utility','inside','indoor','outside','outdoor'];
config.HA_locations = ['Küche','Wohnzimmer','Esszimmer','Diele'];

// Item configuration - itemType / Location / itemName mappings
config.item = {
'light': {
'licht': {
'bedroom': 'Light_Group_Bed',
'office': 'Light_Group_Office',
'kitchen': 'Light_Group_Kitchen',
'living': 'Light_Group_Living',
'great': 'Light_Group_Great',
'house': 'Light_Group_All',
'all': 'Light_Group_All',
'wohnzimmer': 'LichtWohnzimmer_1',
'diele': 'LichtDiele',
default: 'Light_Group_All'
},
'motion': {
Expand Down Expand Up @@ -169,7 +174,7 @@ config.mode = {
'sleep': '1',
'home': '2',
'away': '3'
}
}
};

// Metric names to Item mappings
Expand Down Expand Up @@ -232,7 +237,7 @@ config.metric = {
'outside': 'Weather_Humidex',
default: 'Weather_Humidex'
}

};

// Unit to metric mappings
Expand Down Expand Up @@ -262,133 +267,12 @@ config.color = {
/******************* ASK Utterances ************************/
// Configure ASK Intent utterances using Alexa-App - reference:
// https://www.npmjs.com/package/alexa-app#schema-and-utterances for syntax
config.utterances = {
// Switch devices ON/OFF in a particular room
'Switch': [
"{to |} {turn|switch|flip} {ON|OFF|Action} {the|my |} {light|lights|motion lighting|fan|stove|music|ItemName} {in the |} {-|Location}",
"{to |} {turn|switch|flip} {ON|OFF|Action} {the|my |} {-|Location} {light|lights|motion lighting|fan|stove|music|ItemName}",
"{to |} {turn|switch|flip} {the|my |} {-|Location} {light|lights|motion lighting|fan|stove|music|ItemName} {ON|OFF|Action}",
"{to |} {turn|switch|flip} {the|my |} {light|lights|motion lighting|fan|stove|music|ItemName} {ON|OFF|Action} {in the |} {-|Location}"
],
// Set HSB color values for lights in a particular room
'SetColor': [
"{to |} {set|change|switch} {the|my |} {-|Location} {light|lights|lighting} color {to |} {-|Color}",
"{to |} {set|change|switch} {the|my |} {light|lights|lighting} color in the {-|Location} {to |} {-|Color}",
"color {the|my |} {light|lights|lighting} in the {-|Location} {to |} {-|Color}",
"color {the|my |} {-|Location} {light|lights} {to |} {-|Color}",
"make {the|my |} {-|Location} {light|lights} {-|Color}"
],
// Dim lights in a particular room
'SetLevel': [
"{to |} {dim|turn down|turn up|soften|adjust} {the|my |} {light|lights|lighting|ItemName} {in the |} {-|Location} to {0-100 by 5|Percent} {percent |}",
"{to |} {dim|turn down|turn up|soften|adjust} {the|my |} {-|Location} {light|lights|lighting|ItemName} to {0-100 by 5|Percent} {percent |}",
"{to |} {set|turn down|turn up|adjust} {the|my |} {-|Location} {volume|ItemName} to {0-100 by 5|Percent} {percent |}"
],
// Set target temperature for house HVAC
'SetTemp': [
"{to |} {set|change|adjust} {the|my |} {-|Location} {thermostat|temperature} to {60-80|Degree} {degrees |}",
"{to |} {set|change|adjust} {the|my |} {thermostat|temperature} {in the|in my |} {-|Location} to {60-80|Degree} {degrees |}"
],
// Set house/lighting/security/etc scenes
'SetMode': [
"{to |} {set|change|switch} {the|my |} {house|ModeType} mode to {off|work|dinner|party|bed|away|panic|relax|gaming|theatre|shower|wake up|TV|ModeName}",
"{to |} {set|change|switch} {the|my |} {lighting|ModeType} mode to {all off|all on|focus|energize|relax|party|night light|bed time|love shack|lava|ModeName}",
"{to |} {set|change|switch} {the|my |} {security|ModeType} mode to {off|sleep|home|away|ModeName}",
"{to |} {set|change|switch} {the|my |} {house|ModeType} to {off|work|dinner|party|bed|away|panic|relax|gaming|theatre|shower|wake up|TV|ModeName} mode",
"{to |} {set|change|switch} {the|my |} {lighting|ModeType} to {all off|all on|focus|energize|relax|party|night light|bed time|love shack|lava|ModeName} mode",
"{to |} {set|change|switch} {the|my |} {security|ModeType} to {off|sleep|home|away|ModeName} mode"
],
// Get current item state values
'GetState': [
"{to |} {get|check} {the|my |} {-|Location} {temperature|humidity|luminance|power consumption|visibility|pressure|wind|humidex|MetricName}",
"{to |} {get|check} {the|my |} {temperature|humidity|luminance|power consumption|visibility|pressure|wind|humidex|MetricName} {in the |} {-|Location}",
"whats {the|my |} {-|Location} {temperature|humidity|luminance|power consumption|visibility|pressure|wind|humidex|MetricName}",
"whats {the|my |} {temperature|humidity|luminance|power consumption|visibility|pressure|wind|humidex|MetricName} {in the |} {-|Location}"

],
// Get current house/lighting/security/etc scene
'GetMode': [
"{to |} {get|check} {the|my |} {house|lighting|security|ModeType} mode {set to |}",
"whats {the|my |} {house|lighting|security|ModeType} mode {set to |}"
],
// Execute 'raw' voice commands, request/response handled entirely by custom HA server rules
'VoiceCMD': [
"{lets party|Input}",
"{call my bank|call my phone|call work|Input}",
"{status update|Input}",
"{for a |}{status update|Input}",
"{whats the |}{weather like|Input}",
"{say a |} {quote|Input}",
"{its} {cold in here|Input}",
"{its} {hot in here|Input}"
],
// Research something arbitrary via Wolfram API call
'Research': [
"{to |} research {what is the atomic weight of boron|Question}",
"{to |} research {what is thirty divided by five|Question}",
"{to |} research {what did Alexander Graham Bell invent|Question}",
"{to |} research {what does eleven plus seven equal|Question}",
"{to |} research {when is sunset tonight|Question}",
"{to |} research {how tall is mount everest|Question}",
"{to |} research {how many miles in an acre|Question}",
"{to |} research {how do you take a derivative|Question}",
"{to |} research {where did George Washington die|Question}",
"{to |} research {where are the pyramids|Question}",
"{to |} research {Why is the sky blue|Question}"
],
// Stop Intent
'Stop': [
"{to |} stop {that |}",
"{to |} quit {that |}",
"{to |} exit {that |}",
"{to |} never mind {that |}"
],
// Cancel Intent
'Cancel': [
"{to |} cancel {that |}"
],
// Help Intent
'Help': [
"{for|to |} help {me |}"
]

//TODO implement the yes/no/repeat intents
//// Yes Intent
//'Yes': [
// "yes {please |}",
// "sure",
// "do it",
// "affirmative"
//],
//// No Intent
//'No': [
// "no {thanks |}",
// "nope",
// "negative",
// "negatory"
//],
//// Repeat Intent
//'Repeat': [
// "{please |} repeat {that |}",
// "say that again",
// "what did you say"
//]
};
config.utterances = language.utterances

/******************* ASK Responses *************************/
// Help response & card
config.help = {
'say': [
'You can ask or tell me to do all sorts of things. For example, try saying turn all lights on, dim living lights to 50 percent, ' +
'change office color to blue, set house thermostat to 72 degrees, or research why is the sky blue. ' +
'I have sent a cheat sheet of commands to your Alexa App for further reference.'
],
'card': [
'Cheat sheet: Switch on all lights / Dim living room lights to 50% / Set office color to Blue' +
' / Set house thermostat to 72 degrees / Set house mode to relax / What is the kitchen humidity / What is the house power consumption / ' +
'Research why is the sky blue'
]
};

config.help = language.help
config.language = language
// Exports
module.exports = config;
// module.exports = language;
Loading