-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #203 from datech/release/v0.1.12
release/v0.1.12
- Loading branch information
Showing
12 changed files
with
3,119 additions
and
730 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
/node_modules | ||
*/README*.md | ||
data/ | ||
dist/ | ||
node_modules/ | ||
*/README*.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,65 @@ | ||
# node-red-contrib-amazon-echo | ||
|
||
Alexa controlled Node-Red nodes supporting latest Amazon Echo devices | ||
Alexa controlled Node-Red nodes supporting the latest Amazon Echo devices | ||
|
||
**NO Alexa Skills required.** | ||
|
||
**NO cloud dependencies.** | ||
|
||
## Installation | ||
|
||
Install from your Node-RED Manage Palette | ||
|
||
or | ||
|
||
Install using npm | ||
|
||
$ npm install node-red-contrib-amazon-echo | ||
```sh | ||
$ npm install node-red-contrib-amazon-echo | ||
``` | ||
|
||
## How to use | ||
* Add **Amazon Echo Hub** node your flow | ||
* Add multiple **Amazon Echo Device** nodes linked to **Amazon Echo Hub node** | ||
Note: Use unique names for device nodes. Alexa will use the node name to manage your smart device | ||
* Ask **"Alexa, discover devices"** or start the discover procedure from the Alexa mobile app | ||
|
||
 | ||
