Official Alexa Smart Home Skill for openHAB 2

Hey Anjana,
thanks for your response!
I have the official skill for Alexa and connected it via myopenhab and the connector from latest OH2 Snapshot.
Where and how can I change the scope or the Payload version?
I read, that V3 implies that I build my own Dev Skill on Amazon, but I could not see how to switch to V2 and if I am currently on V1.

Nevertheless I see some hope here, since you were able to resolve the issue with this fixes, while I’m somehow lost on this right now…

Thank you!

My setup is bit different. I use my own private openhab-cloud setup with a my own Alexa skill. If you are using official Alexa skill with myopenhab.org setup, you shouldn’t have any problems. I just changed my cloud to myopenhab.org, and signed in to alexa app using the same email I registered with myopenhab.org and was able to discover devices without any issue. (Note: Private alexa app authorize with amazon.com login where as official alexa skill authorize with myopenhab.org login)

Lets debug and see what causing this issue. Can you confirm the following:

  1. You can see your items in myopenhab.org dashboard
  2. You have defined your items with proper formatting e.g.Switch LightSwitch “Light Switch” {connector details}
  3. Any errors as you start openhab or send a command to it. You can check this with tail -f /var/log/openhab2/openhab.log and tail -f /var/log/openhab2/events.log commands

Hey Anjana,
thanks for your help!

  1. Yes
  2. Yes
  3. I cant see any errors relating to this (there are some for my zwave controller (offline), but they resolve themselves after a few seconds (going online))

I just tried to build the skill myself (v3 and v2) and was able to link everything together, but still no luck in discovering my devices. Is there a way to confirm, that the my self built skill is reaching openhab? So the logs show the errors if I start the discovery but this can also be due to the official skill, which is still installed. I fear to disable it, since then I wont be able to use even the “old” devices.

If it is working, I am open to either repair my own skill or the official version.
So everything is working fine, even Alexa with the known devices, but i cannot figure out how to discover the new ones.

UPDATE: I found, that its not the skill or the plugin but some of my items appear to be malfunctioning. I found it, since it is working if I just try it with one item file but not with all of them. So I have to investigate more on these files than on the actual skill.
For my personal interest: You made a normal portforward, installed the basic auth method and then just pointed the skill to your domain rather than to myopenhab.org?
Thanks again :smiley:

Good that you are making progress…

I didn’t do any port forwards. I had a AWS server with openhab-cloud running. Used oauth from amazon to authorize and the skilled talked to openhab-cloud through basic authorization. Follow this tutorial and ask any question when you get in to trouble.

1 Like

Hey anjana,

I did all this and it is working.
My question was, how you mitigated the cloud connector. If I point the skill to my own domain with openhab available to the outside (secured and so on) instead of the myopenhab.org it should work too, right? (From what I understood, that is, what you did with openhab on AWS?)

So here’s how it works…
The cloud connector resides in your OpenHAB installation which (I assume) sits at your home. You don’t have to migrate this anywhere, but you have to point it to your OpenHAB-Cloud instance by changing baseURL in :/etc/openhab2/services/openhabcloud.cfg

Minimal configuration would looks like this:

baseURL=https://your-openHAB.com/
mode=remote
expose=lights,SW2_bedroom_light,SW2_bathroom_light,SW2_ceiling_light

You don’t point your skill to your openhab, but to your openhab-cloud (I assume this is what you intended). You do this by adding user:pass and openhab-cloud url in your /opt/openhab-alexa/config.js file. First few lines should looks like this:

