{"id":480,"date":"2016-11-19T11:54:54","date_gmt":"2016-11-19T16:24:54","guid":{"rendered":"http:\/\/blog.thescorpius.com\/?p=480"},"modified":"2016-11-20T14:05:39","modified_gmt":"2016-11-20T18:35:39","slug":"control-x10-amazon-echo-smart-home-skill","status":"publish","type":"post","link":"https:\/\/blog.thescorpius.com\/index.php\/2016\/11\/19\/control-x10-amazon-echo-smart-home-skill\/","title":{"rendered":"Control your X10 Devices with the Amazon Echo using the Smart Home Skill API"},"content":{"rendered":"<p><a href=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonDotX10.png\" rel=\"attachment wp-att-514\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-514\" src=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonDotX10.png?resize=648%2C364\" alt=\"Amazon Dot X10\" width=\"648\" height=\"364\" srcset=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonDotX10.png?w=870&amp;ssl=1 870w, https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonDotX10.png?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonDotX10.png?resize=768%2C432&amp;ssl=1 768w\" sizes=\"auto, (max-width: 648px) 100vw, 648px\" \/><\/a><\/p>\n<p>In\u00a0a <a href=\"http:\/\/blog.thescorpius.com\/index.php\/2016\/03\/25\/x10-amazon-echo-ifttt\/\">previous post<\/a> you&#8217;ve learned how to control your X10 devices using the Amazon Echo and the IFTTT service. But now Amazon allows you to code a <a href=\"https:\/\/developer.amazon.com\/alexa\/smart-home\">Smart Home Skill<\/a> so you can say\u00a0<em>Alexa turn on the lights<\/em> instead of\u00a0<em>Alexa trigger lights on<\/em>. It&#8217;s\u00a0more convenient!\u00a0Let&#8217;s extend the work we&#8217;ve already done to write a Smart Home Skill to natively manage your X10 devices.<\/p>\n<p><!--more--><\/p>\n<p>You will need the following:<\/p>\n<ul>\n<li>You have to do everything in\u00a0<a href=\"http:\/\/blog.thescorpius.com\/index.php\/2016\/03\/25\/x10-amazon-echo-ifttt\/\">this post<\/a> completely except for the IFTTT part (the last section).<\/li>\n<li>An <a href=\"https:\/\/developer.amazon.com\">Amazon Developer<\/a> account. It&#8217;s free.<\/li>\n<li>An <a href=\"https:\/\/aws.amazon.com\">Amazon AWS<\/a> account, because we need the Lambda Service. It&#8217;ll be free if you use your skill less than 1 million times a month, which is a lot. This is a requirement, not optional.<\/li>\n<li>An <a href=\"http:\/\/login.amazon.com\/\">Amazon Login<\/a>\u00a0account, completely free, to authenticate your skill.<\/li>\n<\/ul>\n<p>Alright, let&#8217;s do this!<\/p>\n<h2>Smart Home Skills<\/h2>\n<p>The <a href=\"https:\/\/developer.amazon.com\/public\/solutions\/alexa\/alexa-skills-kit\/overviews\/understanding-the-smart-home-skill-api\">Smart Home Skills<\/a> are a little different than the normal Alexa Skills. Your skill needs a special piece of code called a\u00a0<strong>Skill Adapter<\/strong>. This code has to be written using the Lambda\u00a0Function Service of Amazon, and you can choose to do it in \u00a0a few different languages. We will write it in JavaScript, more on that later. This function has to provide two basic services:<\/p>\n<ul>\n<li><strong>Discovery:<\/strong> This is the procedure that will be called when you say\u00a0<em>Alexa discover my devices<\/em>. It should tell your web server to read the INI file and return a JSON string with all the devices you have configured.<\/li>\n<li><strong>Control:<\/strong> This is the main procedure to turn on\/off things or to dim\/brighten lights.<\/li>\n<\/ul>\n<p>You already implemented the\u00a0<strong>Control<\/strong> interface in the\u00a0<a href=\"http:\/\/blog.thescorpius.com\/index.php\/2016\/03\/25\/x10-amazon-echo-ifttt\/\">previous post<\/a>, but you need to create an interface on your web server to do the discovery.<\/p>\n<p>As you might have guessed we need to write a PHP script to return all the\u00a0discovered devices. This is a very simple script that all it will do is to read your\u00a0X10 INI file that you <a href=\"http:\/\/blog.thescorpius.com\/index.php\/2016\/03\/25\/x10-amazon-echo-ifttt\/\">created in the previous post<\/a>\u00a0and return something like this:<\/p>\n<pre class=\"lang:default decode:true \">[  \r\n   {  \r\n      \"applianceId\":\"lights\",\r\n      \"manufacturerName\":\"Scorpius\",\r\n      \"modelName\":\"X10\",\r\n      \"version\":\"1.0\",\r\n      \"friendlyName\":\"lights\",\r\n      \"friendlyDescription\":\"Master bedroom lights\",\r\n      \"isReachable\":true,\r\n      \"actions\":[  \r\n         \"turnOn\",\r\n         \"turnOff\"\r\n      ],\r\n      \"additionalApplianceDetails\":{  \r\n         \"extraDetail1\":\"Test\"\r\n      }\r\n   },\r\n   {  \r\n      \"applianceId\":\"air_conditioner\",\r\n      \"manufacturerName\":\"Scorpius\",\r\n      \"modelName\":\"X10\",\r\n      \"version\":\"1.0\",\r\n      \"friendlyName\":\"air conditioner\",\r\n      \"friendlyDescription\":\"Air Conditioner\",\r\n      \"isReachable\":true,\r\n      \"actions\":[  \r\n         \"turnOn\",\r\n         \"turnOff\"\r\n      ],\r\n      \"additionalApplianceDetails\":{  \r\n         \"extraDetail1\":\"Test\"\r\n      }\r\n   }\r\n]<\/pre>\n<p>You will need to extend your INI file a little to add a name and a description, like this:<\/p>\n<pre class=\"lang:ini decode:true \">[lights]\r\ncode = a2\r\ndim = 1\r\nname = lights\r\ndescription = Master bedroom lights\r\n\r\n[air_conditioner]\r\ncode = a4\r\nname = air conditioner\r\ndescription = Air Conditioner\r\n<\/pre>\n<p>The <a href=\"http:\/\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/discover.php_.txt\">script<\/a> is so simple that needs no further explanation. You can find it <a href=\"http:\/\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/discover.php_.txt\">here<\/a>.\u00a0Test it opening a URL like this:<\/p>\n<p><a href=\"http:\/\/echo.echoparklake.com\/ifttt\/discover.php\">http:\/\/echo.echoparklake.com\/ifttt\/discover.php<\/a><\/p>\n<p>You have to change\u00a0echo.echoparklake.com with the\u00a0domain name of your web server, of course.<\/p>\n<h2>Amazon Developer Account<\/h2>\n<p>Next in our To-Do list is to create an\u00a0<a href=\"https:\/\/developer.amazon.com\">Amazon Developer<\/a> account. Once you&#8217;re logged in the Developer Console, click on the\u00a0<em>Alexa<\/em> tab and then on\u00a0<em>Get Started<\/em> under the\u00a0<em>Alexa Skills Kit<\/em> option:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonDeveloper1.png\" rel=\"attachment wp-att-483\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-483 size-full\" src=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonDeveloper1.png?resize=207%2C209\" alt=\"Alexa Skills Kit\" width=\"207\" height=\"209\" srcset=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonDeveloper1.png?w=207&amp;ssl=1 207w, https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonDeveloper1.png?resize=150%2C150&amp;ssl=1 150w\" sizes=\"auto, (max-width: 207px) 100vw, 207px\" \/><\/a><\/p>\n<p>Now click on\u00a0<em>Add a New Skill<\/em>. The first thing you need to do is to change the\u00a0<strong>Skill Type<\/strong> to\u00a0<strong>Smart Home Skill API<\/strong>. Choose a name for your skill and click on\u00a0<em>Save.<\/em> In a couple of seconds, it will\u00a0refresh and show you the\u00a0<strong>Application ID<\/strong>. Take note of this ID:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AWS1.png\" rel=\"attachment wp-att-487\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-487 aligncenter\" src=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AWS1.png?resize=648%2C224\" alt=\"Amazon Developer Smart Home Skill\" width=\"648\" height=\"224\" srcset=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AWS1.png?w=820&amp;ssl=1 820w, https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AWS1.png?resize=300%2C104&amp;ssl=1 300w, https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AWS1.png?resize=768%2C265&amp;ssl=1 768w\" sizes=\"auto, (max-width: 648px) 100vw, 648px\" \/><\/a><\/p>\n<p>For now we are not going to\u00a0go any further. We&#8217;ll go back to this when we have everything else.<\/p>\n<h2>Amazon Web Services (AWS) Account<\/h2>\n<p>Now you need to <a href=\"https:\/\/aws.amazon.com\/\">create an AWS account<\/a>. After you have created your account and have logged in, click on\u00a0<em>AWS<strong>\u00a0<\/strong><\/em>and select\u00a0<em>Lambda<\/em> under the\u00a0<em>Compute<\/em> section.<\/p>\n<p>Click on\u00a0<em>Create a New Lambda Function<\/em> and select\u00a0<em>Blank Function<\/em>. Now you should be in the\u00a0<strong>Configure Trigger<\/strong> section. Choose the\u00a0<strong>Alexa Smart Home<\/strong> trigger and paste the\u00a0<strong>Application ID<\/strong> you got from the Amazon Developer Portal. Click on\u00a0<em>Enable Trigger<\/em>. It should look like this:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonLambda1.png\" rel=\"attachment wp-att-488\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-488 aligncenter\" src=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonLambda1.png?resize=648%2C320\" alt=\"Amazon Lambda Function Setup\" width=\"648\" height=\"320\" srcset=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonLambda1.png?w=916&amp;ssl=1 916w, https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonLambda1.png?resize=300%2C148&amp;ssl=1 300w, https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonLambda1.png?resize=768%2C380&amp;ssl=1 768w\" sizes=\"auto, (max-width: 648px) 100vw, 648px\" \/><\/a><\/p>\n<p>Click on\u00a0<em>Next<\/em>. \u00a0Choose a name for your Lambda function, and a description. The runtime should be\u00a0<strong>Node.js 4.3<\/strong>.<\/p>\n<p>Now\u00a0we need to write a\u00a0JavaScript function to handle our X10 devices. We&#8217;re going to modify the <a href=\"https:\/\/developer.amazon.com\/public\/solutions\/alexa\/alexa-skills-kit\/docs\/steps-to-create-a-smart-home-skill#create-a-lambda-function\">Smart Home Skill Lambda function example<\/a> a little.\u00a0Copy\u00a0<a href=\"http:\/\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/lambdafunction.txt\">this lambda function<\/a> and paste it in the\u00a0<strong>Code<\/strong> field. You have to modify it with your settings. You need to modify the <strong>options\u00a0<\/strong>array in each function with your domain name and path of your web server PHP scripts:<\/p>\n<pre class=\"lang:js decode:true \">var options = {\r\n    hostname: 'echo.echoparklake.com',\r\n    path: '\/ifttt\/discover.php',\r\n    port: 80\r\n};<\/pre>\n<p>Now configure the handler and role as follows:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/Lambda2.png\" rel=\"attachment wp-att-502\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-502 size-full\" src=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/Lambda2.png?resize=460%2C182\" alt=\"Lambda Handler and Role\" width=\"460\" height=\"182\" srcset=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/Lambda2.png?w=460&amp;ssl=1 460w, https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/Lambda2.png?resize=300%2C119&amp;ssl=1 300w\" sizes=\"auto, (max-width: 460px) 100vw, 460px\" \/><\/a><\/p>\n<p>Click on\u00a0<em>Next<\/em> and\u00a0then\u00a0<em>Create Function<\/em>. After that look at the top right of your screen and take note of the\u00a0<strong>ARN<\/strong> it should be something like\u00a0arn:aws:lambda:us-east-1:239411752002:function:myX10LambdaFunction. You will need it later.<\/p>\n<h2>Amazon Login Account<\/h2>\n<p>We need an <a href=\"http:\/\/login.amazon.com\/\">Amazon Login<\/a>\u00a0account to be able to use <a href=\"https:\/\/en.wikipedia.org\/wiki\/OAuth\">OAuth<\/a> authentication for the skill. After you create your account and are logged in, click on the\u00a0<em>Register New Application<\/em> button.<\/p>\n<p>Just fill the fields with some names for your application. Here&#8217;s an example:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonLogin1.png\" rel=\"attachment wp-att-482\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-482 size-full\" src=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonLogin1.png?resize=648%2C302\" alt=\"Smart Home X10 Control Application\" width=\"648\" height=\"302\" srcset=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonLogin1.png?w=738&amp;ssl=1 738w, https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonLogin1.png?resize=300%2C140&amp;ssl=1 300w\" sizes=\"auto, (max-width: 648px) 100vw, 648px\" \/><\/a><\/p>\n<p>Click on the\u00a0<em>Save<\/em> button.<\/p>\n<p>Now click on <em>W<\/em><em>eb Settings<\/em>. Take a note of the\u00a0<strong>Client ID<\/strong>, we&#8217;ll need it later.<\/p>\n<h2>Finish Configurations<\/h2>\n<p>Now we must go back to the Amazon Developer Console and edit our Smart Home Skill. Go to\u00a0<em>Configuration<\/em>\u00a0and in the\u00a0<em>Endpoint<\/em> section,\u00a0click on\u00a0<strong>North America<\/strong> (assuming you created your Lambda function there) and paste the\u00a0<strong>ARN<\/strong> of your Lambda function there.<\/p>\n<p>The\u00a0<strong>Authorization URL<\/strong> should be\u00a0https:\/\/www.amazon.com\/ap\/oa since we are using the Amazon Login service.<\/p>\n<p>Paste the\u00a0<strong>Client ID<\/strong>\u00a0from your Amazon Login application you just created in the previous step in the\u00a0<strong>Client ID<\/strong> field.<\/p>\n<p>Add your domain in the\u00a0<strong>Domain List<\/strong> field. For instance, we would have to use echoparklake.com since that&#8217;s the domain we&#8217;ve been using as an example. In your case just type the domain name you have been using.<\/p>\n<p>In the\u00a0<strong>Scope<\/strong> field,\u00a0type <em>profile<\/em>.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AWS2-1.png\" rel=\"attachment wp-att-505\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-505 aligncenter\" src=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AWS2-1.png?resize=648%2C255\" alt=\"Smart Home Settings\" width=\"648\" height=\"255\" srcset=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AWS2-1.png?w=798&amp;ssl=1 798w, https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AWS2-1.png?resize=300%2C118&amp;ssl=1 300w, https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AWS2-1.png?resize=768%2C302&amp;ssl=1 768w\" sizes=\"auto, (max-width: 648px) 100vw, 648px\" \/><\/a><\/p>\n<p>Copy the\u00a0<strong>Redirect URLs<\/strong> and paste them in the Amazon Login\u00a0<em>Web Settings<strong>\u00a0<\/strong><\/em>section of your application:<a href=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonLogin2.png\" rel=\"attachment wp-att-503\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-503 size-full\" src=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonLogin2.png?resize=648%2C316\" alt=\"X10 Smart Home Skill Application Web Settings\" width=\"648\" height=\"316\" srcset=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonLogin2.png?w=737&amp;ssl=1 737w, https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonLogin2.png?resize=300%2C146&amp;ssl=1 300w\" sizes=\"auto, (max-width: 648px) 100vw, 648px\" \/><\/a><\/p>\n<p>Select\u00a0<strong>Auth Code Grant<\/strong> in the\u00a0<strong>Authorization Grant Type<\/strong>\u00a0field.<\/p>\n<p>The\u00a0<strong>Access Token URI\u00a0<\/strong>should be\u00a0https:\/\/api.amazon.com\/auth\/o2\/token. Paste the\u00a0<strong>Client Secret\u00a0<\/strong>from your Amazon Login application to the\u00a0<strong>Client Secret<\/strong> field. The\u00a0<strong>Client Authentication Scheme<\/strong> should be HTTP Basic Authentication.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AWS3.png\" rel=\"attachment wp-att-506\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-506 size-full\" src=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AWS3.png?resize=648%2C215\" alt=\"Smart Home Settings\" width=\"648\" height=\"215\" srcset=\"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AWS3.png?w=798&amp;ssl=1 798w, https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AWS3.png?resize=300%2C100&amp;ssl=1 300w, https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AWS3.png?resize=768%2C255&amp;ssl=1 768w\" sizes=\"auto, (max-width: 648px) 100vw, 648px\" \/><\/a><\/p>\n<p>Click on\u00a0<em>Next\u00a0<\/em>and then enable it in the\u00a0<strong>Test<\/strong> section so you can see the skill in the Alexa app.<\/p>\n<h2>Enabling and Testing the Skill<\/h2>\n<p>Go to the <a href=\"http:\/\/alexa.amazon.com\/\">Alexa app<\/a> (do it from a PC browser, not from your phone or tablet) and look for your skill in the\u00a0<em>Your Skill<\/em><em>s<\/em> section and click on\u00a0<em>Enable<\/em>. It should go to the Amazon Login website\u00a0to ask for your login and password if you are not already logged in (you should be, though).<\/p>\n<p>After that,\u00a0the Alexa app should ask you to discover devices. You can also discover them by\u00a0saying\u00a0<em>Alexa discover my devices<\/em>. If everything went well you should see a list of all the devices you configured in your INI file. Now you can try to turn them on or off, for example saying <em>Alexa turn on the lights<\/em>.<\/p>\n<p style=\"text-align: center;\"><script type=\"text\/javascript\">\/\/ <![CDATA[\n ( function() { if (window.CHITIKA === undefined) { window.CHITIKA = { 'units' : [] }; }; var unit = {\"calltype\":\"async[2]\",\"publisher\":\"Scorpius\",\"width\":728,\"height\":90,\"sid\":\"Chitika Default\"}; var placement_id = window.CHITIKA.units.length; window.CHITIKA.units.push(unit); document.write('\n\n\n\n<div id=\"chitikaAdBlock-' + placement_id + '\"><\/div>\n\n\n\n'); }()); \n\/\/ ]]><\/script><br \/>\n<script src=\"\/\/cdn.chitika.net\/getads.js\" async=\"\" type=\"text\/javascript\"><\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In\u00a0a previous post you&#8217;ve learned how to control your X10 devices using the Amazon Echo and the IFTTT service. But now Amazon allows you to code a Smart Home Skill so you can say\u00a0Alexa turn on the lights instead of\u00a0Alexa trigger lights on. It&#8217;s\u00a0more convenient!\u00a0Let&#8217;s extend the work we&#8217;ve already done to write a Smart [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[11],"tags":[12,25],"class_list":["post-480","post","type-post","status-publish","format-standard","hentry","category-amazon-alexa","tag-alexa-skills","tag-x10"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Control your X10 Devices with the Amazon Echo using the Smart Home Skill API - Scorpius<\/title>\n<meta name=\"description\" content=\"How to code a Smart Home Skill to control your X10 devices using your Amazon Echo, so you can say &quot;Alexa turn on the lights&quot;.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.thescorpius.com\/index.php\/2016\/11\/19\/control-x10-amazon-echo-smart-home-skill\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Control your X10 Devices with the Amazon Echo using the Smart Home Skill API - Scorpius\" \/>\n<meta property=\"og:description\" content=\"How to code a Smart Home Skill to control your X10 devices using your Amazon Echo, so you can say &quot;Alexa turn on the lights&quot;.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.thescorpius.com\/index.php\/2016\/11\/19\/control-x10-amazon-echo-smart-home-skill\/\" \/>\n<meta property=\"og:site_name\" content=\"Scorpius\" \/>\n<meta property=\"article:published_time\" content=\"2016-11-19T16:24:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-11-20T18:35:39+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonDotX10.png\" \/>\n<meta name=\"author\" content=\"TheScorpius666\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TheScorpius666\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2016\\\/11\\\/19\\\/control-x10-amazon-echo-smart-home-skill\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2016\\\/11\\\/19\\\/control-x10-amazon-echo-smart-home-skill\\\/\"},\"author\":{\"name\":\"TheScorpius666\",\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/#\\\/schema\\\/person\\\/86f96e20f253dad7eb38d3c721a950de\"},\"headline\":\"Control your X10 Devices with the Amazon Echo using the Smart Home Skill API\",\"datePublished\":\"2016-11-19T16:24:54+00:00\",\"dateModified\":\"2016-11-20T18:35:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2016\\\/11\\\/19\\\/control-x10-amazon-echo-smart-home-skill\\\/\"},\"wordCount\":1169,\"commentCount\":27,\"publisher\":{\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/#\\\/schema\\\/person\\\/7b346c3545c12a84ffdf2a30dfc69501\"},\"image\":{\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2016\\\/11\\\/19\\\/control-x10-amazon-echo-smart-home-skill\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/blog.thescorpius.com\\\/wp-content\\\/uploads\\\/2016\\\/11\\\/AmazonDotX10.png\",\"keywords\":[\"alexa skills\",\"x10\"],\"articleSection\":[\"Amazon Alexa\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2016\\\/11\\\/19\\\/control-x10-amazon-echo-smart-home-skill\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2016\\\/11\\\/19\\\/control-x10-amazon-echo-smart-home-skill\\\/\",\"url\":\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2016\\\/11\\\/19\\\/control-x10-amazon-echo-smart-home-skill\\\/\",\"name\":\"Control your X10 Devices with the Amazon Echo using the Smart Home Skill API - Scorpius\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2016\\\/11\\\/19\\\/control-x10-amazon-echo-smart-home-skill\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2016\\\/11\\\/19\\\/control-x10-amazon-echo-smart-home-skill\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/blog.thescorpius.com\\\/wp-content\\\/uploads\\\/2016\\\/11\\\/AmazonDotX10.png\",\"datePublished\":\"2016-11-19T16:24:54+00:00\",\"dateModified\":\"2016-11-20T18:35:39+00:00\",\"description\":\"How to code a Smart Home Skill to control your X10 devices using your Amazon Echo, so you can say \\\"Alexa turn on the lights\\\".\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2016\\\/11\\\/19\\\/control-x10-amazon-echo-smart-home-skill\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2016\\\/11\\\/19\\\/control-x10-amazon-echo-smart-home-skill\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2016\\\/11\\\/19\\\/control-x10-amazon-echo-smart-home-skill\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/blog.thescorpius.com\\\/wp-content\\\/uploads\\\/2016\\\/11\\\/AmazonDotX10.png?fit=870%2C489&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/blog.thescorpius.com\\\/wp-content\\\/uploads\\\/2016\\\/11\\\/AmazonDotX10.png?fit=870%2C489&ssl=1\",\"width\":870,\"height\":489,\"caption\":\"Amazon Dot X10\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/2016\\\/11\\\/19\\\/control-x10-amazon-echo-smart-home-skill\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/blog.thescorpius.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Control your X10 Devices with the Amazon Echo using the Smart Home Skill API\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/#website\",\"url\":\"https:\\\/\\\/blog.thescorpius.com\\\/\",\"name\":\"Scorpius\",\"description\":\"Random technology bits\",\"publisher\":{\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/#\\\/schema\\\/person\\\/7b346c3545c12a84ffdf2a30dfc69501\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blog.thescorpius.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/#\\\/schema\\\/person\\\/7b346c3545c12a84ffdf2a30dfc69501\",\"name\":\"Scorpius\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ef13012e4d941d778c3d150fe29a546747df377f4e03576633b5d49b7456a78e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ef13012e4d941d778c3d150fe29a546747df377f4e03576633b5d49b7456a78e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ef13012e4d941d778c3d150fe29a546747df377f4e03576633b5d49b7456a78e?s=96&d=mm&r=g\",\"caption\":\"Scorpius\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ef13012e4d941d778c3d150fe29a546747df377f4e03576633b5d49b7456a78e?s=96&d=mm&r=g\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blog.thescorpius.com\\\/#\\\/schema\\\/person\\\/86f96e20f253dad7eb38d3c721a950de\",\"name\":\"TheScorpius666\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3e54ca7ca513e321c05a53d8ab8e2cfa46535f8b6da290e2c171b6dce40ba007?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3e54ca7ca513e321c05a53d8ab8e2cfa46535f8b6da290e2c171b6dce40ba007?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3e54ca7ca513e321c05a53d8ab8e2cfa46535f8b6da290e2c171b6dce40ba007?s=96&d=mm&r=g\",\"caption\":\"TheScorpius666\"},\"url\":\"https:\\\/\\\/blog.thescorpius.com\\\/index.php\\\/author\\\/thescorpius666\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Control your X10 Devices with the Amazon Echo using the Smart Home Skill API - Scorpius","description":"How to code a Smart Home Skill to control your X10 devices using your Amazon Echo, so you can say \"Alexa turn on the lights\".","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.thescorpius.com\/index.php\/2016\/11\/19\/control-x10-amazon-echo-smart-home-skill\/","og_locale":"en_US","og_type":"article","og_title":"Control your X10 Devices with the Amazon Echo using the Smart Home Skill API - Scorpius","og_description":"How to code a Smart Home Skill to control your X10 devices using your Amazon Echo, so you can say \"Alexa turn on the lights\".","og_url":"https:\/\/blog.thescorpius.com\/index.php\/2016\/11\/19\/control-x10-amazon-echo-smart-home-skill\/","og_site_name":"Scorpius","article_published_time":"2016-11-19T16:24:54+00:00","article_modified_time":"2016-11-20T18:35:39+00:00","og_image":[{"url":"http:\/\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonDotX10.png","type":"","width":"","height":""}],"author":"TheScorpius666","twitter_card":"summary_large_image","twitter_misc":{"Written by":"TheScorpius666","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.thescorpius.com\/index.php\/2016\/11\/19\/control-x10-amazon-echo-smart-home-skill\/#article","isPartOf":{"@id":"https:\/\/blog.thescorpius.com\/index.php\/2016\/11\/19\/control-x10-amazon-echo-smart-home-skill\/"},"author":{"name":"TheScorpius666","@id":"https:\/\/blog.thescorpius.com\/#\/schema\/person\/86f96e20f253dad7eb38d3c721a950de"},"headline":"Control your X10 Devices with the Amazon Echo using the Smart Home Skill API","datePublished":"2016-11-19T16:24:54+00:00","dateModified":"2016-11-20T18:35:39+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.thescorpius.com\/index.php\/2016\/11\/19\/control-x10-amazon-echo-smart-home-skill\/"},"wordCount":1169,"commentCount":27,"publisher":{"@id":"https:\/\/blog.thescorpius.com\/#\/schema\/person\/7b346c3545c12a84ffdf2a30dfc69501"},"image":{"@id":"https:\/\/blog.thescorpius.com\/index.php\/2016\/11\/19\/control-x10-amazon-echo-smart-home-skill\/#primaryimage"},"thumbnailUrl":"http:\/\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonDotX10.png","keywords":["alexa skills","x10"],"articleSection":["Amazon Alexa"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.thescorpius.com\/index.php\/2016\/11\/19\/control-x10-amazon-echo-smart-home-skill\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blog.thescorpius.com\/index.php\/2016\/11\/19\/control-x10-amazon-echo-smart-home-skill\/","url":"https:\/\/blog.thescorpius.com\/index.php\/2016\/11\/19\/control-x10-amazon-echo-smart-home-skill\/","name":"Control your X10 Devices with the Amazon Echo using the Smart Home Skill API - Scorpius","isPartOf":{"@id":"https:\/\/blog.thescorpius.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blog.thescorpius.com\/index.php\/2016\/11\/19\/control-x10-amazon-echo-smart-home-skill\/#primaryimage"},"image":{"@id":"https:\/\/blog.thescorpius.com\/index.php\/2016\/11\/19\/control-x10-amazon-echo-smart-home-skill\/#primaryimage"},"thumbnailUrl":"http:\/\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonDotX10.png","datePublished":"2016-11-19T16:24:54+00:00","dateModified":"2016-11-20T18:35:39+00:00","description":"How to code a Smart Home Skill to control your X10 devices using your Amazon Echo, so you can say \"Alexa turn on the lights\".","breadcrumb":{"@id":"https:\/\/blog.thescorpius.com\/index.php\/2016\/11\/19\/control-x10-amazon-echo-smart-home-skill\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.thescorpius.com\/index.php\/2016\/11\/19\/control-x10-amazon-echo-smart-home-skill\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.thescorpius.com\/index.php\/2016\/11\/19\/control-x10-amazon-echo-smart-home-skill\/#primaryimage","url":"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonDotX10.png?fit=870%2C489&ssl=1","contentUrl":"https:\/\/i0.wp.com\/blog.thescorpius.com\/wp-content\/uploads\/2016\/11\/AmazonDotX10.png?fit=870%2C489&ssl=1","width":870,"height":489,"caption":"Amazon Dot X10"},{"@type":"BreadcrumbList","@id":"https:\/\/blog.thescorpius.com\/index.php\/2016\/11\/19\/control-x10-amazon-echo-smart-home-skill\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.thescorpius.com\/"},{"@type":"ListItem","position":2,"name":"Control your X10 Devices with the Amazon Echo using the Smart Home Skill API"}]},{"@type":"WebSite","@id":"https:\/\/blog.thescorpius.com\/#website","url":"https:\/\/blog.thescorpius.com\/","name":"Scorpius","description":"Random technology bits","publisher":{"@id":"https:\/\/blog.thescorpius.com\/#\/schema\/person\/7b346c3545c12a84ffdf2a30dfc69501"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.thescorpius.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/blog.thescorpius.com\/#\/schema\/person\/7b346c3545c12a84ffdf2a30dfc69501","name":"Scorpius","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ef13012e4d941d778c3d150fe29a546747df377f4e03576633b5d49b7456a78e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ef13012e4d941d778c3d150fe29a546747df377f4e03576633b5d49b7456a78e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ef13012e4d941d778c3d150fe29a546747df377f4e03576633b5d49b7456a78e?s=96&d=mm&r=g","caption":"Scorpius"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/ef13012e4d941d778c3d150fe29a546747df377f4e03576633b5d49b7456a78e?s=96&d=mm&r=g"}},{"@type":"Person","@id":"https:\/\/blog.thescorpius.com\/#\/schema\/person\/86f96e20f253dad7eb38d3c721a950de","name":"TheScorpius666","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3e54ca7ca513e321c05a53d8ab8e2cfa46535f8b6da290e2c171b6dce40ba007?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3e54ca7ca513e321c05a53d8ab8e2cfa46535f8b6da290e2c171b6dce40ba007?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3e54ca7ca513e321c05a53d8ab8e2cfa46535f8b6da290e2c171b6dce40ba007?s=96&d=mm&r=g","caption":"TheScorpius666"},"url":"https:\/\/blog.thescorpius.com\/index.php\/author\/thescorpius666\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6SNpd-7K","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/blog.thescorpius.com\/index.php\/wp-json\/wp\/v2\/posts\/480","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.thescorpius.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.thescorpius.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.thescorpius.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.thescorpius.com\/index.php\/wp-json\/wp\/v2\/comments?post=480"}],"version-history":[{"count":23,"href":"https:\/\/blog.thescorpius.com\/index.php\/wp-json\/wp\/v2\/posts\/480\/revisions"}],"predecessor-version":[{"id":522,"href":"https:\/\/blog.thescorpius.com\/index.php\/wp-json\/wp\/v2\/posts\/480\/revisions\/522"}],"wp:attachment":[{"href":"https:\/\/blog.thescorpius.com\/index.php\/wp-json\/wp\/v2\/media?parent=480"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.thescorpius.com\/index.php\/wp-json\/wp\/v2\/categories?post=480"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.thescorpius.com\/index.php\/wp-json\/wp\/v2\/tags?post=480"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}