Amazon Echo Skill for OpenHAB available!

Anybody? Just trying to see if there is any kind of update on this. Thanks!

@Tek420 - Thanks for reaching out. Yes Alexa-HA is capable of MUCH more than the other smart home voice interfaces I have seen to date. Alexa-HA is unfortunately only currently compatible with openHAB v1.x. Iā€™d like implement openHAB v2.x support too, but do not have any timelines on that until I make the transition to OH2 myself. This custom skill approach has continued to work well for my personal needs and others, which is part of the reason there hasnā€™t been much development momentum since. I have lots of ideas for improvement and the desire to implement them, but have been totally swamped. Fortunately Alexa-HA is fairly modular and shouldnā€™t be too difficult to extend, adapt to OH2 or even other HA solutions if there is interest.

@digitaldan and I also have another project underway when time permits which works for both OH1 & 2 using my.openhab.org to vastly simplify the initial setup. This uses the Amazon Smart Home API for device discovery and control. More updates on that to follow as that becomes ready for releaseā€¦ .

If youā€™d like to give Alexa-HA a try with OH1, feel free to PM me or better yet open a github issue and we can work through any hurdles!

.

Also, I should add that nothing prevents you from using the Hue Emulator approach along side Alexa-HA! Itā€™s just more setup/configā€¦ :wink:

@d0t

Thanks much for the update!! That might be the reason I could not get it to work is Iā€™m trying to get it on OH2!

I have OH2 working ā€˜OKā€™ but am having some issues with persistence and the Hue Emulator and I am learning a LOT but havenā€™t quite found the answers to the things I am seeing in the logs. No official coding skills so all learning via Google and just do not think the OH2 docs and forums are geared to my skill level.

That said I just may scrap the OH2 for the OH1 install as there seems to be more documentation. Really just need to get the basics then add your Alexa-HA. The only way to go as I see it. I appreciate the offer for help and will reach out if needed via github.

If you do get into working Alexa-HA for HA2 and I can be of any assistance please let me know. I would love to help but just remember I am a Google coder!!

Thanks again and have a good one!!

Dave

Quite welcome, Dave!

Alexa-HA was under development before OH2 had a release candidate. I just realized that OH1 ONLY support is not mentioned in the documentation, and only eluded to in the source code. To help clarify this, I created a GitHub issue related to adding OH2 Support. I will also update the documentation to make this more clear and up front to others. :slight_smile:

I appreciate the offer and will keep you in mind as we dive deeper into OH2 support.

Best regards,
.

Mike,

Maybe Iā€™ve missed something but i canā€™t get locations or item types with two words to work. For example location of ā€œliving roomā€ minus quotes in the slot value. Also itemtype (itemname) of ā€œceiling lightā€ doesnā€™t work either. Using the Service Simulator with the following utterance ā€œopenhab, turn on the ceiling light in the living roomā€ outputs a service response of:

{
  "session": {
    "sessionId": "SessionId.ff81e5a7-db83-4cb8-9e6a-ca2608c63fbd",
    "application": {
      "applicationId": "amzn1.ask.skill.2c5cadc6-77ad-4da9-96a7-a58d12c13261"
    },
    "attributes": {},
    "user": {
      "userId": "amzn1.ask.account.AFP3ZWPOS2BGJR7OWJZ3DHPKMOMNU72TFFBVGDTPIHAGVM2A7INVTNWXAH2636CCPOJHLAFFARSINQMTZGE6JHG4P3ZXNIIODRT2YCIYAO2WDMD77BP2MC75N5DGCERUPIKO7D4SHWFFBWMUCIXTLTSGMHYXU3AKQ5BH6RDSVK6C4PQAFG6O6AOCYTKEKDVNGSPZDC4NEEZXJXY"
    },
    "new": true
  },
  "request": {
    "type": "IntentRequest",
    "requestId": "EdwRequestId.ede42412-c73e-4bd2-9020-d0283dc3a0ef",
    "locale": "en-US",
    "timestamp": "2016-09-15T21:21:08Z",
    "intent": {
      "name": "Switch",
      "slots": {
        "Action": {
          "name": "Action",
          "value": "on"
        },
        "ItemName": {
          "name": "ItemName",
          "value": "ceiling light"
        },
        "Location": {
          "name": "Location",
          "value": "living room"
        }
      }
    }
  },
  "version": "1.0"
}

