Amazon Echo Skill for OpenHAB available!

Thanks for the tip, I’ll give it a go in a VM.

I managed to make good progress last night. My SSL Certificate issues are all sorted now. After reading your response I have also withdraw my submition which means I’m all ready to go,

My next question is how do I get the skill added to my Echo? I may have missed it along the way, but I can’t seem to find anything that explain how I associate the two.

Thanks.

Garry

Once you complete your skill using development portal for Amazon Alexa, and enable it, it should show up in your Skills using Alexa App. Initiate it using your keyword. For me it is openhab, so I proceed saying, “Alexa, ask openhab to turn of kitchen lights”

Now I see where the issue is. I created a developer portal account that is separate from my Alexa account. What your saying is that you need to make sure that both accounts are identical for this to work as expected.

@d0t Thank you for the great skill. Got it work today! Just a few question is it possible to ask for a status report? like it will reply how many/ which lights are on, door/windows are open etc?

Yes sir! The developer account should be the same Amazon account your Echo uses. That is how the Skill becomes usable on your Echo devices even when the Skill has not been officially published. I will update this in the README/QUICKSTART documents to clarify this point!

Hey, thanks a lot.

I have a pretty extensive ‘status update’ modeled after IronMan’s J.A.R.V.I.S… Its basically a custom rule on the OH side which pulls together a bunch of useful info throughout the house. Will make a point to get this up on the Alexa-HA wiki soon, and let you know!

I am really interested in that one. Please remember to announce when you add that!!!

I think I’ll be doing this. I’ll use the bridge for quick control and Alexa-ha for more specific tasks.

@d0t

Can you explain how the modes configurations work? I’m reading through it and I’m missing where it links to openhab.

Before Alexa showed up, i controlled lighting modes, scene modes, etc, in OH via number items. A specific number in a “room_mode” number item changed lighting levels, startup volume, time outs, etc. The way the config reads (at least to me), it looks like it’s in line with what i’m doing in that if I ask Alexa to set a certain mode it assigns a number to an item. But I don’t see where to specify the number item. I could be way off base in how the mode configuration works so please, enlighten me.

Also, and this may require a separate post, but does anyone know of a way to use alexa-HA to control the echo via openhab. Basically looking to reverse the direction of the commands. Triggering the echo to start listening by just walking into the room seems like a sexy idea to me. Most importantly, it would be nice to be able to control how loud she is based on time of day or room mode. Currently, if i’m listening to music loudly in the middle of the day and forget to turn it down, she’s screaming at me at night when people are trying to sleep. I’m really hoping Amazon had enough foresight to allow this…

Error: There was a problem with your request: Incorrect syntax for the slot ‘{-|Location}’. Each token must consist only of alphabets, white-spaces and valid punctuation marks. Valid punctuation marks are periods for abbreviations, possesive apostrophes and hyphens. Occurred in sample ‘Switch to turn {ON|Action} the {lights|ItemName} in the {-|Location}’ on line 1.

I’m getting the above error while trying to save the Sample Utterances using the default configuration from the install. Where have I gone wrong?

Thanks

Garry

Post line 1 so we can see what you’re doing.

Better yet, maybe post the entire thing…

Here you go.

Switch to turn {ON|Action} the {lights|ItemName} in the {-|Location}
Switch turn {OFF|Action} the {motion lighting|ItemName} in the {-|Location}
Switch to switch {ON|Action} the {fan|ItemName} in the {-|Location}
Switch switch {OFF|Action} the {stove|ItemName} in the {-|Location}
Switch to flip {ON|Action} the {music|ItemName} in the {-|Location}
Switch flip {OFF|Action} the {light|ItemName} in the {-|Location}
Switch to turn {ON|Action} my {lights|ItemName} in the {-|Location}
Switch turn {OFF|Action} my {motion lighting|ItemName} in the {-|Location}
Switch to switch {ON|Action} my {fan|ItemName} in the {-|Location}
Switch switch {OFF|Action} my {stove|ItemName} in the {-|Location}

Remove -| from Location, so it looks like:

