<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dhanush</title>
    <description>The latest articles on DEV Community by Dhanush (@goliathgeek).</description>
    <link>https://dev.to/goliathgeek</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F249084%2F427ec8a6-56e9-4348-bea3-86ab95815604.jpeg</url>
      <title>DEV Community: Dhanush</title>
      <link>https://dev.to/goliathgeek</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/goliathgeek"/>
    <language>en</language>
    <item>
      <title>Build a terminal ChatApp using python.</title>
      <dc:creator>Dhanush</dc:creator>
      <pubDate>Thu, 30 Jan 2020 11:51:57 +0000</pubDate>
      <link>https://dev.to/goliathgeek/build-a-terminal-chatapp-using-python-2392</link>
      <guid>https://dev.to/goliathgeek/build-a-terminal-chatapp-using-python-2392</guid>
      <description>&lt;p&gt;Establishing a successful communication between two or more devices is always a great joy. While I was working on a project I needed to satisfy some requirements. Like, to group certain devices and make communication only between them (chat rooms or group chat). For chatting applications obviously we need a socket protocol. So python has this awesome library called &lt;a href="https://github.com/miguelgrinberg/python-socketio" rel="noopener noreferrer"&gt;socket.io&lt;/a&gt;. This is a python  implementation of &lt;a href="https://github.com/socketio/socket.io" rel="noopener noreferrer"&gt;Nodejs Socket.io&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So the basic idea is to create a server that handles the client messages and delivers to the targeted client. We'll create a &lt;a href="https://pypi.org/project/aiohttp" rel="noopener noreferrer"&gt;aiohttp&lt;/a&gt; server which is asynchronous and solves many problems.&lt;/p&gt;

&lt;p&gt;Before we start creating a server. Let's set up the python environment.&lt;br&gt;
The python version which I am using is &lt;strong&gt;3.7.9&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  It is recommended to use python-3.6.+
&lt;/h3&gt;
&lt;h2&gt;
  
  
  Install the following libraries
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/aiohttp" rel="noopener noreferrer"&gt;aiohttp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://pypi.org/project/python-socketio" rel="noopener noreferrer"&gt;socket-io&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/aioconsole" rel="noopener noreferrer"&gt;aioconsole&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now we're good to go.&lt;/p&gt;

&lt;p&gt;Let's setup the server first.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;What's basically going on here is, we just take an aiohttp server and attach it to a socket-io object. Where there will be a connection upgrade and much more. Let's not get too deep into that. We can also see that every function has a &lt;code&gt;@sio.event&lt;/code&gt; decorator. It just helps in executing the respective function according to the emitted event.&lt;/p&gt;

&lt;p&gt;Now run the server with the command &lt;code&gt;python server.py&lt;/code&gt;&lt;br&gt;
After running it should look something like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fg8vvd5jsza8ahbses91o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fg8vvd5jsza8ahbses91o.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The URL &lt;code&gt;http://0.0.0.0:8080&lt;/code&gt; represents the default route. So that every machine or device on this local network can access the server.&lt;/p&gt;

&lt;p&gt;That's it. The server part is done. Now let's move on to creating clients.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before running clients know your IP Address in Linux it's &lt;code&gt;ifconfig&lt;/code&gt; in windows it's &lt;code&gt;ipconfig&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Client codes is shown below.&lt;/p&gt;
&lt;h4&gt;
  
  
  Client 1
&lt;/h4&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h4&gt;
  
  
  Client 2
&lt;/h4&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;So we created 2 clients with names &lt;code&gt;Deadpool&lt;/code&gt; and &lt;code&gt;Iron man&lt;/code&gt; who belong to the same room called &lt;code&gt;Marvel&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Here the communication happens only in &lt;code&gt;Marvel&lt;/code&gt; room. If &lt;code&gt;Deadpool&lt;/code&gt; and &lt;code&gt;Iron man&lt;/code&gt; are in different rooms the communication is not possible.&lt;/p&gt;

&lt;p&gt;So let's test it.&lt;br&gt;
When client codes are executed we can see that server logs the name of clients that are connected.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Foi7wskrf1wanwajv54bm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Foi7wskrf1wanwajv54bm.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's it. You can start typing in the terminal itself and hit enter to send.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvaaqgaso53mq22vz1fzn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvaaqgaso53mq22vz1fzn.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/thegoliathgeek" rel="noopener noreferrer"&gt;
        thegoliathgeek
      &lt;/a&gt; / &lt;a href="https://github.com/thegoliathgeek/Terminal-ChatApp" rel="noopener noreferrer"&gt;
        Terminal-ChatApp
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Terminal Chat App&lt;/h1&gt;