And a service response of:

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

Tried with all the variations of the utterance and i get the same response regardless. In config.js I have the following:

config.HA_locations = ['all','basement','living room'];

// Item configuration - itemName / Location / itemName mappings
config.item = {
    'light': {
        'basement': 'basement_switch',
        'living room': 'living_room_floor_lamp',
        'all': 'Lights',
        default: 'Lights'
    },
    'dimmer': {
	    'basement': 'basement_dimmer',
	    'living room': 'living_room_floor_lamp_dimmer'
    },
    'ceiling light': {
	    'living room': 'livingroom_switch',
		default: 'livingroom_switch'
    }
};

Any idea what I am doing wrong?

Thanks!!

@lordsiris - I implemented a bit of a temporary ā€˜hackā€™ for working with location names that include ā€™ roomā€™ at the end. This certainly needs cleaned up and refactored, but in the immediate try using just ā€˜livingā€™ as the room name and Iā€™d expect it should work with the item named ā€˜ceiling lightā€™!

Otherwise you may need to stick with single names for locations/item namesā€¦ Either way please let me know how it goes.

All the best,
.

Mike, Thank you for the effort you have taken to publish and support the Alexa-HA interface. I am really excited about being able to link Alexa to OpenHAB. I have been fooling around with OH for a little while and have some basic interfaces implemented. But there are still a lot of blind spots in my understanding.

I am intrigued by some of your sample configuration entries in Alexa-HA. One, I want to be sure I am adjusting the configurations on both sides in the best manner possible. Also I am curious how/what you are doing on the OH side with the ā€œMode/Sceneā€, Volume, Music and some similar items. Would it be possible to point me to or provide some item/rule/sitemap examples that match up to the Alexa sample config?

Also one really basic question, do all the translations need to be present in the items file or can the sitemap and/or rules/action files also be referenced by Alexa-HA?

btw, I do have Alexa-HA installed and running with for the most part your default sample config and have some lighting working using your group names. Now I want to really dig in an get it configured (both sides) as full function as time permits.
thanks again for an excellent application.
david

Hello David,

I really appreciate the kind words. Give me a some time to get some detailed examples into the Wiki for all.

FYI - Scenes are working alright here, but Volume has not been adequately developed/tested yetā€¦ Modes/scenes are currently numeric OH items which OH rules react to - making it much easier to extend rather than doing everything inside of Alexa-HA code. This makes home automation much more customizable via only the OH rules; abstracts the Alexa-HA voice interaction.

Regarding your question ā€œdo all the translations need to be present in the items file or can the sitemap and/or rules/action files also be referenced by Alexa-HAā€ - AlexaHA config targets the same item names defined in OpenHAB items. Alexa-HA doesnā€™t currently read any of the OH item/rule definitions, rather you can trigger OH custom rules which can effect many OH items, so that voice interaction can do anything imaginable.

The forthcoming examples will help to clarify :slight_smile:

Thanks again Mike, you may just have unlocked the keys to the universe ā€¦
ā€œnumeric OH items which rules react to ā€¦ā€!

1 Like

First of all, sorry for not being active here lately, the thing is that I have rented out my flat on airbnb since may and hence does not have access to openhab or my echo lately, yes I miss my alexa!

Well I see that Amazon will launch echo dot 2 in october, so I think I will grab a six pack(1 for each room) and get back into Openhab.

Today I tried to search for the skill in the alexa app, any idea when it will be an official skill?

Should we make an tutorial(youtube video) on how to get started with alexa and openhab?

Tutorial / Video would be very welcomed. Iā€™m about half way through the process and am getting bogged down. Alexa to OH2 is a game changer. Iā€™m not sure why it hasnā€™t been an area of concentration?

Partly due to the limitations of Alexa, tho it is now rumored that push notifications will soon be a reality.