module.exports = {
    userpass: 'you@yourdomain.com:yourpasswd',
    host: 'your-ohcloud.com',
    port: 443,
    path: '/rest/items/',

What I did from OpenHAB-cloud at AWS is as below:

  1. Got openhab cloud up and running
  2. Installed openhab-alexa
  3. Changed config.js and .env files
  4. Deploy lambada function
  5. Configure Alexa skill
  6. Discovery and enjoy!

Hope this helps and open for further questions.

2 Likes

Thanks @anjana55 !
The tutorial confirm to me that my configuration was correct.
But the discorer result is null.
So, I tried to troubleshoot and I found the log on the aws site (cloudwatch management console).
But the log is unclear or at least say nothing:

2018-12-10T21:43:23.847Z 9e2fc3d9-fcc4-11e8-89c7-0f4400460260 Discovery:
{
“header”: {
“messageId”: “c316e28c-770f-421d-8ec4-97718ce3da8b”,
“name”: “DiscoverAppliancesResponse”,
“namespace”: “Alexa.ConnectedHome.Discovery”,
“payloadVersion”: “2”
},
“payload”: {
“discoveredAppliances”: [
{
“actions”: [
“turnOn”,
“turnOff”
],
“applianceTypes”: [
“LIGHT”
],
“applianceId”: “KitchenLights”,
“manufacturerName”: “openHAB”,
“modelName”: “Lighting”,
“version”: “2”,
“friendlyName”: “Kitchen Lights”,
“friendlyDescription”: “Switch KitchenLights Lighting via openHAB”,
“isReachable”: true,
“additionalApplianceDetails”: {
“itemType”: “Switch”,
“itemTag”: “Lighting”,
“openhabVersion”: “2”
}
},

and so on, listing all the devices that have a tag like Lighting or Switchable, but the app on the mobile device does not show any new device. The last line is:

END RequestId: 9e2fc3d9-fcc4-11e8-89c7-0f4400460260

Hmmm, seems the lamba function is called by the skill, do its job, but doesn’t give any feedback to the Alexa skill
What can be wrong in my configuration?
Thank you

I’ve got power meter connected to openhab via modbus binding. Is it possible for Alexa to read power consumption value when asked for it (same like for temperature)? Which tag would I have to use instead of CurrentTemperature?

Can you confirm that you are using Payload V2 in your alexa skill?

This should be possible. Read Version 3 (V3) Item mapping section over here https://github.com/openhab/openhab-alexa/tree/v3

@anjana55 , Yes it is version 2.

thanks, how do I migrate from V2 to V3?

Check the readme in v3 branch, everything is in there.

Somewhere around here:
https://github.com/openhab/openhab-alexa/tree/v3#item-configuration

I changed below .items line

Switch rellaundry0900   "Laundry Fan" (gDevicesoldhouse) [ "Switchable" ]

to

Switch rellaundry0900   "Laundry Fan" (gDevicesoldhouse) {alexa="PowerController.powerState"}

The .items file is refreshed without errors but when I try to re-discover devices on alexa.amazon.com the new item doesn’t show up. Is there anything else I have to change / update?

I am running Openhab version 2.4.0.M7

If you see these discovery logs, that meant your skill actually called lambada for discovery function, but lambada may not returning whats discovered back to the skill.

In that case only thing I can think of is you maybe having some value such as a ARN wrong in your .env file. Im running out of ideas here :frowning:

1 Like

SOLVED!
I’ve tried with a clean .items file with only few lines and it worked well.
so, it seems my .items file is too large
Thanks a lot to all for support and patience

Is this setup to work on the standard myopenhab.org cloud? I do not have items exposed because it is not required with the current version.

As I look at this more, this is the skill on the alexa side of things and not the myopenhab.org side, correct? If that is correct, are there plans to upgrade the current skill to this new version?

TIA

Hi All, sorry for the delayed response here, I have been traveling for the last week. Our skill is in review now, we had submitted it on Dec 2nd for the second time after being rejected without any feedback why, I am guessing there was an issue with our demo server, but I can’t tell for sure. I just reached out to our contact to try and understand whats holding the release of the skill up.

4 Likes

Hi guys,
I’m running openHAB 2.3.0. I tried to add another device to my existing devices inside the Alexa Skill. But I’m not able to find it when I’m searching for new devices inside the alexa webpage.
All my current devices are shown as “offline”.

So I deleted all of them on the webpage an searched again. I don’t get any device into the skill anymore.

Is there currently a problem with the skill connection?
Any idea how to troubleshoot further?

Best regards
Timmi

1 Like