&lt;/div&gt;
&lt;p&gt;&lt;a href="https://dev.to/imdhanush/build-a-terminal-chatapp-using-python-2392" rel="nofollow"&gt;Blog Link&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Note :- &lt;code&gt;Use python 3.6.+ or above&lt;/code&gt;
&lt;/h3&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Install Required libraries&lt;/h2&gt;

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/aiohttp" rel="nofollow noopener noreferrer"&gt;aiohttp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/python-socketio" rel="nofollow noopener noreferrer"&gt;socket-io&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/aioconsole" rel="nofollow noopener noreferrer"&gt;aioconsole&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;For more detailed explaination click &lt;a href="https://dev.to/imdhanush/build-a-terminal-chatapp-using-python-2392" rel="nofollow"&gt;here&lt;/a&gt;
&lt;/h2&gt;

&lt;/div&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/thegoliathgeek/Terminal-ChatApp" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


</description>
      <category>python</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Automation with Alexa using nodejs.</title>
      <dc:creator>Dhanush</dc:creator>
      <pubDate>Wed, 18 Dec 2019 06:12:02 +0000</pubDate>
      <link>https://dev.to/goliathgeek/automation-with-alexa-using-nodejs-1a6e</link>
      <guid>https://dev.to/goliathgeek/automation-with-alexa-using-nodejs-1a6e</guid>
      <description>&lt;p&gt;Hi, as we saw how to automate devices with python and Alexa in the &lt;a href="https://dev.to/imdhanush/automation-with-alexa-jo"&gt;last tutorial&lt;/a&gt;. We'll move forward with nodejs for automating things.&lt;/p&gt;

&lt;p&gt;So, again we are using &lt;a href="https://sinric.pro"&gt;sinric pro&lt;/a&gt; as Alexa's skill for automation. Which is free and easy to implement.&lt;/p&gt;

&lt;p&gt;We'll keep this tutorial short and simple ;).&lt;/p&gt;

&lt;h1&gt;
  
  
  1. Signup
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Goto &lt;a href="https://sinric.pro"&gt;sinric pro website&lt;/a&gt; and signup.&lt;/li&gt;
&lt;li&gt;Verify your email.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  2. Create devices
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Click on the &lt;code&gt;Devices&lt;/code&gt; button on the sidebar.&lt;/li&gt;
&lt;li&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3DiMJyzV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/rxtaxdy8m495g2zxha7k.jpeg" alt="Alt Text" width="800" height="999"&gt;&lt;/li&gt;
&lt;li&gt;Then select &lt;code&gt;Add Device&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Select which device type you need and let the access key be the default for now.&lt;/li&gt;
&lt;li&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4gsVjABv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/l1blc1sn5i41koz4qezf.jpeg" alt="Alt Text" width="717" height="1024"&gt;&lt;/li&gt;
&lt;li&gt;That's it. &lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  3. Linking sinric pro to Alexa
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Goto to Alexa's skills &amp;amp; games and search for &lt;a href="https://www.amazon.in/HOME-Sinric-Pro/dp/B07ZT5VDT8/ref=sr_1_2?crid=1U4W5ES006ORH&amp;amp;keywords=sinric&amp;amp;qid=1576448010&amp;amp;s=digital-skills&amp;amp;sprefix=s%2Calexa-skills%2C292&amp;amp;sr=1-2"&gt;sinric pro skill&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;As soon you link the skill you will be redirected to the login page.&lt;/li&gt;
&lt;li&gt;Login with the credentials which you used signup for &lt;a href="https://sinric.pro"&gt;sinric pro website&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;After successful login just go back to your Alexa app and it'll start discovering the devices which you added in sinric pro account.&lt;/li&gt;
&lt;li&gt;So linking skill is done.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  4. Integration with nodejs
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Installing nodejs library for &lt;a href="https://sinric.pro"&gt;sinricpro&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install sinricpro --save
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can find the source code for the nodejs library &lt;a href="https://github.com/sinricpro/nodejs-sdk"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Initializing with access key and secret key&lt;/strong&gt;&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h4&gt;
  
  
  Let's see how to get these keys.
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Login to sinricpro &lt;a href="https://portal.sinric.pro"&gt;here&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Click on &lt;a href="https://portal.sinric.pro/credential/list"&gt;credentials&lt;/a&gt; button on the sidebar.&lt;/li&gt;
&lt;li&gt;There you'll find 2 keys. One is &lt;code&gt;app key&lt;/code&gt; and another is &lt;code&gt;secret key&lt;/code&gt;
basically &lt;code&gt;app key&lt;/code&gt; is used to provide API service. &lt;code&gt;secret key&lt;/code&gt; is used to provide security for the information exchanged between devices.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Getting device ids.
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Device IDs are the unique ids that are used to differentiate between devices.&lt;/li&gt;
&lt;li&gt;As you can see there are 2 more fields &lt;code&gt;fan&lt;/code&gt; and &lt;code&gt;light&lt;/code&gt; in the code above.&lt;/li&gt;
&lt;li&gt;Go to the devices page &lt;a href="https://portal.sinric.pro/device/list"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Copy the device ID as shown below and paste it in the code.
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Dj8pBr9V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/nr2a59mfjo3skq8cj37q.jpeg" alt="Alt Text" width="688" height="233"&gt;
&lt;/li&gt;
&lt;li&gt;Done. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So moving forward, let's see how to connect to sinricpro. Basically there are 2 ways for controlling a device with sinricpro.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Action.&lt;/li&gt;
&lt;li&gt;Event.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Action
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Action is something that Alexa does for you. Like when say &lt;code&gt;Alexa, turn on light&lt;/code&gt; or when you control device from website or app.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Event
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Event is used to control the device manually. Like when you press a 
button so light should change its state or much more.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Defining action and event callbacks&lt;/strong&gt;&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Next step is to initialize the library with callbacks&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Let's see how a complete code looks like.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;That's it ;). When you run the code your devices will be online (status turns to green from red) you can control them with Alexa or &lt;a href="//portal.sinric.pro"&gt;website portal&lt;/a&gt; or &lt;a href="https://play.google.com/store/apps/details?id=pro.sinric"&gt;app&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For more help, click &lt;a href="https://sinric.pro"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Feel free to comment if any corrections or any doubts.&lt;/p&gt;