I decided to redouble my efforts. It looks like Iā€™m one error away from getting my Test to work correctly. Then I might be able to support questions.

@as400rcool - Anytime :grinning: Much more to come!

@skatun & @Toneus - launch date is TBD yet; Iā€™d definitely like to see a intro/tutorial for Alexa-HA and the Official ā€˜Smart Home Skill APIā€™ tooā€¦ If any one is up to help tackle the challenge please reach out.

@skatun - agreed, these Amazon Echo Dot packs seem to be the best bang for the ā€˜home automationā€™ buck ATM when coupled with OpenHAB :slight_smile: Iā€™m interested in procuring a bunch of Echoā€™s for their new ESP features especially (many Echoā€™s, but only the nearest one intelligently responds to your HA commands). Official OpenHAB skill is coming along as time permits, and hosting it yourself is still an option in the mean time :sunglasses:

@Toneus - Excellent! PM or contact me otherwise if I can help with your setup.

@sipvoip - Iā€™ve been following the mentions of push notification support very closely; hope also that sometime soon we will finally have the ability for Echo(s) to announce stuff as it happens! Alexa HA can do this today via Bluetooth and OH rules but its too ā€˜cludgyā€™ overall. The potential use cases for an official OH binding/Skill which supports full I/O are nearly endlessā€¦ :grin:

.

1 Like

Well it seems like both Seedstudio and google is comining with mic array next monthā€¦ Maybe those will be easy to integrate with Openhab?

Itā€™s working! Nice job Mike.

I have been playing with speeds github stuff, they are making progress, but still a long way to go, no real API yet.

@sipvoip I have only been using seed wio with their api, they have json object and were easy to integrate into OH by using regex, but the micarray might be a complete different story though!

Hello everyone,

Getting the following error on debug when trying to use skill. Please help!

TypeError: Cannot read property 'toString' of undefined
at Object.AlexaAppServer.start.preRequest (/home/alexa/node_modules/alexa-app-server/api/server.js:16:44)
at Object.handle (/home/alexa/node_modules/alexa-app-server/index.js:75:69)
at next_layer (/home/alexa/node_modules/alexa-app-server/node_modules/express/lib/router/route.js:103:13)
at Route.dispatch (/home/alexa/node_modules/alexa-app-server/node_modules/express/lib/router/route.js:107:5)
at /home/alexa/node_modules/alexa-app-server/node_modules/express/lib/router/index.js:195:24
at Function.proto.process_params (/home/alexa/node_modules/alexa-app-server/node_modules/express/lib/router/index.js:251:12)
at next (/home/alexa/node_modules/alexa-app-server/node_modules/express/lib/router/index.js:189:19)
at next (/home/alexa/node_modules/alexa-app-server/node_modules/express/lib/router/index.js:166:38)
at Layer.staticMiddleware [as handle] (/home/alexa/node_modules/alexa-app-server/node_modules/express/node_modules/serve-static/index.js:55:61)
at trim_prefix (/home/alexa/node_modules/alexa-app-server/node_modules/express/lib/router/index.js:226:17)
at /home/alexa/node_modules/alexa-app-server/node_modules/express/lib/router/index.js:198:9
at Function.proto.process_params (/home/alexa/node_modules/alexa-app-server/node_modules/express/lib/router/index.js:251:12)
at next (/home/alexa/node_modules/alexa-app-server/node_modules/express/lib/router/index.js:189:19)
at /home/alexa/node_modules/alexa-app-server/node_modules/body-parser/index.js:58:7
at IncomingMessage.onEnd (/home/alexa/node_modules/alexa-app-server/node_modules/body-parser/node_modules/raw-body/index.js:119:7)
at IncomingMessage.g (events.js:260:16)
at emitNone (events.js:67:13)
at IncomingMessage.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:921:12)
at nextTickCallbackWith2Args (node.js:442:9)
at process._tickCallback (node.js:356:17)

First line points line 16 in server.js, which is password. Do I generate this password and use same in server.js and in apps/alexa-ha/config.js? Or where is that password from?

Thank you!