WarlaxZ / alexa-home-controller

Control all items in my home from amazon's Alexa
16 stars 5 forks source link

Quick question regarding the ports #5

Open tommp4 opened 7 years ago

tommp4 commented 7 years ago

Hi! First of all, thanks for making this, it looks very promising!

I'm sorry to open up an issue for this, when it's really more of a question. I'm a bit confused as to which ports I need to open where. I got it so that the command node server.jsseems to work, but I'm not sure where to go from here. I already created the Alexa app, and I assume that the URL you need to specify during the process is the one we will be working with. But now, do I port forward? What exactly do you mean by "open a port on your router and set it up within Alexa"? Would you mind just giving me a specific example, I'm sure I can work it out from there. Thanks in advance!

WarlaxZ commented 7 years ago

Hi,

Glad you are having a play with my library, and yeah its a bit of a pain to get running due to the hoops amazon makes you run through, but unfortunately that cant be helped.

So actually its slightly more awkward than just opening a port, as amazon require you to have a web-server set up sat behind https. For this I would recommend running either apache or nginx and reverse proxy through the the node app. There may also be a way to set up certificates in express but I am unfamiliar and I have other things hosted, so for me personally it made sense to just run it through nginx.

Ultimately you will looking to achieve https://yousite.com/alexa/kodi (I use duckdns and letsencrypt, so you have both a free domain name and ssl certificate).

tommp4 commented 7 years ago

Wow thanks for the prompt reply!

Okay, right now I have Kodi set up on my Mac (temporarily, as I just started playing around with it. I have a RPI 3 running openHAB, a home automation software, but I might get another Pi if I get this all to work. Is it possible to do what you suggested, but with Kodi running on OSX? I have (somewhat) worked with Apache before, so if I understand you correctly, ultimately you want an https web-server that receives the commands from Alexa and sends them to the machine running Kodi am I correct?

If you have any further tipps on what to read up to get this working, that would be amazing. I just recently started with all this so I'm very eager to learn. And the motivation of having an Alexa capable of setting up TV shows on demand is more than enough :)