&lt;p&gt;Thanks :).&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>tutorial</category>
      <category>alexa</category>
    </item>
    <item>
      <title>Automation with Alexa using python.</title>
      <dc:creator>Dhanush</dc:creator>
      <pubDate>Mon, 16 Dec 2019 09:23:06 +0000</pubDate>
      <link>https://dev.to/goliathgeek/automation-with-alexa-jo</link>
      <guid>https://dev.to/goliathgeek/automation-with-alexa-jo</guid>
      <description>&lt;p&gt;Hi, Being an electronics and programming enthusiastic, I always wondered how can I automate my room appliances (not with smart bulbs). There were many different ways to come up with like Bluetooth, LAN, MQTT, etc. Then I thought of automating with Alexa for existing devices. There are 2 ways of doing it. The easy way and the hard way. So, for now, let's talk about the easy way.&lt;/p&gt;

&lt;p&gt;There are a lot of automation skills in the Alexa skill store but most of them support smart devices. After doing some research I found a really good skill called &lt;a href="https://sinric.com"&gt;sinric&lt;/a&gt; which let's me control existing appliances with some extra circuitry. Thanks to &lt;a href="https://github.com/kakopappa"&gt;Aruna Tennakoon&lt;/a&gt; for providing this feature. Setting up this skill is straight forward.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Signup &lt;/li&gt;
&lt;li&gt;Get API key&lt;/li&gt;
&lt;li&gt;Add skill to your Alexa&lt;/li&gt;
&lt;li&gt;Use these &lt;a href="https://github.com/kakopappa/sinric"&gt;examples&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;That's It.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sinric is the 1st version with many kinds of device supported. Recently 2nd version of  &lt;a href="https://sinric.com"&gt;sinric&lt;/a&gt; is up which is called &lt;a href="https://sinric.pro"&gt;sinric pro&lt;/a&gt;. We'll discuss the latest version.&lt;/p&gt;

&lt;p&gt;let's see how to set up the skill.&lt;/p&gt;

