{"id":43192,"date":"2017-11-09T11:48:19","date_gmt":"2017-11-09T11:48:19","guid":{"rendered":"http:\/\/randomnerdtutorials.com\/?p=43192"},"modified":"2019-04-02T10:23:26","modified_gmt":"2019-04-02T10:23:26","slug":"getting-started-with-home-assistant-on-raspberry-pi","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/getting-started-with-home-assistant-on-raspberry-pi\/","title":{"rendered":"Getting Started with Home Assistant on Raspberry Pi"},"content":{"rendered":"<p>In this post we\u2019re going to show you how to get started with Home Assistant on Raspberry Pi. We\u2019ll show you how to set up Home Assistant and we\u2019ll build a simple example to get you started with home automation.<!--more--><\/p>\n<p><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter wp-image-45754 \" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/11\/Thumbnail.jpg?resize=730%2C465&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"730\" height=\"465\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/11\/Thumbnail.jpg?w=1131&amp;quality=100&amp;strip=all&amp;ssl=1 1131w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/11\/Thumbnail.jpg?resize=300%2C191&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/11\/Thumbnail.jpg?resize=768%2C489&amp;quality=100&amp;strip=all&amp;ssl=1 768w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/11\/Thumbnail.jpg?resize=1024%2C652&amp;quality=100&amp;strip=all&amp;ssl=1 1024w\" sizes=\"(max-width: 730px) 100vw, 730px\" \/><\/p>\n<p>Here\u2019s what we are going to cover in this tutorial:<\/p>\n<ul>\n<li>What is Home Assistant?<\/li>\n<li>Installing and Setting Up Home Assistant<\/li>\n<li>Installing Add-Ons<\/li>\n<li>The configuration.yaml File<\/li>\n<li>Saving Changes and Updating<\/li>\n<li>Example &#8211; Controlling RPi GPIOs with Home Assistant<\/li>\n<li>Creating Automations in Home Assistant<\/li>\n<\/ul>\n<hr \/>\n<h2>What is Home Assistant?<\/h2>\n<p>Home Assistant is an home automation hub. An home automation hub is a place where different devices with different protocols communicate with each other. This means you can link all your devices in just one place and build cool automations based on the state of all your devices.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/home-assistant.png?quality=100&#038;strip=all&#038;ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"aligncenter wp-image-43291\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/home-assistant.png?resize=206%2C206&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"206\" height=\"206\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/home-assistant.png?w=512&amp;quality=100&amp;strip=all&amp;ssl=1 512w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/home-assistant.png?resize=150%2C150&amp;quality=100&amp;strip=all&amp;ssl=1 150w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/home-assistant.png?resize=300%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/home-assistant.png?resize=80%2C80&amp;quality=100&amp;strip=all&amp;ssl=1 80w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/home-assistant.png?resize=220%2C220&amp;quality=100&amp;strip=all&amp;ssl=1 220w\" sizes=\"(max-width: 206px) 100vw, 206px\" \/><\/a><\/p>\n<p>Home Assistant is the biggest open-source home automation platform to date and it supports 895 different components.<\/p>\n<hr \/>\n<h2>Installing and Setting Up Home Assistant<\/h2>\n<p>There are different ways to install Home Assistant. You can run it on your computer or use a Raspberry Pi to act as an exclusive home automation hub. In this tutorial we\u2019re going to install Home Assistant on Raspberry Pi 3.<\/p>\n<p>To start running Home Assistant on the RPi, you need to install Hass.io.<\/p>\n<p><strong>1)<\/strong> Go to <a href=\"https:\/\/home-assistant.io\/hassio\/installation\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/home-assistant.io\/hassio\/installation\/<\/a>\u00a0and chose the appropriate image for your Raspberry Pi. We recommend using Raspberry Pi 3. Click on the Raspberry Pi 3 link to download the Hass.io image to your computer.<\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" class=\"aligncenter size-full wp-image-43193\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/Install-Hass.io_.png?resize=579%2C173&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"579\" height=\"173\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/Install-Hass.io_.png?w=579&amp;quality=100&amp;strip=all&amp;ssl=1 579w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/Install-Hass.io_.png?resize=300%2C90&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 579px) 100vw, 579px\" \/><\/p>\n<p><strong>2)<\/strong> Go to <a href=\"https:\/\/etcher.io\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/etcher.io\/<\/a> and install <strong>Etcher<\/strong> on your computer. Select the appropriate installation for your operating system.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43194\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/etcher-different-operating-systems.png?resize=700%2C260&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"700\" height=\"260\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/etcher-different-operating-systems.png?w=700&amp;quality=100&amp;strip=all&amp;ssl=1 700w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/etcher-different-operating-systems.png?resize=300%2C111&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p><strong>3)<\/strong> When the installation is done, open Etcher and click on <strong>Select image<\/strong>. Open the image you\u2019ve just downloaded in step <strong>1)<\/strong>.<\/p>\n<p><strong>4)<\/strong> Make sure <strong>Etcher<\/strong> selects the right SD card. Then, click <strong>Flash!<\/strong> Note: you need to have your SD card formatted before doing this step. Wait a few minutes while Etcher flashes the image on the SD card.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43195\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/flash-etcher.png?resize=700%2C360&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"700\" height=\"360\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/flash-etcher.png?w=700&amp;quality=100&amp;strip=all&amp;ssl=1 700w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/flash-etcher.png?resize=300%2C154&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p><strong>5)<\/strong>\u00a0Insert the SD card on your Pi. Connect an Ethernet cable and power it up.<\/p>\n<p><strong>6)<\/strong> \u00a0After a few minutes you should be able to access Home Assistant user interface from any device on the same local network. You just need to type on the browser http:\/\/hassio.local:8123 or go to \u00a0http:\/\/<span style=\"color: #ff0000;\">your-pi-ip-address<\/span>:8123 by replacing <span style=\"color: #ff0000;\">your-pi-ip-address<\/span> with your Raspberry Pi IP address. If you don\u2019t know how to find your Raspberry Pi IP address, <a href=\"https:\/\/randomnerdtutorials.com\/installing-raspbian-lite-enabling-and-connecting-with-ssh\/\" target=\"_blank\" rel=\"noopener noreferrer\">check this post<\/a>.<\/p>\n<p><strong>7)<\/strong><span style=\"color: #ff0000;\"> Be patient, the installation takes about 20 minutes (or more)<\/span>\u00a0to download all dependencies it needs for Home Assistant. While it is being installed, you\u2019ll see the following on your browser window.<\/p>\n<p><strong>Note:<\/strong> sometimes the screen below doesn&#8217;t load, but the installation is still continuing in the background. Let it complete the installation.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43197\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/home-assistant-installation-wait.jpg?resize=233%2C309&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"233\" height=\"309\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/home-assistant-installation-wait.jpg?w=233&amp;quality=100&amp;strip=all&amp;ssl=1 233w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/home-assistant-installation-wait.jpg?resize=226%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 226w\" sizes=\"(max-width: 233px) 100vw, 233px\" \/><\/p>\n<p>Once it&#8217;s done, your Raspberry Pi will auto reboot, so you have to wait another 3 minutes. Then, refresh your web page and you should see the Home Assistant user interface default view.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43243\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/home-assistant-UI.png?resize=878%2C677&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"878\" height=\"677\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/home-assistant-UI.png?w=878&amp;quality=100&amp;strip=all&amp;ssl=1 878w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/home-assistant-UI.png?resize=300%2C231&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/home-assistant-UI.png?resize=768%2C592&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 878px) 100vw, 878px\" \/><\/p>\n<p>Navigate through each tab and explore what&#8217;s inside.<\/p>\n<hr \/>\n<h2>Installing Add-Ons<\/h2>\n<p>There are several add-ons you can add to get home assistant even better. We recommend installing <strong>Samba share<\/strong> and <strong>Open SSH<\/strong>. You can also install other add-ons that you might find useful.<\/p>\n<h3>Installing the Samba share add-on<\/h3>\n<p>The Samba share add-on gives you access to the Raspberry Pi&#8217;s folders on your computer. This is useful so that you can access and change your Home Assistant configuration settings through your computer.<\/p>\n<p><strong>1)\u00a0<\/strong>To install the Samba share add-on, in the Home Assistant user interface go to <strong>Hass.io<\/strong>.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43245\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/install-add-ons-1.png?resize=700%2C359&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"700\" height=\"359\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/install-add-ons-1.png?w=700&amp;quality=100&amp;strip=all&amp;ssl=1 700w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/install-add-ons-1.png?resize=300%2C154&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p><strong>2)\u00a0<\/strong>Click on the icon on the upright corner and then, select the<strong> Samba share<\/strong> add-on.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43246\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/samba-share.png?resize=700%2C302&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"700\" height=\"302\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/samba-share.png?w=700&amp;quality=100&amp;strip=all&amp;ssl=1 700w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/samba-share.png?resize=300%2C129&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p><strong>3)\u00a0<\/strong>Then, click install. The installation may take a minute or two.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43247\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/installing-samba-share.png?resize=621%2C257&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"621\" height=\"257\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/installing-samba-share.png?w=621&amp;quality=100&amp;strip=all&amp;ssl=1 621w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/installing-samba-share.png?resize=300%2C124&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 621px) 100vw, 621px\" \/><\/p>\n<h3>Accessing the shared files in Windows<\/h3>\n<p><strong>1)<\/strong> Once Samba share is installed, in your computer, go to <strong>Network Devices<\/strong>. You should see a new device called <strong>HASSIO<\/strong>. Open it and there should be a couple of folders, including the <strong>config<\/strong> folder.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43249\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/hass-io-folders.png?resize=700%2C503&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"700\" height=\"503\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/hass-io-folders.png?w=700&amp;quality=100&amp;strip=all&amp;ssl=1 700w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/hass-io-folders.png?resize=300%2C216&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><br \/>\n<strong>2)<\/strong> Inside the <strong>config<\/strong> folder, you should see the <strong>configuration.yaml<\/strong> file.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43253\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/yaml-file.png?resize=700%2C500&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"700\" height=\"500\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/yaml-file.png?w=700&amp;quality=100&amp;strip=all&amp;ssl=1 700w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/yaml-file.png?resize=300%2C214&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<h3>Accessing the shared files in Mac OS X<\/h3>\n<p><strong>1)\u00a0<\/strong>To access the shared files in Mac OS X, go to <strong>Finder &gt; Go &gt; Connect to Server<\/strong>.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43254\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/Screen-Shot-2017-09-15-at-17.20.43-Copy.png?resize=548%2C422&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"548\" height=\"422\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/Screen-Shot-2017-09-15-at-17.20.43-Copy.png?w=548&amp;quality=100&amp;strip=all&amp;ssl=1 548w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/Screen-Shot-2017-09-15-at-17.20.43-Copy.png?resize=300%2C231&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 548px) 100vw, 548px\" \/><\/p>\n<p><strong>2)\u00a0<\/strong>A new window pops up. Write the server address as follows:<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43255\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/Screen-Shot-2017-09-15-at-17.20.52-Copy.png?resize=488%2C232&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"488\" height=\"232\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/Screen-Shot-2017-09-15-at-17.20.52-Copy.png?w=488&amp;quality=100&amp;strip=all&amp;ssl=1 488w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/Screen-Shot-2017-09-15-at-17.20.52-Copy.png?resize=300%2C143&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 488px) 100vw, 488px\" \/><\/p>\n<p>The server address should be <strong>smb:\/\/<\/strong> followed by your Raspberry Pi IP address.<\/p>\n<p><strong>3)\u00a0<\/strong>Select Connect \u00a0As\u00a0<strong>Guest<\/strong><\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43256\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/Screen-Shot-2017-09-15-at-17.21.01-Copy.png?resize=432%2C188&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"432\" height=\"188\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/Screen-Shot-2017-09-15-at-17.21.01-Copy.png?w=432&amp;quality=100&amp;strip=all&amp;ssl=1 432w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/Screen-Shot-2017-09-15-at-17.21.01-Copy.png?resize=300%2C131&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 432px) 100vw, 432px\" \/><strong>4) <\/strong>Select the desired folder. In this case, select the\u00a0<strong>config\u00a0<\/strong>folder.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43257\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/Screen-Shot-2017-09-15-at-17.21.08-Copy.png?resize=421%2C352&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"421\" height=\"352\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/Screen-Shot-2017-09-15-at-17.21.08-Copy.png?w=421&amp;quality=100&amp;strip=all&amp;ssl=1 421w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/Screen-Shot-2017-09-15-at-17.21.08-Copy.png?resize=300%2C251&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 421px) 100vw, 421px\" \/><\/p>\n<p><strong>5)\u00a0<\/strong>Finally, you can access the <strong>configuration.yaml<\/strong> file.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43258\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/Screen-Shot-2017-09-15-at-17.21.25-Copy.png?resize=770%2C396&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"770\" height=\"396\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/Screen-Shot-2017-09-15-at-17.21.25-Copy.png?w=770&amp;quality=100&amp;strip=all&amp;ssl=1 770w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/Screen-Shot-2017-09-15-at-17.21.25-Copy.png?resize=300%2C154&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/Screen-Shot-2017-09-15-at-17.21.25-Copy.png?resize=768%2C395&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 770px) 100vw, 770px\" \/><\/p>\n<h3>Installing the SSH server add-on<\/h3>\n<p>We also recommend installing the <strong>SSH server<\/strong> add-on. This allows you to connect to your Raspberry Pi that is running Home Assistant over SSH.<\/p>\n<p><strong>1)<\/strong> Go to the <strong>Hass.io <\/strong>tab, click on the upright corner icon and search for <strong>SSH server<\/strong>.<\/p>\n<p><strong>2)\u00a0<\/strong>Then, a tab with the SSH server opens.\u00a0In the\u00a0<strong>Options<\/strong> section, add a password as follows (use your own password) and click <strong>SAVE<\/strong>:<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43259\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/ssh-server-open-ssh.png?resize=601%2C229&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"601\" height=\"229\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/ssh-server-open-ssh.png?w=601&amp;quality=100&amp;strip=all&amp;ssl=1 601w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/ssh-server-open-ssh.png?resize=300%2C114&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 601px) 100vw, 601px\" \/><\/p>\n<p><strong>3)\u00a0<\/strong>Finally, click <strong>INSTALL<\/strong> to install Open SSH.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43260\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/ssh.png?resize=599%2C478&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"599\" height=\"478\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/ssh.png?w=599&amp;quality=100&amp;strip=all&amp;ssl=1 599w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/ssh.png?resize=300%2C239&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 599px) 100vw, 599px\" \/><\/p>\n<p><strong>4)<\/strong>\u00a0The\u00a0<strong>Boot<\/strong> option is set to\u00a0<strong>auto<\/strong>, which means the connection is established automatically, when you boot your pi. For now, click <strong>START<\/strong> to establish the communication.<\/p>\n<h3>Rebooting your Pi<\/h3>\n<p>We recommend rebooting your Pi after installing the add-ons. For that, you need to communicate with your Pi via SSH.<\/p>\n<p><strong>Connection via SSH on Windows<\/strong><\/p>\n<p><strong>1)\u00a0<\/strong>If you&#8217;re running Windows on your computer, use <strong>Putty<\/strong> to establish the communication. If you don&#8217;t have Putty installed, you can click <a href=\"http:\/\/www.putty.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/p>\n<p><strong>2)\u00a0<\/strong>Enter your Pi IP address with <strong>Port 22<\/strong> selected and click <strong>Open<\/strong>. When you first connect, you&#8217;ll be prompted with a Warning message. Click <strong>Yes.<\/strong><\/p>\n<p><strong>3)<\/strong> Login as <strong>root<\/strong> and enter the password you&#8217;ve defined in the previous section at\u00a0<strong>2).<\/strong><\/p>\n<p><strong>4)<\/strong> If you type<strong> hassio help<\/strong>, you&#8217;ll see the commands you can use to communicate with the Pi.<\/p>\n<p><strong>5)\u00a0<\/strong>To reboot your Pi enter the following<\/p>\n<pre>core-ssh:~# <strong>hassio host reboot<\/strong><\/pre>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43263\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/hassio-terminal.png?resize=338%2C639&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"338\" height=\"639\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/hassio-terminal.png?w=338&amp;quality=100&amp;strip=all&amp;ssl=1 338w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/hassio-terminal.png?resize=159%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 159w\" sizes=\"(max-width: 338px) 100vw, 338px\" \/><\/p>\n<p><strong>Connecting via SSH on MAC OS X<\/strong><\/p>\n<p><strong>1)<\/strong> To connect via SSH on MAC OS X, open the <strong>Terminal<\/strong> and type:<\/p>\n<pre><strong>ssh root@<span style=\"color: #ff0000;\">your-rpi-ip-address<\/span><\/strong><\/pre>\n<p>You need to replace the <span style=\"color: #ff0000;\">your-rpi-ip-address<\/span> with your Raspberry Pi IP address.<\/p>\n<p><strong>2)\u00a0<\/strong>Enter the password.<\/p>\n<p><strong>3) <\/strong>Finally, reboot your Pi:<\/p>\n<pre>core-ssh:~# <strong>hassio host reboot<\/strong><\/pre>\n<h2><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43265\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/reboot-MAC-OS-1.png?resize=700%2C502&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"700\" height=\"502\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/reboot-MAC-OS-1.png?w=700&amp;quality=100&amp;strip=all&amp;ssl=1 700w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/reboot-MAC-OS-1.png?resize=300%2C215&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/h2>\n<p>Congratulations! You&#8217;ve set up Home Assistant sucessfully.<\/p>\n<hr \/>\n<h2>The configuration.yaml file<\/h2>\n<p>In Home Assistant, the <strong>configuration.yaml<\/strong> file saves data in a hierarchical format to let Home Assistant know what you want to do. This file stores what components you\u2019re using, how they are organized and how to automate with them.<\/p>\n<p>Go to the <strong>HASSIO<\/strong> shared file, select the <strong>configuration<\/strong> folder and open the <strong>configuration.yaml<\/strong> file.<\/p>\n<p>In your file, you can see <strong>homeassistant<\/strong> at the beginning. This is a component itself, and it is the only mandatory component. \u00a0<strong>introduction<\/strong> is another component, <strong>frontend<\/strong>, <strong>config<\/strong> and so on.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43267\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/yaml-file-components.png?resize=662%2C721&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"662\" height=\"721\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/yaml-file-components.png?w=662&amp;quality=100&amp;strip=all&amp;ssl=1 662w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/yaml-file-components.png?resize=275%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 275w\" sizes=\"(max-width: 662px) 100vw, 662px\" \/><\/p>\n<p>The automations are in a different file called <strong>automations<\/strong> (you can also add the automations directly to the configuration file). \u00a0You can organize all your different components in groups &#8211; this is also done in a separate file called <strong>groups<\/strong>.<\/p>\n<p>These separated files are linked in the configuration file at the end.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43268\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/include-other-files.png?resize=441%2C83&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"441\" height=\"83\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/include-other-files.png?w=441&amp;quality=100&amp;strip=all&amp;ssl=1 441w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/include-other-files.png?resize=300%2C56&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 441px) 100vw, 441px\" \/><\/p>\n<h3>Adding a password<\/h3>\n<p>You can easily add a password to your Home Assistant User Interface. In the <strong>configuration.yaml<\/strong> file you just need to uncomment the line, by taking out the #:<\/p>\n<pre># api_password: PASSWORD<\/pre>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43269\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/password.png?resize=478%2C66&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"478\" height=\"66\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/password.png?w=478&amp;quality=100&amp;strip=all&amp;ssl=1 478w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/password.png?resize=300%2C41&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 478px) 100vw, 478px\" \/>Instead of PASSWORD, enter your desired password.<\/p>\n<hr \/>\n<h2>Saving Changes and Updating<\/h2>\n<p>For your changes to take effect:<\/p>\n<p><strong>1)\u00a0<\/strong>Save your <strong>configuration.yam<\/strong>l file.<\/p>\n<p><strong>2)<\/strong> In the Home Assistant User Interface, go to\u00a0<strong>Configuration<\/strong>,\u00a0select\u00a0<strong>General<\/strong> and click the\u00a0<strong>CHECK CONFIG<\/strong> button. This tells you if everything is going well with the syntax of the <strong>configuration.yaml<\/strong> file. This may take a few seconds. When, it&#8217;s done, you get a <strong>Valid!<\/strong> message if everything is good with the syntax.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43270\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/configuration-validation.png?resize=604%2C227&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"604\" height=\"227\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/configuration-validation.png?w=604&amp;quality=100&amp;strip=all&amp;ssl=1 604w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/configuration-validation.png?resize=300%2C113&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 604px) 100vw, 604px\" \/><\/p>\n<p><strong>3)\u00a0<\/strong>Then, on the same tab, on the\u00a0<strong>Server Management<\/strong> section click <strong>RESTART.<\/strong><\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43271\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/restart.png?resize=600%2C158&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"600\" height=\"158\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/restart.png?w=600&amp;quality=100&amp;strip=all&amp;ssl=1 600w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/restart.png?resize=300%2C79&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<p><strong>4)\u00a0<\/strong>Wait for the system to restart.<\/p>\n<p>Next time you go to your Home Assistant User Interface, it will ask you for a password. The changes you&#8217;ve made previously took effect.<\/p>\n<h3>Adding More Components<\/h3>\n<p>To add components to the <strong>configuration.yaml<\/strong> file go to <a href=\"https:\/\/home-assistant.io\/components\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/home-assistant.io\/components\/<\/a>\u00a0and search for the desired components.<\/p>\n<p>Then, you just have to copy the entry given to the <strong>configuration.yaml<\/strong> file, and add or edit the configuration variables to meet your needs. For example, here&#8217;s what you have when you search for a Raspberry Pi GPIO Switch:<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43272\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/Rpi-switch.png?resize=725%2C754&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"725\" height=\"754\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/Rpi-switch.png?w=725&amp;quality=100&amp;strip=all&amp;ssl=1 725w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/Rpi-switch.png?resize=288%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 288w\" sizes=\"(max-width: 725px) 100vw, 725px\" \/><\/p>\n<hr \/>\n<h2>Example &#8211; Controlling RPi GPIOs with Home Assistant<\/h2>\n<p>This is just a simple example to get you familiar with home assistant: adding components and build automations.<br \/>\nIn this example, we\u2019re going to control two RPI GPIOS through home assistant. We\u2019re going to add two switches to turn two LEDs on and off. We\u2019re also going to build a simple automation that turns one of the LEDs on and off at a specific time. Let\u2019s get started!<\/p>\n<h3>Parts required<\/h3>\n<p>Here\u2019s a complete list of the parts required for this project:<\/p>\n<ul>\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/raspberry-pi-board\/\" target=\"_blank\" rel=\"noopener noreferrer\">Raspberry Pi Board<\/a>\u00a0running Home Assistant \u2013 read\u00a0<a href=\"https:\/\/makeradvisor.com\/best-raspberry-pi-3-starter-kits\/\" target=\"_blank\" rel=\"noopener noreferrer\">Best Raspberry Pi Starter Kits<\/a><\/li>\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/microsd-card-raspberry-pi-16gb-class-10\/\" target=\"_blank\" rel=\"noopener noreferrer\">MicroSD Card \u2013 at least 8GB Class10<\/a><\/li>\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/raspberry-pi-power-supply\/\" target=\"_blank\" rel=\"noopener noreferrer\">Raspberry Pi Power Supply (5V 2.5A)<\/a><\/li>\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/3mm-5mm-leds-kit-storage-box\/\" target=\"_blank\" rel=\"noopener noreferrer\">2x LEDs<\/a><\/li>\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/resistors-kits\/\" target=\"_blank\" rel=\"noopener noreferrer\">2x 330 Ohm resistors<\/a><\/li>\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/mb-102-solderless-breadboard-830-points\/\" target=\"_blank\" rel=\"noopener noreferrer\">Breadboard<\/a><\/li>\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/jumper-wires-kit-120-pieces\/\">Jumper Wires<\/a><\/li>\n<\/ul>\n<p>You can use the preceding links or go directly to <a href=\"https:\/\/makeradvisor.com\/tools\/?utm_source=rnt&utm_medium=post&utm_campaign=post\" target=\"_blank\">MakerAdvisor.com\/tools<\/a> to find all the parts for your projects at the best price!<\/p><p style=\"text-align:center;\"><a href=\"https:\/\/makeradvisor.com\/tools\/?utm_source=rnt&utm_medium=post&utm_campaign=post\" target=\"_blank\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/10\/header-200.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\"><\/a><\/p>\n<h3>Building the circuit<\/h3>\n<p>The circuit for this example is simple. You just need to connect two LEDs through a 330 Ohm resistor to GPIO 11 and GPIO 12. Just follow the schematics.<\/p>\n<h3><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-43277\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/home-assistant-example_bb.png?resize=452%2C603&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"452\" height=\"603\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/home-assistant-example_bb.png?resize=224%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 224w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/home-assistant-example_bb.png?resize=768%2C1027&amp;quality=100&amp;strip=all&amp;ssl=1 768w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/home-assistant-example_bb.png?resize=766%2C1024&amp;quality=100&amp;strip=all&amp;ssl=1 766w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/home-assistant-example_bb.png?zoom=2&amp;resize=452%2C603&amp;quality=100&amp;strip=all&amp;ssl=1 904w\" sizes=\"(max-width: 452px) 100vw, 452px\" \/>Raspberry Pi GPIO Switch component<\/h3>\n<p>The first step is to add the Raspberry Pi switch component to the<strong> configuration.yaml<\/strong> file.<\/p>\n<p><strong>1)\u00a0<\/strong>Go to <a href=\"https:\/\/home-assistant.io\/components\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/home-assistant.io\/components<\/a>\/ and type Raspberry Pi.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43275\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/RPi-components-1.png?resize=700%2C383&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"700\" height=\"383\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/RPi-components-1.png?w=700&amp;quality=100&amp;strip=all&amp;ssl=1 700w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/RPi-components-1.png?resize=300%2C164&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p><strong>2)\u00a0<\/strong>Select <strong>Raspberry Pi GPIO Switch<\/strong>. The component&#8217;s page shows an entry file example and the\u00a0variables you can add to configure your components.<\/p>\n<p><strong>3)\u00a0<\/strong>Copy the entry given to your <strong>configuration.yaml<\/strong> file.<\/p>\n<pre># Example configuration.yaml entry\nswitch:\n  - platform: rpi_gpio\n    ports:\n      11: Fan Office\n      12: Light Desk<\/pre>\n<p>In this entry we&#8217;re adding two buttons that will control the Raspberry Pi GPIOs 11 and 12. We are calling them <strong>Fan Office<\/strong> and <strong>Light Desk<\/strong>. For testing purposes we\u2019ll use the default names, but you can call them whatever you want and select other GPIOs.<\/p>\n<p><strong>4)\u00a0<\/strong>After copying the entry to your <strong>configuration.yaml<\/strong> file, save the file. Then check the syntax and restart the Pi as we did in the &#8220;<strong>Saving Changes and Updating<\/strong>&#8221; section. Wait for Home Assistant to restart.<\/p>\n<p><strong>5<\/strong><strong>) <\/strong>Go to your Home Assistant User Interface and you should see two new buttons on the interface called Fan Office and Light Desk. Click on those buttons to turn the LEDs on and off.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/switch-user-interface.png?quality=100&#038;strip=all&#038;ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43279\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/switch-user-interface.png?resize=700%2C449&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"700\" height=\"449\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/switch-user-interface.png?w=700&amp;quality=100&amp;strip=all&amp;ssl=1 700w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/switch-user-interface.png?resize=300%2C192&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/a><\/p>\n<p>You can also check the <strong>History<\/strong> and <strong>Logbook<\/strong> to see the how the components&#8217; states changed and analyse their state over time.<\/p>\n<h3>Watch the video demonstration<\/h3>\n<p style=\"text-align:center\"><iframe width=\"720\" height=\"405\" src=\"https:\/\/www.youtube.com\/embed\/wikJla6AilQ?rel=0\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<hr \/>\n<h2>Creating Automations in Home Assistant<\/h2>\n<p>In this example, keep the previous circuit. We&#8217;re going to automatically turn on and off the Light Desk LED.<\/p>\n<p>You can build automations directly on the <strong>configuration.yaml<\/strong> file, in the <strong>automations.yaml<\/strong> file or in the User interface.<\/p>\n<p>To build automations in the User iInterface, go to\u00a0<strong>Configuration<\/strong> &gt;\u00a0<strong>Automation<\/strong> and click the <strong>(+)<\/strong> sign on the right bottom corner.<\/p>\n<p>In the\u00a0<strong>Automation<\/strong> tab you have several sections:\u00a0<strong>New Automation<\/strong>,\u00a0<strong>Triggers<\/strong>,\u00a0<strong>Conditions<\/strong> and\u00a0<strong>Action<\/strong>.<\/p>\n<p>In Home Assistant, the automation have 3 parts:<\/p>\n<ul>\n<li><strong>trigger<\/strong>: this is what happens for the automation to start<\/li>\n<li><strong>condition<\/strong>: these are the conditions that have to be met for the automation to continue<\/li>\n<li><strong>action<\/strong>: this is what happens when the automation takes place<\/li>\n<\/ul>\n<h3>Developer Tools<\/h3>\n<p>Before proceeding with the automation, you need to be familiar with some of the developer tools.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/developer-tools.png?quality=100&#038;strip=all&#038;ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43283\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/developer-tools.png?resize=247%2C87&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"247\" height=\"87\" \/><\/a><\/p>\n<p><strong>States<\/strong><\/p>\n<p>Select the <strong>States<\/strong> under the Developer Tools. Here you can test setting the state of a device. You can also see the ID of all your entities. For example, \u00a0your Fan Office and Light Desk buttons have the following IDs, state and attributes:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/IDs.png?quality=100&#038;strip=all&#038;ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43287\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/IDs.png?resize=544%2C57&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"544\" height=\"57\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/IDs.png?w=544&amp;quality=100&amp;strip=all&amp;ssl=1 544w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/IDs.png?resize=300%2C31&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 544px) 100vw, 544px\" \/><\/a><\/p>\n<p><strong>Services<\/strong><\/p>\n<p>Under the Developer Tools, select\u00a0<strong>Services<\/strong>. Here, you can call a service from a component and test it, to see what happens.<\/p>\n<p>Here we are going to test a service that turns the Light Desk LED on.<\/p>\n<p>On the Domain field, select <strong>switch<\/strong>. On the service, select\u00a0<strong>turn_on.<\/strong><\/p>\n<p>When you select <strong>turn_on<\/strong>, the valid parameters for that event appear.<\/p>\n<p>In this case, as we only want to turn on the Light Desk LED, we need to enter some JSON data, selecting only the entity we want to trigger.<\/p>\n<pre>{ \n \"entity_id\": \"<strong>switch.light_desk<\/strong>\"\n}<\/pre>\n<p>Click on the\u00a0<strong>CALL SERVICE<\/strong> button to fire the event. This is just a method to check the service you want to call. The Light Desk LED should turn on when you click on the\u00a0<strong>CALL SERVICE<\/strong> button.<\/p>\n<p>Now, go back to the <strong>Automation<\/strong> tab.<\/p>\n<h3>Automation<\/h3>\n<p>In the\u00a0<strong>New Automation<\/strong> section, give a name to your automation. You can call it whatever you want.<\/p>\n<p>In this example, what will trigger the automation is the time. When it is a specific time, the LED should light up. So, in the <strong>Trigger Type<\/strong>, select <strong>time<\/strong>. In the\u00a0<strong>At\u00a0<\/strong>section select the hour you want to trigger your automation.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/triggers.png?quality=100&#038;strip=all&#038;ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43281\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/triggers.png?resize=608%2C164&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"608\" height=\"164\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/triggers.png?w=608&amp;quality=100&amp;strip=all&amp;ssl=1 608w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/09\/triggers.png?resize=300%2C81&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 608px) 100vw, 608px\" \/><\/a><\/p>\n<p>Save your changes by clicking on the\u00a0<strong>Save\u00a0<\/strong>icon at the right bottom corner.<\/p>\n<p>Here, we&#8217;re not going to add any condition, but an example of one condition would be: the LED only lights up at 20:00 if you&#8217;re at home.<\/p>\n<p><strong>Action<\/strong><\/p>\n<p>The Action Type for this example is\u00a0<strong>Call Service<\/strong>, and we are going to call the service we tested previously in the\u00a0<strong>services<\/strong> section under the\u00a0<strong>Developer Tools<\/strong>.<\/p>\n<p>We&#8217;ve seen that the service is:<\/p>\n<pre>switch.turn_on<\/pre>\n<p>and the JSON data is<\/p>\n<pre>{ \n \"entity_id\": \"switch.light_desk\"\n}<\/pre>\n<p>Save your Automation by clicking the Save button at the bottom right corner.<\/p>\n<p>To turn the LED off at 8:00, for example, you need to add another automation, change the time and call the service switch.turn_off.<\/p>\n<hr \/>\n<h2>Wrapping up<\/h2>\n<p>In this post we&#8217;ve shown you how to get started with Home Assistant in Raspberry Pi &#8211; how to install and set everything up.<\/p>\n<p>We&#8217;ve also shown you how to add services to the Home Assistant and how to make a simple automation with the Pi&#8217;s GPIOs. The idea is that you use these concepts to automate your home in a smart manner.<\/p>\n<p>We hope you&#8217;ve found this post useful.<\/p>\n<p>Thanks for reading!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post we\u2019re going to show you how to get started with Home Assistant on Raspberry Pi. We\u2019ll show you how to set up Home Assistant and we\u2019ll build &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Getting Started with Home Assistant on Raspberry Pi\" class=\"read-more button\" href=\"https:\/\/randomnerdtutorials.com\/getting-started-with-home-assistant-on-raspberry-pi\/#more-43192\" aria-label=\"Read more about Getting Started with Home Assistant on Raspberry Pi\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":5,"featured_media":45754,"comment_status":"open","ping_status":"closed","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":""},"categories":[301,269,294,225,264,268,190,192],"tags":[],"class_list":["post-43192","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-0-raspberrypi","category-guide-project","category-home-assistant","category-home-automation","category-project","category-raspberry-pi-project","category-raspberry-pi","category-r-tutorials"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/11\/Thumbnail.jpg?fit=1131%2C720&quality=100&strip=all&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/43192","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/comments?post=43192"}],"version-history":[{"count":0,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/43192\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/45754"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=43192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=43192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=43192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}