Switch	to turn {ON|Action} the {lights|ItemName} in the {Location}
Switch	turn {OFF|Action} the {motion lighting|ItemName} in the {Location}
Switch	to switch {ON|Action} the {fan|ItemName} in the {Location}
Switch	switch {OFF|Action} the {stove|ItemName} in the {Location}
Switch	to flip {ON|Action} the {music|ItemName} in the {Location}
Switch	flip {OFF|Action} the {light|ItemName} in the {Location}
Switch	to turn {ON|Action} my {lights|ItemName} in the {Location}
Switch	turn {OFF|Action} my {motion lighting|ItemName} in the {Location}
Switch	to switch {ON|Action} my {fan|ItemName} in the {Location}
Switch	switch {OFF|Action} my {stove|ItemName} in the {Location}

Also, make sure you create custom slot types:

I’m getting closer to getting this working. Here’s my latest issue to resolve, it’s got to be purely down to getting the configuration to match.

From the portal I’ve typed; switch off living room lights

  "request": {
    "type": "IntentRequest",
    "requestId": "EdwRequestId.6366b7a6-6a40-4242-a9ec-f37823b2b492",
    "locale": "en-GB",
    "timestamp": "2016-10-28T20:23:51Z",
    "intent": {
      "name": "Switch",
      "slots": {
        "Action": {
          "name": "Action",
          "value": "off"
        },
        "ItemName": {
          "name": "ItemName",
          "value": "lights"
        },
        "Location": {
          "name": "Location",
          "value": "living room"
        }
      }
    }
  },
  "version": "1.0"
}

This is the result;

{
  "version": "1.0",
  "response": {
    "outputSpeech": {
      "type": "SSML",
      "ssml": "<speak>I cannot currently switch your living room lights</speak>"
    },
    "card": {
      "content": "I cannot currently switch your living room lights",
      "title": "Alexa-HA",
      "type": "Simple"
    },
    "shouldEndSession": true
  },
  "sessionAttributes": {}
}

To add to that if I speak to the Echo and say; Alexa ask OpenHAB switch off living room lights. I get this response; Sorry something went wrong.

Nothing is displayed on the server console, so clearly there is a disconnect between the skill and my Echo

In the portal you have to include “alexa, ask to blah blah blah…” before the command.

Also, I was having a hard time at first but I opened the config and used the utterances as a guide to verbally issue the commands. Turns out what I thought was broken was me not asking the right questions.

As far as the intents, utterances, and slots, I recommend using exactly what’s in the sample folder verbatim. Once you get it working modify them from there. That way if somethings not working you’re trouble shooting the exact changes you’ve made.

Thanks for the reply and the suggestion. Tried it and still not getting the result. I’m going to start a fresh once again and do as suggested and start off with the example config.

I completely forgot I had the same issue on the home stretch! There was obviously communication to Alexa-ha and the configurations matched but Alexa just couldn’t control anything. I figured it out rather quickly so that’s probably why I forgot.

If I’m remembering correctly, the configuration provided either assumes OH is running on https or I set it to https for some weird reason. I use my.openhab for external connections to oh so I never bothered to setup https. Check that out see if it helps. My symptoms exactly match your description of the problem. The settings are in the same file that you specify the OH server (I can’t remember the file name at the moment). Also the username and password to OH, if your not using authentication leave the variables blank (just leave the quotes “”). You can also scroll down and remove the variables from the URL but I recommend leaving it blank and not mess with the code.

Looks to me like Alexa-ha doesn’t just send the command to oh and hope for the best. So if it can’t connect to OH, something went wrong.

I’m working through the steps in the QUICKSTART-INSTALL file but I’m completely lost at this step:

Set the various AWS ASK related settings as needed - applicationId is available from Amazon Developer Portal

Can anyone expand on that for me please?

Thanks,

Steve.

@higgers - The applicationId, IIRC, used to be available from the developer console. I’d suggest commenting this check out of index.js to get started. You can later re-enable it and the applicationId mismatch should get logged to your AlexaHA logfile - use that to update config.js.

Hope this helps; best of luck!

@Maximo

Sorry to see you are not having much luck getting started here; there shouldn’t be a need to start anew. Must be something (relatively) simple we are missing. Please share where you are @ and feel free to PM to get this sorted!

.