Private openhab cloud and alexa

Between this thread, the official github, and several others I was able to get my private OpenHAB Cloud and Alexa working. I couldn’t have done it without these other resources; however, as a lot of it is outdated and incomplete, it wasn’t easy to piece it together. Additionally, there are complications due to outdated package versions and some things not working as they did when the package was set up.

I’ve consolidated a tutorial as of doing this in August 2020. I’ve tried to capture most of the key steps, but it’s possible that I’ve missed something since it was reconstructed from what was not initially a smooth install. It’s a lengthy tutorial, so I’ve uploaded it as a PDF, although I know it’s not great for commenting and editing.

openhab_cloud_and_alexa_tutorial.pdf (788.5 KB)

Disclaimer: My understanding of OpenHAB and Alexa is very superficial, at the end-user level. I struggled through this but eventually got it all working. I’m sure that there are errors and better ways, and I’d appreciate corrections and additions. I hope it helps someone else get through it easier than I did.

My environments:

  • OpenHAB Cloud on AWS EC2 (t2.micro) instance running Ubuntu 20.04
  • OpenHAB server on Raspberry Pi 3B running Openhabian 2.5.7-1

OpenHAB Cloud Summary

  1. Set up Virtual Private Server (I used AWS EC2, t2.micro, Ubuntu 20.04)
    a. Set up Key Pair for SSH authentication
    b. Set an elastic (static) IP address
    c. Set up firewall / security rules to allow SSH (22), HTTP (80), HTTPS (443)
    d. Register a domain name
    e. Set up DNS (I used AWS Route 53)
  2. Update and install dependencies
  3. Install Node.js (ver 7.10.1) and NPM
  4. Clone and Configure the OpenHAB-cloud code
  5. Configure nginx (basic setup and testing)
  6. Install letsencrypt and certbot for https certificate and auto renewal
  7. Configure nginx for OpenHAB Cloud, start and test
  8. Apply patch to prevent registration by others
  9. Set up OpenHAB Cloud to run as a service

Alexa Skill Summary

  1. Create AWS Developer account
  2. Create Access Key
  3. Create Security Profile
  4. Create new Security Role
  5. Install Alexa Skills Kit Command Line Interface (ASK-CLI)
  6. Configure and Deploy the Skill
  7. Set up Account Linking and Login with Amazon
2 Likes

One question:
if I have one private with skill alexa deployed, how can I share with other accounts that are using my private cloud (obviously with different alexa account each)?is it possible?

What would you like to do / achieve ?
The skill needs to be shared with the others. As it is a private ( developer ) skill I think you can invite others to test your skill but as far as I remember that is limited to specific amount of time.
If I remember right it is not necessary to create your own ‘private’ skill. You can use the official one and let it point to your private cloud connector.

In the official skill there is the chance to configure the private cloud? sorry I asked in the other post too

The scenario:

  • 5 users using 5 OH instances pointing to my private instance openhab.mycloud.com
  • all 5 users having alexa but with different user obviously

Whats the best option to manage it? Even having all credentials of each of the 5 amazon users, is there any chance to manage it?

I haven’t done that but as far as I remember that is the case.
Difference between them is that they connect to different endpoints in the Amazon cloud as your copy runs in a different instance in the cloud.

As describe top level in the other thread

  • register/create different main accounts in your cloud
  • create userid/credential on each OH instance
  • register the OH instances in related cloud accounts
  • test each connection e.g. via openhab app and via internet
  • link alexa skill account with related cloud account

How you do this? Because mainly as far I know every user has to enable the skill in the own amazon account and browse the private skill

That‘s the issue with private skils i think, they are available only for your account. Therefore, this seems not to be an openHAB related issue and should be adressed to amazon.

Edit: found this one
https://www.cnet.com/home/smart-home/how-to-share-your-custom-alexa-skills-with-friends/

Problem is that in https://blueprints.amazon.com/home you cant see the private openhab-alexa created in the developer account