# Amazon Echo Hub

**URL:** <https://discourse.nodered.org/t/amazon-echo-hub/6724>\
**Category:** General\
**Created:** [12 January 2019 17:53 UTC](https://discourse.nodered.org/t/amazon-echo-hub/6724 "2019-01-12T17:53:37Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [12 January 2019 17:53 UTC](https://discourse.nodered.org/t/amazon-echo-hub/6724/1 "2019-01-12T17:53:37Z")

</div>

Has anyone tried using this new node?

[https://flows.nodered.org/node/node-red-contrib-amazon-echo](https://flows.nodered.org/node/node-red-contrib-amazon-echo)

**I've not managed to get it to work with Echo Dot Gen-2 and NR running on Raspian Stretch on a RPi-3+**

Would be interesting to hear from anyone who has been successful with it.

---

<div class="post-metadata">

**Author:** ![sammachin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sammachin/32/5121_2.png) [@sammachin](https://discourse.nodered.org/u/sammachin)\
**Post date:** [13 January 2019 09:50 UTC](https://discourse.nodered.org/t/amazon-echo-hub/6724/2 "2019-01-13T09:50:07Z")

</div>

Worked fine for me, running NR on my mac  
I ran discovery from from 2nd Gen Echo Show, but I can't be sure that was the device performing local discovery as I have pretty much every kind of echo on the account/network.

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [13 January 2019 10:10 UTC](https://discourse.nodered.org/t/amazon-echo-hub/6724/3 "2019-01-13T10:10:29Z")

</div>

What port number did you use in the properties tab on the Amazon Echo Hub ??

---

<div class="post-metadata">

**Author:** ![sammachin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sammachin/32/5121_2.png) [@sammachin](https://discourse.nodered.org/u/sammachin)\
**Post date:** [13 January 2019 10:25 UTC](https://discourse.nodered.org/t/amazon-echo-hub/6724/4 "2019-01-13T10:25:28Z")

</div>

80, although then you'll need to start node red as root/sudo as you're accessing a privileged port (\<1024)

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [13 January 2019 10:49 UTC](https://discourse.nodered.org/t/amazon-echo-hub/6724/5 "2019-01-13T10:49:30Z")

</div>

Thanks for your response.  
I've read on this forum that running NR as root is not recommended - so I've avoided it.  
The port-address for the node has been made user-configurable, so I assume there is a port above1023 that Amazon Echo Dot Gen-2 listens on?

---

<div class="post-metadata">

**Author:** ![sammachin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sammachin/32/5121_2.png) [@sammachin](https://discourse.nodered.org/u/sammachin)\
**Post date:** [13 January 2019 11:09 UTC](https://discourse.nodered.org/t/amazon-echo-hub/6724/6 "2019-01-13T11:09:53Z")

</div>

I'm not massively familiar with it but I think what this node is doing is replicating the way an echo connects to a phillips hue bridge, eg over the local network, all other smart home skills on alexa are cloud-cloud hue is the only LAN based service.  
So the Amazon Echo node is making your NR look like a Hue Bridge that the echo can then discover and connect to.  
It see from the code that the node uses the SSDP protocol to announce the port that the server is running on, and then it listens on that port for requests from the Echo to your Nodes, I expect that (at least some) of the echo devices will only connect to the server on port 80 as it was only ever designed to work with the hue's proprietary protocol and this is a bit of a hack (although quite a nice one!)  
If you have a scan through the code [https://github.com/datech/node-red-contrib-amazon-echo/blob/master/index.js](https://github.com/datech/node-red-contrib-amazon-echo/blob/master/index.js) you'll see various references to `hue` and what looks like a hard coded username which is presumably all reverse engineered from the hue stuff, A lot of this stuff was done in [https://github.com/bwssytems/ha-bridge](https://github.com/bwssytems/ha-bridge) to allow people to create their own hue clone devices for Alexa to use.

In summary its not a case of finding a port that the Echo will listen on its a case of Node Red listening on a port that the Echo will connect TO

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [13 January 2019 13:21 UTC](https://discourse.nodered.org/t/amazon-echo-hub/6724/7 "2019-01-13T13:21:04Z")

</div>

Hi Sam,  
Thanks for your very detailed explanation which makes complete sense.

Cheers from David.

---

<div class="post-metadata">

**Author:** ![scargill](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scargill/32/1118_2.png) [@scargill](https://discourse.nodered.org/u/scargill)\
**Post date:** [25 July 2019 14:40 UTC](https://discourse.nodered.org/t/amazon-echo-hub/6724/8 "2019-07-25T14:40:17Z")

</div>

I've been using it on port 8980 successfully for some time now with Generation 3 dot, to turn stuff on and off by MQTT (with a debug out of the device node to make sure it is working). Can't use port 80 as that is used elsewhere. Just today it has stopped working. NO idea why at this point. I'm running this on a Pi3 with Raspbian Buster (used to run on Stretch).

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [25 July 2019 18:36 UTC](https://discourse.nodered.org/t/amazon-echo-hub/6724/9 "2019-07-25T18:36:16Z")

</div>

On my new Pi4, I tried this out using port 8980 but it wasn't found as a device

So I stopped node-red - re-launched it as sudo node-red - had to re-add the node-red-contrib-amazon-echo using palette manager and it was discovered 1st time and responded to on/off commands 🙂

I'll have to check it out and see if its more flexible than node-red-contrib-alexa-home-skill which is my current Alexa node-RED solution

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [25 July 2019 18:57 UTC](https://discourse.nodered.org/t/amazon-echo-hub/6724/10 "2019-07-25T18:57:29Z")

</div>

What sort/version of Echo Dot are you using?

I gave up trying to get my Amazon Echo Dot Gen-2 to work with it.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [25 July 2019 19:10 UTC](https://discourse.nodered.org/t/amazon-echo-hub/6724/11 "2019-07-25T19:10:05Z")

</div>

I'm using a £80 ,full size Alexa Echo bought 3 months ago - no info on it to say what version it is - it won't tell me what version it is - nothing the app to say what version it is

---

<div class="post-metadata">

**Author:** ![scargill](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scargill/32/1118_2.png) [@scargill](https://discourse.nodered.org/u/scargill)\
**Post date:** [25 July 2019 21:07 UTC](https://discourse.nodered.org/t/amazon-echo-hub/6724/12 "2019-07-25T21:07:36Z")

</div>

Uninstalled, reinstalled, works a treat, no idea what was wrong.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [25 July 2019 21:14 UTC](https://discourse.nodered.org/t/amazon-echo-hub/6724/13 "2019-07-25T21:14:53Z")

</div>

> [@scargill](#):
>
> I've been using it on port 8980

What led you to using this port?

---

<div class="post-metadata">

**Author:** ![scargill](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scargill/32/1118_2.png) [@scargill](https://discourse.nodered.org/u/scargill)\
**Post date:** [26 July 2019 06:51 UTC](https://discourse.nodered.org/t/amazon-echo-hub/6724/14 "2019-07-26T06:51:40Z")

</div>

Any random port above 1000 essentially as I needed port 80 for something else. SO, then a slight mod to the Pi as here (Feb 2019 update) - [https://tech.scargill.net/the-script/](https://tech.scargill.net/the-script/) and it all worked – until it didn’t – then it did again. All is well.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [26 July 2019 10:37 UTC](https://discourse.nodered.org/t/amazon-echo-hub/6724/15 "2019-07-26T10:37:16Z")

</div>

> [@scargill](#):
>
> SO, then a slight mod to the Pi

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/5227f9070dbbaba8f83e0fe5e595dc044af48699.png)

That explains why it didn't work on mine 🙂  
Will try that out - looks like a nice workaround to get Node-RED to use low ports without running as root 🙂

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [26 July 2019 11:44 UTC](https://discourse.nodered.org/t/amazon-echo-hub/6724/16 "2019-07-26T11:44:35Z")

</div>

Needed a slight modification as my Pi is using WiFi but working now without having to run Node-RED as root 🙂

wlan0 instead of eth0

> sudo apt-get install iptables-persistent  
> sudo iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT  
> sudo iptables -A PREROUTING -t nat -i wlan0 -p tcp --dport 80 -j REDIRECT --to-port 8980  
> sudo netfilter-persistent save  
> sudo netfilter-persistent reload

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [26 July 2019 14:41 UTC](https://discourse.nodered.org/t/amazon-echo-hub/6724/17 "2019-07-26T14:41:36Z")

</div>

Just implemented the above mods on an old Raspberry Pi-1 running Stretch and NR v1.0.0-beta.2 and can confirm the Amazon Echo Hub works really well with an Amazon Echo Dot (2nd Generation).

Thanks for sharing the sudo commands.

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [26 July 2019 16:25 UTC](https://discourse.nodered.org/t/amazon-echo-hub/6724/18 "2019-07-26T16:25:50Z")

</div>

This discovery is going make one of my IoT students so happy (when he/they return to school in September).  
He was given an Echo Dot (Gen 3) as a Christmas present and brought it to the IoT Club but we couldn't get it to work with the Amazon Echo Hub because of the Port 80 issue.

The above 'sudo commands' will fix that problem - like it did with my Echo Dot (Gen 2).

Can't wait to see the smile on his face in September.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [26 July 2019 16:44 UTC](https://discourse.nodered.org/t/amazon-echo-hub/6724/19 "2019-07-26T16:44:33Z")

</div>

**[UPDATED to handle % from 0 to 100]**

Just been playing around seeing if I could extract more info but all I've managed to do is get it to output msg.percentage

But at least that gives a easy number to use downstream

node-red/node\_modules/node-red-contrib-amazon-echo/index.js

```
function payloadHandler(hubNode, deviceId) {

  var msg = getDeviceAttributes(deviceId, hubNode.context());
  msg.rgb = colorSHB2RGB(msg.hue, msg.sat, 254);
  var percentArray = ["1","26","52","77","102","128","153","178","203","229","254"];
  var percentArray = [1,4,6,9,11,14,16,19,21,24,26,29,31,34,36,39,41,44,47,49,52,54,47,59,62,64,67,69,72,74,77,79,82,84,87,90,92,95,97,100,102,105,107,110,112,115,117,120,122,125,128,130,133,135,138,140,143,145,148,150,153,155,158,160,163,165,168,171,173,176,178,181,183,186,188,191,193,196,198,201,203,206,208,211,214,216,219,221,224,226,229,231,234,236,239,241,244,246,249,251,254];
  msg.percentage = percentArray.indexOf(msg.bri);
  msg.payload = msg.on ? "on" : "off";
  msg.deviceid = deviceId;
  msg.topic = "";

  hubNode.send(msg);
}
```

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [26 July 2019 18:52 UTC](https://discourse.nodered.org/t/amazon-echo-hub/6724/20 "2019-07-26T18:52:39Z")

</div>

Same here!

[Next page](https://discourse.nodered.org/t/amazon-echo-hub/6724.md?page=2)