&lt;h1&gt;
  
  
  1. Signup
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Goto &lt;a href="https://sinric.pro"&gt;sinric pro website&lt;/a&gt; and signup.&lt;/li&gt;
&lt;li&gt;Verify your email.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  2. Create devices
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Click on the &lt;code&gt;Devices&lt;/code&gt; button on the sidebar.&lt;/li&gt;
&lt;li&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3DiMJyzV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/rxtaxdy8m495g2zxha7k.jpeg" alt="Alt Text" width="800" height="999"&gt;&lt;/li&gt;
&lt;li&gt;Then select &lt;code&gt;Add Device&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Select which device type you need and let the access key be the default for now.&lt;/li&gt;
&lt;li&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4gsVjABv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/l1blc1sn5i41koz4qezf.jpeg" alt="Alt Text" width="717" height="1024"&gt;&lt;/li&gt;
&lt;li&gt;That's it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  3. Linking sinric pro to Alexa
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Goto to Alexa's skills &amp;amp; games and search for &lt;a href="https://www.amazon.in/HOME-Sinric-Pro/dp/B07ZT5VDT8/ref=sr_1_2?crid=1U4W5ES006ORH&amp;amp;keywords=sinric&amp;amp;qid=1576448010&amp;amp;s=digital-skills&amp;amp;sprefix=s%2Calexa-skills%2C292&amp;amp;sr=1-2"&gt;sinric pro skill&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;As soon you link the skill you will be redirected to the login page.&lt;/li&gt;
&lt;li&gt;Login with the credentials which you used signup for &lt;a href="https://sinric.pro"&gt;sinric pro website&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;After successful login just go back to your Alexa app and it'll start discovering the devices which you added in sinric pro account.&lt;/li&gt;
&lt;li&gt;So linking skill is done.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  4. Controlling devices with Alexa
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Here's where the coding part begins.&lt;/li&gt;
&lt;li&gt;Sinric Pro has supporting libraries for &lt;a href="https://github.com/sinricpro/python-sdk"&gt;python&lt;/a&gt;, &lt;a href="https://github.com/sinricpro/esp8266-esp32-sdk"&gt;c++(nodemcu)&lt;/a&gt;, &lt;a href="https://github.com/sinricpro/nodejs-sdk"&gt;nodejs&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Let's start with python.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  5. Integration with python
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Installing python library for &lt;a href="https://sinric.pro"&gt;sinricpro&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install sinricpro
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can find the source code for the python library &lt;a href="https://github.com/sinricpro/python-sdk"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Just a reminder. This library is only supported for python versions 3.7+.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Initializing with access key and secret key&lt;/strong&gt;&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h4&gt;
  
  
  Let's see how to get these keys.
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Login to sinricpro &lt;a href="https://portal.sinric.pro"&gt;here&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Click on &lt;a href="https://portal.sinric.pro/credential/list"&gt;credentials&lt;/a&gt; button on the sidebar.&lt;/li&gt;
&lt;li&gt;There you'll find 2 keys. One is &lt;code&gt;app key&lt;/code&gt; and another is &lt;code&gt;secret key&lt;/code&gt;
basically &lt;code&gt;app key&lt;/code&gt; is used to provide API service. &lt;code&gt;secret key&lt;/code&gt; is used to provide security for the information exchanged between devices.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Getting device ids.
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Device IDs are the unique ids that are used to differentiate between devices.&lt;/li&gt;
&lt;li&gt;As you can see there are 2 more fields &lt;code&gt;fan&lt;/code&gt; and &lt;code&gt;light&lt;/code&gt; in the code above.&lt;/li&gt;
&lt;li&gt;Go to the devices page &lt;a href="https://portal.sinric.pro/device/list"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Copy the device ID as shown below and paste it in the code.
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Dj8pBr9V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/nr2a59mfjo3skq8cj37q.jpeg" alt="Alt Text" width="688" height="233"&gt;
&lt;/li&gt;
&lt;li&gt;Done. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So moving forward, let's see how to connect to sinricpro. Basically there are 2 ways for controlling a device with sinricpro.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Action.&lt;/li&gt;
&lt;li&gt;Event.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Action
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Action is something that Alexa does for you. Like when say &lt;code&gt;Alexa, turn on light&lt;/code&gt; or when you control device from website or app.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Event
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Event is used to control the device manually. Like when you press a 
button so light should change its state or much more.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Defining action and event callbacks&lt;/strong&gt;&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Next step is to initialize the library with callbacks&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Let's see how a complete code looks like.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;That's it ;). When you run the code your devices will be online you can control with Alexa or &lt;a href="//portal.sinric.pro"&gt;website portal&lt;/a&gt; or &lt;a href="https://play.google.com/store/apps/details?id=pro.sinric"&gt;app&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For more examples, click &lt;a href="https://github.com/sinricpro/python-examples"&gt;here&lt;/a&gt;.&lt;br&gt;
For more help, click &lt;a href="https://sinric.pro"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thank you :).&lt;/p&gt;

</description>
      <category>python</category>
      <category>javascript</category>
      <category>cpp</category>
      <category>alexa</category>
    </item>
  </channel>
</rss>
