Private openhab cloud and alexa

Replying to my own post…
I figured it out, more or less. After I added the redirect URLs both at the ask api create-account-linking command (in response to the last prompt not documented in the README) as well as in the Developer Console under Login with Amazon, I could finally complete the steps!

is anyone able to provide a simplistic step by step to get alexa to speak to my openhab instance, the above still assumes a level of knowledge I don’t have ?

I have succesfully setup the openHAB Cloud and a Amazon Alexa and IFTTT connection, i will provide a step by step manual when i get Google Home to work, and when i figure out how to get te OpenHAB-Cloud instance stable because al my devices connected to it keep strugling with keeping a permanent connections to te OpenHAB-Cloud server.

Maby someone who got this stable and can help with it ?

Hi Jorn,
does this

mean Alexa asks you to check the network connection because the device cannot be reached and in the Alexa App e.g. switches toggle between their current state and not reachable via network ?

Yes, it is.

This problem is caused by the private hosted Openhab-Cloud keeps disconnecting, i started a topic about it here: Custom Openhab-Cloud -> Connection dropping

Hope somebody can help with this issue, buth i’m looking into it as we speak to get Google Assistant to work fully with the private hosted openhab-cloud. The connection error seems to be an issue that is probably existing in the github repo.

Hi Jorn,
from your description it seems that I had a similar / the same problem ( see https://community.openhab.org/t/switches-occasionally-do-not-react-are-not-updated/ ). I had to make sure that the keepalive_timeout of the reverse proxy is long enough.

1 Like

Hmmm buth from what i’m looking at is in the log info of the openhab instance where it shows me that it disconnects all the time

EDIT:
@Wolfgang_S Its seems that after setting the keepalive to OFF is does not disconnect any more :smiley:
Note to make: i’m using Apache2 becausse of load balancers on that server that are setup and i don’t want to mess with again :smiley:
The State of the items keeps going away what the reason is for that i will still need to resolve :confused:

1 Like

Note to the people experimenting with this, it is better practice to set the keepalivetimeout to 60seconds.
I now have a stable connection to the private cloud server.

Buth i still get hangups on the alexa socket, will look further into this.

@willplaice If i get everything to work perfectly i will post a tutorial on how to setup everything with you’re own details and texts.

1 Like

All was working well in my private openhab cloud and alexa…now alexa tell me that my skin is disabled but it’s not disabled…what could be?

@epicurean @willplaice

Is there still intrest in a tutorial on how to setup OpenHAB Private cloud with IFTTT, Amazon Alexa en Google Assistant?

Due to the Covid-19 Virus, we are currently in a Lockdown Lite (note the Lite, its Belgium -_-), so i have some spare time, if there is intrest i will create a full up to date tutorial.

2 Likes

Jorn, it’s interesting for me regarding to openhab private cloud and Amazon alexa assistant.

Thank you in advance.

Absolutely!!. Much Thanks for putting aside time for this

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