Amazon Alexa adds new "Smart Home Skill API"

JonW said:
In my recent quest to integrate Alexa with my HAI OmniPro system, I had looked at both direct Amazon integration and at the Samsung SmartThings device.  Because of the complexity involved with the Amazon setup, I had decided I would take the easier route and write an interface to SmartThings.  SmartThings has an open API, allows you to create "virtual" devices and has built in support for Alexa without using the "trigger" word kludge.
 
Fast forward two weeks from when I made that decision and now Amazon has released (4/5/2016) an easier framework for integrating Smart Home devices/systems to the Alexa service.  Since I'm still waiting for the SmartThings device to arrive, I started playing with the new Alexa Smart Home API.  You need to create an Amazon developer account to do it, but individual usage should be low enough that there shouldn't be any monthly billing.  The one requirement of using the Amazon interface is that you need a web based/cloud service that Amazon can talk to.  That part I already have with a program I built a few years back that I call HAI Data Service.  It currently logs all HAI activity and lets me control items via web links.  I'll need to extend it and tweak it to work with Amazon, but that shouldn't be too difficult.  Right now, my first learning hurdle is implementing oAuth 2.0 authentication with Amazon, but once that's ironed out, the rest should be pretty easy.
 
I see this new offering from Amazon as really opening up the options for people to integrate with Alexa.  Right now they only support lighting and thermostats with the API, but it's not hard to map macros or scenes into the lighting on/off capability.
 
Blog post from Amazon:  
https://developer.amazon.com/public/community/post/Tx1KIRDSNFDHEA4/Amazon-Enables-Developers-to-Extend-Alexa-s-Smart-Home-Capabilities-a-New-Additi
 
Developer Home Page:  
https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/content/smart-home
I cheated in my quest.  I purchased a Samsung SmartThings hub for $70 or so. I made it a secondary controller in my OmniPro II z-wave network.  The SmartThings hub works directly with Amazon Echo. I had to go into the hub and make each device available to Echo, then had Echo discovery them and now I can control them via Echo.  Seems to work fine.. a bit of brute force solution but ....
 
feobrien said:
I cheated in my quest.  I purchased a Samsung SmartThings hub for $70 or so. I made it a secondary controller in my OmniPro II z-wave network.  The SmartThings hub works directly with Amazon Echo. I had to go into the hub and make each device available to Echo, then had Echo discovery them and now I can control them via Echo.  Seems to work fine.. a bit of brute force solution but ....
Sounds workable...  how is the status reporting working for you?  Do device status' report properly to the Omni when you change them with Echo?
 
Cobra,
you are spot on - the OMNI does not properly reflect the status, I'm not quite sure why. I would think that the ECHO -> Samsung Hub turning on a light would be reflected. The Samsung hub is just a secondary controller. If I manually turn on a light switch it is reflected ( I think, need to go look now).  But bottom line it is not reflected, so I just make sure my OMNI scripts clean everything up at the end of the day (lights on/off, flags etc as appropriate).  It is fun though to just talk to Echo and turns things on!
 
Thanks for providing the details on how to use the Amazon SDK to send a request to a web service. I originially wanted to integrate Alex directly with my C# HAI Logger console application, but didn't want to deal with OAuth. I didn't see your post in time and have partially built out an integration with Samsung's SmartThings hub.
 
SmartThings only supports SOAP and REST, hence the C# web service. Their IDE is a bit cludgy and you can only debug in the form of console logging. Additionally a Device Handler can only recevie a response to a HubAction if the DeviceNetworkId is set to the ip:port of the device in hex. This means if you create 50 dimmer devices only one will receive the response back. What I ended up doing is creating a SmartApp that you define the C# web service IP and port. It enumerates the units on the controller and creates a child controller device and devices for all the units. The response from my web service hits the controller device, which relays the response to the parent SmartApp, which then finds the correct virtual unit device and updates the status. I still need to implement zone status, area status, buttons, and thermostats.
 
I'm using the HAI C# SDK, which makes it easy to receive / send commands to the OmniPro controller, and a WebServiceHost with ServiceContract and DataContract attributes for the REST API. Maybe we could combine efforts and assemble a working app that integrates directly with both Amazon and SmartThings. I like your direct integration of Alexa vs relaying through SmartThings from a speed and reliability standpoint. However the SmartThings integration opens the door to IFTTT for the OmniPro.
 
Jon, have you made any headway with this? I would love to have a full integration between my OmniPro II and Alexa. I'm currently using the Hue Bridge and OpenHab to be able to control my Z-Wave lights via the OmniPro, but it looks like your method has fewer things that can go wrong, so I'd like to give it a shot.
 
Made a bit of headway, but not complete.  I had to sideline it for a while as early this last summer I started the process of selling my business and just wrapped that up 9/1.  I've been travelling since, but I'll be back home in another week and will get to work on some projects.  I'm not going to put a time frame on it, but I hope to have something out in Nov/Dec.   My plan is to just release the code and let others do what they want with it.  It is written in vb.net.
 
Back
Top