- Add **Amazon Echo Hub** node to your flow. | ||
- Add multiple **Amazon Echo Device** nodes linked to the **Amazon Echo Hub node**. | ||
- **Note:** Use unique names for device nodes. Alexa will use the node name to manage your smart device. | ||
- Ask **"Alexa, discover devices"** or start the discovery procedure from the Alexa mobile app. | ||
|
||
## Features | ||
* Turning on/off | ||
* Dimming | ||
* Setting the light color | ||
|
||
- Turning on/off | ||
- Dimming | ||
- Setting the light color | ||
|
||
## Supported devices | ||
* Amazon Echo 2nd generation | ||
* Amazon Echo Plus 2nd generation | ||
* Amazon Echo Dot 1st, 2nd and 3rd generations | ||
|
||
- All Echo devices | ||
|
||
## Example Alexa commands | ||
* Alexa, turn on/off {device} | ||
* Alexa, switch on/off {device} | ||
* Alexa, set {device} to 50% | ||
* Alexa, turn my {device} light green | ||
* Alexa, set the {device} light to orange | ||
* Alexa, make the {device} warmer | ||
* Alexa, brighten {device} to 60 percent | ||
* Alexa, dim the {device} lights | ||
|
||
- "Alexa, turn on/off {device}" | ||
- "Alexa, switch on/off {device}" | ||
- "Alexa, set {device} to 50%" | ||
- "Alexa, turn my {device} light green" | ||
- "Alexa, set the {device} light to orange" | ||
- "Alexa, make the {device} warmer" | ||
- "Alexa, brighten {device} to 60 percent" | ||
- "Alexa, dim the {device} lights" | ||
|
||
## Requirements | ||
Amazon Echo Hub node is starting a service listening on port 80 which requires Node-Red process to be started with root user. | ||
|
||
**No additional settings are needed if Node-Red is started as Home Assistant add-on** | ||
The Amazon Echo Hub node starts a service listening on port 80, which requires the Node-RED process to be started with root privileges or requires firewall rules to redirect the traffic. | ||
|
||
## Troubleshooting | ||
Detailed troubleshooting instructions can be found on the [Wiki](https://github.com/datech/node-red-contrib-amazon-echo/wiki) | ||
|
||
Detailed troubleshooting instructions can be found on the [Wiki](https://github.com/datech/node-red-contrib-amazon-echo/wiki). | ||
|
||
## Bugs and feature requests | ||
Please create an issue in [GitHub](https://github.com/datech/node-red-contrib-amazon-echo/issues) | ||
|
||
Please create an issue on [GitHub](https://github.com/datech/node-red-contrib-amazon-echo/issues). | ||
|
||
## More device types | ||
|
||
**node-red-contrib-amazon-echo** supports only basic device types like lights, switches, and dimmable bulbs. If you need a broader range of smart home devices, including thermostats, TVs, speakers, locks, blinds, garage doors, fans, and scenes, you might try **[DuloNode](https://www.dulonode.com)**. | ||
|
||
**DuloNode** extends functionality beyond what node-red-contrib-amazon-echo offers by supporting more device categories and additional features like temperature control, TV channel changes, adjusting speaker volume, locking doors, raising blinds, and more advanced automation. It provides a comprehensive smart home integration experience for users looking for extended capabilities. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
version: '3' | ||
|
||
services: | ||
nodered: | ||
image: "nodered/node-red:latest" | ||
profiles: [node-red] | ||
environment: { | ||
# DEBUG: "node-ssdp:*" | ||
} | ||
ports: | ||
- "1880:1880" | ||
volumes: | ||
- type: bind | ||
source: data | ||
target: /data | ||
- type: bind | ||
source: . | ||
target: /node-red-contrib-amazon-echo | ||
restart: unless-stopped | ||
depends_on: | ||
nodered-init: | ||
condition: service_completed_successfully | ||
|
||
nodered-init: | ||
image: "nodered/node-red:latest" | ||
profiles: [node-red] | ||
volumes: | ||
- type: bind | ||
source: data | ||
target: /data | ||
- type: bind | ||
source: . | ||
target: /node-red-contrib-amazon-echo | ||
entrypoint: | ||
- "/bin/sh" | ||
- "-c" | ||
- | | ||
cd /node-red-contrib-amazon-echo && | ||
mkdir -p dist && | ||
npm pack --pack-destination dist | ||
npm install ./dist/node-red-contrib-amazon-echo-*.tgz --prefix /data | ||
restart: "no" | ||
|
||
test: | ||
image: "nodered/node-red:latest" | ||
profiles: [test] | ||
volumes: | ||
- type: bind | ||
source: . | ||
target: /node-red-contrib-amazon-echo | ||
working_dir: /node-red-contrib-amazon-echo | ||
entrypoint: | ||
- "/bin/sh" | ||
- "-c" | ||
- | | ||
npm install && npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,43 @@ | ||
module.exports = function(){ | ||
|
||
this.formatUUID = function(id) { | ||
module.exports = function() { | ||
const os = require('os'); | ||
|
||
function formatUUID(id) { | ||
if (id === null || id === undefined) | ||
return ''; | ||
return ('' + id).replace('.', '').trim(); | ||
} | ||
|
||
this.hueUniqueId = function(id) { | ||
function hueUniqueId(id) { | ||
return (id + '0000').replace(/(.{2})/g, "$1:").substring(0, 23) + '-00'; | ||
} | ||
|
||
this.getHueHubId = function(config) { | ||
|
||
function getHueHubId(config) { | ||
var uuid = '00112233-4455-6677-8899-'; | ||
uuid += formatUUID(config.id); | ||
return uuid; | ||
} | ||
|
||
function getNetworkInterfaces() { | ||
const networkInterfaces = os.networkInterfaces(); | ||
let interfaces = { | ||
"all": "0.0.0.0" | ||
}; | ||
|
||
// Find IPv4 addresses | ||
Object.keys(networkInterfaces).filter(name => name !== 'lo').forEach(interfaceName => { | ||
const details = networkInterfaces[interfaceName].find(detail => detail.family === 'IPv4' && !detail.internal); | ||
if (details) { | ||
interfaces[interfaceName] = details.address; | ||
} | ||
}); | ||
|
||
return interfaces; | ||
} | ||
|
||
return { | ||
formatUUID, | ||
hueUniqueId, | ||
getHueHubId, | ||
getNetworkInterfaces | ||
}; | ||
}; |
Oops, something went wrong.