Between both of them, you should be able to get it running. Any questions feel free to ask - the Readme is far too basic and the Heath page fills in most gaps but isnât totally there.
Thanks for the feedback/guidance.
I found another way to get this done, and was curious what the community thinks about this (as some may find this a hack).
I have my openhab running on a raspberry pi (with openhabian). This openhab instance connects to my âprivate cloud serverâ and Alexa doesnât work with this instance in its current form.
I installed a second instance of openhab in a docker image on the same raspberry pi (this doesnât have to be in a docker or on the same raspberry pi; can be on any hardware in the same network). The 2nd instance is configured the exact same way as the first instance (from items, things point of view) with the difference that the second instance connects to the standard openhab cloud.
The things, items files are the same on both instances. I removed the sitemaps and rules from the 2nd instance. This second instance of openhab is in principle my interface to Alexa and it works just fine.
The first instance is connected my private cloud server and used to manage the sitemap, etc.
My home is mostly using MQTT based HW/switches/lights/pool/audiosystem, philips hue and wemo. All those continue to work fine with this dual setup.
Using the provided README, I am trying to setup the Alexa Skill. But somehow I get stuck.
What I have done so far:
Create an AWS account (actually, I already had oneâŠ).
Create an Amazon Developer Account (using the same AWS account).
Checked the installed node.js version with node --version: v10.15.2
Create AWS credentials for ASK with these AWS instructions. Created an account, policy and assigned it to a new group as per AWS instructions.
Saved the ID and Secret to be used in ask init later.
Run sudo npm install -g ask-cli. .
Run sudo ask init --no-browser and authorize the ASK CLI.
Updated the ~/.aws/credentials file with IS, Secret and region us-east1 - to use English (US).
Created Login with Amazon credentials.
My private openHAB Cloud instance is accessible from the internet and uses an LE certidicate.
Clone the repository: git clone https://github.com/openhab/openhab-alexa.git into ./openhab-alexa.
Copy the ./openhab-alexa/lambda/smarthome/config-sample.js file to 'config.js` and uncomment and update the three settings: the URL points to my OH Cloud instance, and the OH Cloud login credentials are also added.
Note that in the README, the explanation of changing the config.js is before the instruction to clone the repository, so there is no config-sample.js available yet at that moment.
Deploy the skill and the lambda function with ask deploy.
Setup skill account linking using the skillId from step 13 and my OAuth2 cofig: ask api create-account-linking -s <skillId>. Fill in the details, including Client ID and Secret from step 9, which results in âAccount linking created successfullyâ.
Enable skill with account linking: Thatâs where things get a bit confusing. When going to the Alexa Skill Console (clicking on the link in the README), I donât get a âDev Skillsâ tab and no mention of openHAB. Instead, I see the OOBE screen for Amazon devices like Echo (Dot). If I skip that step (there is an option at the bottom), I enter the Alexa screen where you can play music, add skills, change settings, create Lists, etc. which just hangs. Whichever menu entry on the left I click, no information is actually showing (just the âwaiting ringâ).
What am I missing here?
UPDATE: Logoff and Logon again works miracles here. Looks like I have now linked the skill. Next step is metadata and discoveryâŠ
Looks like I got stuck on the final step: account linking in the Alexa Skill Console. Although I specified both US and EU redirect URLâs (Account Linking and Account Linking), I still get an error when I try to enable it in the Skill Console:
Error Summary
400 Bad Request
The redirect URI you provided has not been whitelisted for your application. Please add your redirect URI in the âAllowed Return URLsâ section under âWeb Settingsâ for your Security Profile on Amazon Developer Portal. Request Details
client_id=amzn1.application-oa2-client.>>REDACTED<<
response_type=code
state=A2SAAâŠrU7
scope=profile
redirect_uri=https%3A%2F%2Fpitangui.amazon.com%2Fapi%2Fskill%2Flink%2F>>REDACTED<<
The mentioned redirect URI in the error message is actually specified when I created the account linking (as is the EU URI).
One thing I could not understand clearly, is the difference between the Reciprocal URI and the Redirect URI that where asked by the ASK command when performing skill account linking. I specified the Alexa redirect URLâs at the latter prompt. This additional prompt âOptional* RedirectUrls for App-to-App Account Linking (separated by comma):â
is not mentioned in the README.
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 ?
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 ?
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.
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
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
The State of the items keeps going away what the reason is for that i will still need to resolve
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.
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.