question

Pierce Cohen avatar image
Pierce Cohen asked ·

Converting Alexa Skill to Smart Home Skill, need Java intent handler

Hi, I had written an Alexa Skill in Java prior to the availability of the Smart Home Skill kit. I am planning to convert the Alexa skill to a Smart Home skill in order to take advantage of the built in Discovery request. Does anyone have a sample intent handler for the Smart Home Skill kit that's written in Java? I prefer not to have to re-write all my code in Python or JS, and haven't found a simple way to call my Java methods from either Python or JS. Any help would be appreciated.

alexa skills kitalexa smart home
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Martin J Christiansen avatar image
Martin J Christiansen answered ·

Smart home skill integration is different than a custom skill. You don't implement an intent handler on your server but instead for whatever reason you're forced to implement an adapter as an aws lambda function that will convert the smart skill api calls into calls to your own service.

Reading through the FAQ and Steps to Create a Smart Home Skill should clarify things a bit.

https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/content/smart-home#faqs

https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/steps-to-create-a-smart-home-skill

I couldn't find a sample lambda skill adapter written in Java, but you can use the java lambda documentation as a guide:

http://docs.aws.amazon.com/lambda/latest/dg/java-handler-io-type-pojo.html

10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Pierce Cohen avatar image
Pierce Cohen answered ·
Over a week and 60+ views later, but no responses. Is there an intent handler written in Java for Smart Home? Is there one in the works from Amazon?
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Pierce Cohen avatar image
Pierce Cohen answered ·

Martin, thanks for the detailed answer. I was not aware of the java lambda documentation - it's very helpful and the task ahead looks to be pretty straight forward.

10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.