Site updated at 2017-03-18 17:12:07 UTC

This commit is contained in:
Travis CI 2017-03-18 17:12:07 +00:00
parent 7573fcba68
commit 67179bf8fe
994 changed files with 1768 additions and 68252 deletions

View file

@ -3,17 +3,14 @@
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Setup basic information - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Setting up the basic info of Home Assistant.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/docs/configuration/basic/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Setup basic information">
<meta property="og:site_name" content="Home Assistant">
@ -21,39 +18,31 @@
<meta property="og:type" content="article">
<meta property="og:description" content="Setting up the basic info of Home Assistant.">
<meta property="og:image" content="https://home-assistant.io/images/default-social.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@home_assistant">
<meta name="twitter:title" content="Setup basic information">
<meta name="twitter:description" content="Setting up the basic info of Home Assistant.">
<meta name="twitter:image" content="https://home-assistant.io/images/default-social.png">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet">
<link href="/atom.xml" rel="alternate" title="Home Assistant" type="application/atom+xml">
<link rel='shortcut icon' href='/images/favicon.ico' />
<link rel='icon' type='image/png' href='/images/favicon-192x192.png' sizes='192x192' />
</head>
<body >
<header>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item three-tenths lap-two-sixths palm-one-whole ha-title">
<a href="/" class="site-title">
<img width='40' src='/demo/favicon-192x192.png'>
<span>Home Assistant</span>
</a>
</div>
<div class="grid__item seven-tenths lap-four-sixths palm-one-whole">
<nav>
<input type="checkbox" id="toggle">
<label for="toggle" class="toggle" data-open="Main Menu" data-close="Close Menu"></label>
<ul class="menu pull-right">
<li><a href="/getting-started/">Getting started</a></li>
<li><a href="/components/">Components</a></li>
<li><a href="/docs/">Docs</a></li>
@ -64,36 +53,21 @@
</ul>
</nav>
</div>
</div>
</div>
</header>
<div class="grid-wrapper">
<div class="grid grid-center">
<div class="grid__item two-thirds lap-one-whole palm-one-whole">
<article class="page">
<div class='edit-github'><a href='https://github.com/home-assistant/home-assistant.github.io/tree/current/source/_docs/configuration/basic.markdown'>Edit this page on GitHub</a></div>
<header>
<h1 class="title indent">
Setup Basic Information
</h1>
</header>
<hr class="divider">
<p>By default, Home Assistant will try to detect your location from IP address geolocation. Home Assistant will automatically select a temperature unit and time zone based on this location. You can overwrite this by adding the following information to your <code class="highlighter-rouge">configuration.yaml</code>:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">homeassistant</span><span class="pi">:</span>
<span class="c1"># Omitted values in this section will be auto detected using freegeoip.io</span>
@ -115,34 +89,20 @@
<span class="s">name</span><span class="pi">:</span> <span class="s">Home</span>
</code></pre>
</div>
<h3><a class="title-link" name="password-protecting-the-web-interface" href="#password-protecting-the-web-interface"></a> Password protecting the web interface</h3>
<p>First, youll want to add a password for the Home Assistant web interface. Use your favourite text editor to open <code class="highlighter-rouge">configuration.yaml</code> and edit the <code class="highlighter-rouge">http</code> section:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">http</span><span class="pi">:</span>
<span class="s">api_password</span><span class="pi">:</span> <span class="s">YOUR_PASSWORD</span>
</code></pre>
</div>
<p class="note warning">
If you decide to expose your Home Assistant instance to the internet and forget to set a password, your installation could be accessed by everybody.
</p>
<p>See the <a href="/components/http/">HTTP component documentation</a> for more options, such as the use of HTTPS encryption.</p>
</article>
</div>
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">
<div class="grid">
<section class="aside-module grid__item one-whole lap-one-half">
<div class='section'>
<h1 class="title delta">Topics</h1>
@ -329,13 +289,10 @@ If you decide to expose your Home Assistant instance to the internet and forget
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
@ -345,7 +302,6 @@ If you decide to expose your Home Assistant instance to the internet and forget
<a rel="me" href='https://facebook.com/homeassistantio'><i class="icon-facebook"></i></a>
<a rel="me" href='https://plus.google.com/110560654828510104551'><i class="icon-google-plus"></i></a>
<a rel="me" href='https://github.com/home-assistant/home-assistant'><i class="icon-github"></i></a>
<div class="credit">
Contact us at <a href='mailto:hello@home-assistant.io'>hello@home-assistant.io</a>.<br>
Website powered by <a href='http://jekyllrb.com/'>Jekyll</a> and the <a href='https://github.com/coogie/oscailte'>Oscalite theme</a>.<br />
@ -357,7 +313,6 @@ If you decide to expose your Home Assistant instance to the internet and forget
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
@ -365,4 +320,4 @@ If you decide to expose your Home Assistant instance to the internet and forget
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>
</html>

View file

@ -3,17 +3,14 @@
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Customizing devices and services - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Simple customization for devices and services in the frontend.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/docs/configuration/customizing-devices/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Customizing devices and services">
<meta property="og:site_name" content="Home Assistant">
@ -21,39 +18,31 @@
<meta property="og:type" content="article">
<meta property="og:description" content="Simple customization for devices and services in the frontend.">
<meta property="og:image" content="https://home-assistant.io/images/default-social.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@home_assistant">
<meta name="twitter:title" content="Customizing devices and services">
<meta name="twitter:description" content="Simple customization for devices and services in the frontend.">
<meta name="twitter:image" content="https://home-assistant.io/images/default-social.png">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet">
<link href="/atom.xml" rel="alternate" title="Home Assistant" type="application/atom+xml">
<link rel='shortcut icon' href='/images/favicon.ico' />
<link rel='icon' type='image/png' href='/images/favicon-192x192.png' sizes='192x192' />
</head>
<body >
<header>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item three-tenths lap-two-sixths palm-one-whole ha-title">
<a href="/" class="site-title">
<img width='40' src='/demo/favicon-192x192.png'>
<span>Home Assistant</span>
</a>
</div>
<div class="grid__item seven-tenths lap-four-sixths palm-one-whole">
<nav>
<input type="checkbox" id="toggle">
<label for="toggle" class="toggle" data-open="Main Menu" data-close="Close Menu"></label>
<ul class="menu pull-right">
<li><a href="/getting-started/">Getting started</a></li>
<li><a href="/components/">Components</a></li>
<li><a href="/docs/">Docs</a></li>
@ -64,36 +53,21 @@
</ul>
</nav>
</div>
</div>
</div>
</header>
<div class="grid-wrapper">
<div class="grid grid-center">
<div class="grid__item two-thirds lap-one-whole palm-one-whole">
<article class="page">
<div class='edit-github'><a href='https://github.com/home-assistant/home-assistant.github.io/tree/current/source/_docs/configuration/customizing-devices.markdown'>Edit this page on GitHub</a></div>
<header>
<h1 class="title indent">
Customizing Devices and Services
</h1>
</header>
<hr class="divider">
<p>By default, all of your devices will be visible and have a default icon determined by their domain. You can customize the look and feel of your front page by altering some of these parameters. This can be done by overriding attributes of specific entities.</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">homeassistant</span><span class="pi">:</span>
<span class="s">name</span><span class="pi">:</span> <span class="s">Home</span>
<span class="s">unit_system</span><span class="pi">:</span> <span class="s">metric</span>
@ -123,9 +97,7 @@
</code></pre>
</div>
<h3><a class="title-link" name="possible-values" href="#possible-values"></a> Possible values</h3>
<table>
<thead>
<tr>
@ -160,36 +132,21 @@
</tr>
</tbody>
</table>
<h3><a class="title-link" name="device-class" href="#device-class"></a> Device Class</h3>
<p>Device class is currently supported by the following platforms:</p>
<ul>
<li><a href="/components/binary_sensor/">Binary Sensor</a></li>
<li><a href="/components/cover/">Cover</a></li>
</ul>
<h3><a class="title-link" name="reloading-customize" href="#reloading-customize"></a> Reloading customize</h3>
<p>Home Assistant offers a service to reload the core configuration while Home Assistant is running called <code class="highlighter-rouge">homeassistant/reload_core_config</code>. This allows you to change your customize section and see it being applied without having to restart Home Assistant. To call this service, go to the <img src="/images/screenshots/developer-tool-services-icon.png" alt="service developer tool icon" class="no-shadow" height="38" /> service developer tools, select the service <code class="highlighter-rouge">homeassistant/reload_core_config</code> and click “Call Service”.</p>
<p class="note warning">
New customize information will be applied the next time the state of the entity gets updated.
</p>
</article>
</div>
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">
<div class="grid">
<section class="aside-module grid__item one-whole lap-one-half">
<div class='section'>
<h1 class="title delta">Topics</h1>
@ -376,13 +333,10 @@ New customize information will be applied the next time the state of the entity
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
@ -392,7 +346,6 @@ New customize information will be applied the next time the state of the entity
<a rel="me" href='https://facebook.com/homeassistantio'><i class="icon-facebook"></i></a>
<a rel="me" href='https://plus.google.com/110560654828510104551'><i class="icon-google-plus"></i></a>
<a rel="me" href='https://github.com/home-assistant/home-assistant'><i class="icon-github"></i></a>
<div class="credit">
Contact us at <a href='mailto:hello@home-assistant.io'>hello@home-assistant.io</a>.<br>
Website powered by <a href='http://jekyllrb.com/'>Jekyll</a> and the <a href='https://github.com/coogie/oscailte'>Oscalite theme</a>.<br />
@ -404,7 +357,6 @@ New customize information will be applied the next time the state of the entity
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
@ -412,4 +364,4 @@ New customize information will be applied the next time the state of the entity
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>
</html>

View file

@ -3,17 +3,14 @@
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Adding devices to Home Assistant - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Steps to help you get your devices in Home Assistant.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/docs/configuration/devices/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Adding devices to Home Assistant">
<meta property="og:site_name" content="Home Assistant">
@ -21,39 +18,31 @@
<meta property="og:type" content="article">
<meta property="og:description" content="Steps to help you get your devices in Home Assistant.">
<meta property="og:image" content="https://home-assistant.io/images/default-social.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@home_assistant">
<meta name="twitter:title" content="Adding devices to Home Assistant">
<meta name="twitter:description" content="Steps to help you get your devices in Home Assistant.">
<meta name="twitter:image" content="https://home-assistant.io/images/default-social.png">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet">
<link href="/atom.xml" rel="alternate" title="Home Assistant" type="application/atom+xml">
<link rel='shortcut icon' href='/images/favicon.ico' />
<link rel='icon' type='image/png' href='/images/favicon-192x192.png' sizes='192x192' />
</head>
<body >
<header>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item three-tenths lap-two-sixths palm-one-whole ha-title">
<a href="/" class="site-title">
<img width='40' src='/demo/favicon-192x192.png'>
<span>Home Assistant</span>
</a>
</div>
<div class="grid__item seven-tenths lap-four-sixths palm-one-whole">
<nav>
<input type="checkbox" id="toggle">
<label for="toggle" class="toggle" data-open="Main Menu" data-close="Close Menu"></label>
<ul class="menu pull-right">
<li><a href="/getting-started/">Getting started</a></li>
<li><a href="/components/">Components</a></li>
<li><a href="/docs/">Docs</a></li>
@ -64,42 +53,24 @@
</ul>
</nav>
</div>
</div>
</div>
</header>
<div class="grid-wrapper">
<div class="grid grid-center">
<div class="grid__item two-thirds lap-one-whole palm-one-whole">
<article class="page">
<div class='edit-github'><a href='https://github.com/home-assistant/home-assistant.github.io/tree/current/source/_docs/configuration/devices.markdown'>Edit this page on GitHub</a></div>
<header>
<h1 class="title indent">
Adding Devices to Home Assistant
</h1>
</header>
<hr class="divider">
<p>Home Assistant will be able to automatically discover many devices and services available on your network if you have <a href="/components/discovery/">the discovery component</a> enabled (the default setting).</p>
<p>See the <a href="/components/">components overview page</a> to find installation instructions for your devices and services. If you cant find support for your favorite device or service, <a href="/developers/add_new_platform/">consider adding support</a>.</p>
<p>Usually every entity needs its own entry in the <code class="highlighter-rouge">configuration.yaml</code> file. There are two styles for multiple entries:</p>
<h4><a class="title-link" name="style-1-collect-every-entity-under-the-parent" href="#style-1-collect-every-entity-under-the-parent"></a> Style 1: Collect every entity under the “parent”</h4>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">sensor</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">mqtt</span>
<span class="s">state_topic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">home/bedroom/temperature"</span>
@ -114,11 +85,8 @@
<span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">vera</span>
</code></pre>
</div>
<h4><a class="title-link" name="style-2-list-each-device-separately" href="#style-2-list-each-device-separately"></a> Style 2: List each device separately</h4>
<p>You need to append numbers or strings to differentiate the entries, as in the example below. The appended number or string must be unique.</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">media_player livingroom</span><span class="pi">:</span>
<span class="s">platform</span><span class="pi">:</span> <span class="s">mpd</span>
<span class="s">server</span><span class="pi">:</span> <span class="s">IP_ADDRESS</span>
@ -133,12 +101,9 @@
<span class="s">platform</span><span class="pi">:</span> <span class="s">mjpeg</span>
</code></pre>
</div>
<h3><a class="title-link" name="grouping-devices" href="#grouping-devices"></a> Grouping devices</h3>
<p>Once you have several devices set up, it is time to organize them into groups.
Each group consists of a name and a list of entity IDs. Entity IDs can be retrieved from the web interface by using the Set State page in the Developer Tools (<img src="/images/screenshots/developer-tool-states-icon.png" alt="service developer tool icon" class="no-shadow" height="38" />).</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry showing two styles</span>
<span class="s">group</span><span class="pi">:</span>
<span class="s">living_room</span><span class="pi">:</span> <span class="s">light.table_lamp, switch.ac</span>
@ -147,21 +112,11 @@ Each group consists of a name and a list of entity IDs. Entity IDs can be retrie
<span class="pi">-</span> <span class="s">media_player.nexus_player</span>
</code></pre>
</div>
<p>For more details please check the <a href="/components/group/">Group</a> page.</p>
</article>
</div>
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">
<div class="grid">
<section class="aside-module grid__item one-whole lap-one-half">
<div class='section'>
<h1 class="title delta">Topics</h1>
@ -348,13 +303,10 @@ Each group consists of a name and a list of entity IDs. Entity IDs can be retrie
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
@ -364,7 +316,6 @@ Each group consists of a name and a list of entity IDs. Entity IDs can be retrie
<a rel="me" href='https://facebook.com/homeassistantio'><i class="icon-facebook"></i></a>
<a rel="me" href='https://plus.google.com/110560654828510104551'><i class="icon-google-plus"></i></a>
<a rel="me" href='https://github.com/home-assistant/home-assistant'><i class="icon-github"></i></a>
<div class="credit">
Contact us at <a href='mailto:hello@home-assistant.io'>hello@home-assistant.io</a>.<br>
Website powered by <a href='http://jekyllrb.com/'>Jekyll</a> and the <a href='https://github.com/coogie/oscailte'>Oscalite theme</a>.<br />
@ -376,7 +327,6 @@ Each group consists of a name and a list of entity IDs. Entity IDs can be retrie
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
@ -384,4 +334,4 @@ Each group consists of a name and a list of entity IDs. Entity IDs can be retrie
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>
</html>

View file

@ -3,17 +3,14 @@
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Events - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Describes all there is to know about events in Home Assistant.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/docs/configuration/events/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Events">
<meta property="og:site_name" content="Home Assistant">
@ -21,39 +18,31 @@
<meta property="og:type" content="article">
<meta property="og:description" content="Describes all there is to know about events in Home Assistant.">
<meta property="og:image" content="https://home-assistant.io/images/default-social.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@home_assistant">
<meta name="twitter:title" content="Events">
<meta name="twitter:description" content="Describes all there is to know about events in Home Assistant.">
<meta name="twitter:image" content="https://home-assistant.io/images/default-social.png">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet">
<link href="/atom.xml" rel="alternate" title="Home Assistant" type="application/atom+xml">
<link rel='shortcut icon' href='/images/favicon.ico' />
<link rel='icon' type='image/png' href='/images/favicon-192x192.png' sizes='192x192' />
</head>
<body >
<header>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item three-tenths lap-two-sixths palm-one-whole ha-title">
<a href="/" class="site-title">
<img width='40' src='/demo/favicon-192x192.png'>
<span>Home Assistant</span>
</a>
</div>
<div class="grid__item seven-tenths lap-four-sixths palm-one-whole">
<nav>
<input type="checkbox" id="toggle">
<label for="toggle" class="toggle" data-open="Main Menu" data-close="Close Menu"></label>
<ul class="menu pull-right">
<li><a href="/getting-started/">Getting started</a></li>
<li><a href="/components/">Components</a></li>
<li><a href="/docs/">Docs</a></li>
@ -64,47 +53,28 @@
</ul>
</nav>
</div>
</div>
</div>
</header>
<div class="grid-wrapper">
<div class="grid grid-center">
<div class="grid__item two-thirds lap-one-whole palm-one-whole">
<article class="page">
<div class='edit-github'><a href='https://github.com/home-assistant/home-assistant.github.io/tree/current/source/_docs/configuration/events.markdown'>Edit this page on GitHub</a></div>
<header>
<h1 class="title indent">
Events
</h1>
</header>
<hr class="divider">
<p>The core of Home Assistant is the event bus. The event bus allows any component to fire or listen for events. It is the core of everything. For example, any state change will be announced on the event bus as a <code class="highlighter-rouge">state_changed</code> event containing the previous and the new state of an entity.</p>
<p>Home Assistant contains a few built-in events that are used to coordinate between various components.</p>
<h3><a class="title-link" name="event-homeassistant_start" href="#event-homeassistant_start"></a> Event <code class="highlighter-rouge">homeassistant_start</code></h3>
<p>Event <code class="highlighter-rouge">homeassistant_start</code> is fired when all components from the configuration have been intitialized. This is the event that will start the timer firing off <code class="highlighter-rouge">time_changed</code> events.</p>
<h3><a class="title-link" name="event-homeassistant_stop" href="#event-homeassistant_stop"></a> Event <code class="highlighter-rouge">homeassistant_stop</code></h3>
<p>Event <code class="highlighter-rouge">homeassistant_stop</code> is fired when Home Assistant is shutting down. It should be used to close any open connection or release any resources.</p>
<h3><a class="title-link" name="event-state_changed" href="#event-state_changed"></a> Event <code class="highlighter-rouge">state_changed</code></h3>
<p>Event <code class="highlighter-rouge">state_changed</code> is fired when a state changes. Both <code class="highlighter-rouge">old_state</code> and <code class="highlighter-rouge">new_state</code> are state objects. <a href="/topics/state_object/">Documentation about state objects.</a></p>
<table>
<thead>
<tr>
@ -127,10 +97,8 @@
</tr>
</tbody>
</table>
<h3><a class="title-link" name="event-time_changed" href="#event-time_changed"></a> Event <code class="highlighter-rouge">time_changed</code></h3>
<p>Event <code class="highlighter-rouge">time_changed</code> is fired every second by the timer and contains the current time.</p>
<table>
<thead>
<tr>
@ -145,10 +113,8 @@
</tr>
</tbody>
</table>
<h3><a class="title-link" name="event-service_registered" href="#event-service_registered"></a> Event <code class="highlighter-rouge">service_registered</code></h3>
<p>Event <code class="highlighter-rouge">service_registered</code> is fired when a new service has been registered within Home Assistant.</p>
<table>
<thead>
<tr>
@ -167,10 +133,8 @@
</tr>
</tbody>
</table>
<h3><a class="title-link" name="event-call_service" href="#event-call_service"></a> Event <code class="highlighter-rouge">call_service</code></h3>
<p>Event <code class="highlighter-rouge">call_service</code> is fired to call a service.</p>
<table>
<thead>
<tr>
@ -197,10 +161,8 @@
</tr>
</tbody>
</table>
<h3><a class="title-link" name="event-service_executed" href="#event-service_executed"></a> Event <code class="highlighter-rouge">service_executed</code></h3>
<p>Event <code class="highlighter-rouge">service_executed</code> is fired by the service handler to indicate the service is done.</p>
<table>
<thead>
<tr>
@ -215,10 +177,8 @@
</tr>
</tbody>
</table>
<h3><a class="title-link" name="event-platform_discovered" href="#event-platform_discovered"></a> Event <code class="highlighter-rouge">platform_discovered</code></h3>
<p>Event <code class="highlighter-rouge">platform_discovered</code> is fired when a new platform has been discovered by the discovery component.</p>
<table>
<thead>
<tr>
@ -237,10 +197,8 @@
</tr>
</tbody>
</table>
<h3><a class="title-link" name="event-component_loaded" href="#event-component_loaded"></a> Event <code class="highlighter-rouge">component_loaded</code></h3>
<p>Event <code class="highlighter-rouge">component_loaded</code> is fired when a new component has been loaded and initialized.</p>
<table>
<thead>
<tr>
@ -255,18 +213,10 @@
</tr>
</tbody>
</table>
</article>
</div>
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">
<div class="grid">
<section class="aside-module grid__item one-whole lap-one-half">
<div class='section'>
<h1 class="title delta">Topics</h1>
@ -453,13 +403,10 @@
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
@ -469,7 +416,6 @@
<a rel="me" href='https://facebook.com/homeassistantio'><i class="icon-facebook"></i></a>
<a rel="me" href='https://plus.google.com/110560654828510104551'><i class="icon-google-plus"></i></a>
<a rel="me" href='https://github.com/home-assistant/home-assistant'><i class="icon-github"></i></a>
<div class="credit">
Contact us at <a href='mailto:hello@home-assistant.io'>hello@home-assistant.io</a>.<br>
Website powered by <a href='http://jekyllrb.com/'>Jekyll</a> and the <a href='https://github.com/coogie/oscailte'>Oscalite theme</a>.<br />
@ -481,7 +427,6 @@
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
@ -489,4 +434,4 @@
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>
</html>

View file

@ -3,17 +3,14 @@
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Group Visibility - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Instructions how to change group visibility using automations.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/docs/configuration/group_visibility/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Group Visibility">
<meta property="og:site_name" content="Home Assistant">
@ -21,39 +18,31 @@
<meta property="og:type" content="article">
<meta property="og:description" content="Instructions how to change group visibility using automations.">
<meta property="og:image" content="https://home-assistant.io/images/default-social.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@home_assistant">
<meta name="twitter:title" content="Group Visibility">
<meta name="twitter:description" content="Instructions how to change group visibility using automations.">
<meta name="twitter:image" content="https://home-assistant.io/images/default-social.png">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet">
<link href="/atom.xml" rel="alternate" title="Home Assistant" type="application/atom+xml">
<link rel='shortcut icon' href='/images/favicon.ico' />
<link rel='icon' type='image/png' href='/images/favicon-192x192.png' sizes='192x192' />
</head>
<body >
<header>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item three-tenths lap-two-sixths palm-one-whole ha-title">
<a href="/" class="site-title">
<img width='40' src='/demo/favicon-192x192.png'>
<span>Home Assistant</span>
</a>
</div>
<div class="grid__item seven-tenths lap-four-sixths palm-one-whole">
<nav>
<input type="checkbox" id="toggle">
<label for="toggle" class="toggle" data-open="Main Menu" data-close="Close Menu"></label>
<ul class="menu pull-right">
<li><a href="/getting-started/">Getting started</a></li>
<li><a href="/components/">Components</a></li>
<li><a href="/docs/">Docs</a></li>
@ -64,57 +53,35 @@
</ul>
</nav>
</div>
</div>
</div>
</header>
<div class="grid-wrapper">
<div class="grid grid-center">
<div class="grid__item two-thirds lap-one-whole palm-one-whole">
<article class="page">
<div class='edit-github'><a href='https://github.com/home-assistant/home-assistant.github.io/tree/current/source/_docs/configuration/group_visibility.markdown'>Edit this page on GitHub</a></div>
<header>
<h1 class="title indent">
Group Visibility
</h1>
</header>
<hr class="divider">
<p>After filling Home Assistant with all your precious home automation devices, you usually end up with a cluttered interface and lots of groups that are not interesting in your current context. What if you just want to show groups that are interesting <em>now</em> and hide the rest? Thats when group visibility comes to play.</p>
<h2><a class="title-link" name="changing-visibility-of-a-group" href="#changing-visibility-of-a-group"></a> Changing visibility of a group</h2>
<p>To change visibility of a group, use the service <code class="highlighter-rouge">group.set_visibility</code>, pass the group name as <code class="highlighter-rouge">entity_id</code> and use <code class="highlighter-rouge">visible</code> to decide wheter the group should be shown or hidden.</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">service</span><span class="pi">:</span> <span class="s">group.set_visibility</span>
<span class="s">entity_id</span><span class="pi">:</span> <span class="s">group.basement</span>
<span class="s">data</span><span class="pi">:</span>
<span class="s">visible</span><span class="pi">:</span> <span class="s">False</span>
</code></pre>
</div>
<p class="note">
If a sensor belongs to only one group and that group is hidden, the sensor will “jump” to the top of the web interface. Add the sensor to an additional (visible) group if you do not want this to happen.
</p>
<h2><a class="title-link" name="automations" href="#automations"></a> Automations</h2>
<p>First you should decide under which circumstances a group should be visible or not. Depending on the complexity, you might have to write two automations: one that hides the group and another that shows it.</p>
<p>In this example, the group <code class="highlighter-rouge">group.basement</code> is hidden when the sun sets and shown again when it rises:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">automation</span><span class="pi">:</span>
<span class="s">trigger</span><span class="pi">:</span>
<span class="s">platform</span><span class="pi">:</span> <span class="s">sun</span>
@ -136,11 +103,8 @@ If a sensor belongs to only one group and that group is hidden, the sensor will
<span class="s">visible</span><span class="pi">:</span> <span class="s">True</span>
</code></pre>
</div>
<h2><a class="title-link" name="easier-automations" href="#easier-automations"></a> Easier automations</h2>
<p>One of the most common uses cases are to show groups during certain times of day, maybe commuting information during a work day morning or light switches when it is getting dark. The complexity of automations needed to make this happen will quickly get out of hand. So, one way to make the automations easier is to create a sensor that alters its state depending on time of day. One way of doing that is using a <code class="highlighter-rouge">command_line</code> sensor and a script:</p>
<div class="language-python highlighter-rouge"><pre class="highlight"><code><span class="c">#!/usr/bin/env python3</span>
<span class="c"># -*- coding: utf-8 -*-</span>
@ -176,18 +140,14 @@ If a sensor belongs to only one group and that group is hidden, the sensor will
<span class="k">print</span><span class="p">(</span><span class="n">get_current_occasion</span><span class="p">(</span><span class="n">OCCASIONS</span><span class="p">))</span>
</code></pre>
</div>
<p>This script will output “work_morning” from 06:00-07:10 during weekdays (monday-friday), “weekday” during all other time from monday-friday and “weekend” on saturdays and sundays. Adjust according to your needs. To create the sensor, just add it like this:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">sensor</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">command_line</span>
<span class="s">name</span><span class="pi">:</span> <span class="s">Occasion</span>
<span class="s">command</span><span class="pi">:</span> <span class="s2">"</span><span class="s">python3</span><span class="nv"> </span><span class="s">occasion.py"</span>
</code></pre>
</div>
<p>To simplify things, we create a Home Assistant script that changes the visibility of a group, but also verifies that an entity is in a specific state:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">script</span><span class="pi">:</span>
<span class="s">group_visibility</span><span class="pi">:</span>
<span class="s">sequence</span><span class="pi">:</span>
@ -197,9 +157,7 @@ If a sensor belongs to only one group and that group is hidden, the sensor will
<span class="s">visible</span><span class="pi">:</span> <span class="s1">'</span><span class="s">{{</span><span class="nv"> </span><span class="s">is_state(cond,</span><span class="nv"> </span><span class="s">visible_state)</span><span class="nv"> </span><span class="s">}}'</span>
</code></pre>
</div>
<p>The last part is writing an automation that hides or shows the group:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">automation</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Work morning</span>
<span class="s">trigger</span><span class="pi">:</span>
@ -215,11 +173,8 @@ If a sensor belongs to only one group and that group is hidden, the sensor will
<span class="s">visible_state</span><span class="pi">:</span> <span class="s1">'</span><span class="s">work_morning'</span>
</code></pre>
</div>
<p>Our previously defined script will be called if <code class="highlighter-rouge">sensor.occasion</code> changes state OR when Home Assistant has started. The group <code class="highlighter-rouge">group.work_sensors</code> will be shown when <code class="highlighter-rouge">sensor.occasion</code> changes state to “work_morning” and hidden otherwise.</p>
<h3><a class="title-link" name="the-complete-example" href="#the-complete-example"></a> The complete example</h3>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">group</span><span class="pi">:</span>
<span class="s">default_view</span><span class="pi">:</span>
<span class="s">entities</span><span class="pi">:</span>
@ -260,18 +215,10 @@ If a sensor belongs to only one group and that group is hidden, the sensor will
<span class="s">visible_state</span><span class="pi">:</span> <span class="s1">'</span><span class="s">work_morning'</span>
</code></pre>
</div>
</article>
</div>
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">
<div class="grid">
<section class="aside-module grid__item one-whole lap-one-half">
<div class='section'>
<h1 class="title delta">Topics</h1>
@ -458,13 +405,10 @@ If a sensor belongs to only one group and that group is hidden, the sensor will
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
@ -474,7 +418,6 @@ If a sensor belongs to only one group and that group is hidden, the sensor will
<a rel="me" href='https://facebook.com/homeassistantio'><i class="icon-facebook"></i></a>
<a rel="me" href='https://plus.google.com/110560654828510104551'><i class="icon-google-plus"></i></a>
<a rel="me" href='https://github.com/home-assistant/home-assistant'><i class="icon-github"></i></a>
<div class="credit">
Contact us at <a href='mailto:hello@home-assistant.io'>hello@home-assistant.io</a>.<br>
Website powered by <a href='http://jekyllrb.com/'>Jekyll</a> and the <a href='https://github.com/coogie/oscailte'>Oscalite theme</a>.<br />
@ -486,7 +429,6 @@ If a sensor belongs to only one group and that group is hidden, the sensor will
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
@ -494,4 +436,4 @@ If a sensor belongs to only one group and that group is hidden, the sensor will
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>
</html>

View file

@ -3,17 +3,14 @@
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Configuring Home Assistant - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Configuring Home Assistant.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/docs/configuration/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Configuring Home Assistant">
<meta property="og:site_name" content="Home Assistant">
@ -21,39 +18,31 @@
<meta property="og:type" content="article">
<meta property="og:description" content="Configuring Home Assistant.">
<meta property="og:image" content="https://home-assistant.io/images/default-social.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@home_assistant">
<meta name="twitter:title" content="Configuring Home Assistant">
<meta name="twitter:description" content="Configuring Home Assistant.">
<meta name="twitter:image" content="https://home-assistant.io/images/default-social.png">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet">
<link href="/atom.xml" rel="alternate" title="Home Assistant" type="application/atom+xml">
<link rel='shortcut icon' href='/images/favicon.ico' />
<link rel='icon' type='image/png' href='/images/favicon-192x192.png' sizes='192x192' />
</head>
<body >
<header>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item three-tenths lap-two-sixths palm-one-whole ha-title">
<a href="/" class="site-title">
<img width='40' src='/demo/favicon-192x192.png'>
<span>Home Assistant</span>
</a>
</div>
<div class="grid__item seven-tenths lap-four-sixths palm-one-whole">
<nav>
<input type="checkbox" id="toggle">
<label for="toggle" class="toggle" data-open="Main Menu" data-close="Close Menu"></label>
<ul class="menu pull-right">
<li><a href="/getting-started/">Getting started</a></li>
<li><a href="/components/">Components</a></li>
<li><a href="/docs/">Docs</a></li>
@ -64,38 +53,22 @@
</ul>
</nav>
</div>
</div>
</div>
</header>
<div class="grid-wrapper">
<div class="grid grid-center">
<div class="grid__item two-thirds lap-one-whole palm-one-whole">
<article class="page">
<div class='edit-github'><a href='https://github.com/home-assistant/home-assistant.github.io/tree/current/source/_docs/configuration.markdown'>Edit this page on GitHub</a></div>
<header>
<h1 class="title indent">
Configuring Home Assistant
</h1>
</header>
<hr class="divider">
<p>When launched for the first time, Home Assistant will write a default configuration file enabling the web interface and device discovery. It can take up to a minute for your devices to be discovered and appear in the user interface.</p>
<p>The location of the folder differs between operating systems:</p>
<table>
<thead>
<tr>
@ -118,33 +91,19 @@
</tr>
</tbody>
</table>
<p>If you want to use a different folder for configuration, use the config command line parameter: <code class="highlighter-rouge">hass --config path/to/config</code>.</p>
<p>Inside your configuration folder is the file <code class="highlighter-rouge">configuration.yaml</code>. This is the main file that contains components to be loaded with their configurations. Throughout the documentation you will find snippets that you can add to your configuration file to enable functionality.</p>
<p class="note">
You will have to restart Home Assistant for changes to <code class="highlighter-rouge">configuration.yaml</code> to take effect.
</p>
<p>If you run into trouble while configuring Home Assistant, have a look at the <a href="/getting-started/troubleshooting-configuration/">configuration troubleshooting page</a> and at the <a href="/cookbook/#example-configurationyaml">configuration.yaml examples</a>.</p>
<p class="note tip">
Test any changes to your configuration files from the command line with <code class="highlighter-rouge">hass --script check_config</code>. This script allows you to test changes without the need to restart Home Assistant.
</p>
</article>
</div>
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">
<div class="grid">
<section class="aside-module grid__item one-whole lap-one-half">
<div class='section'>
<h1 class="title delta">Topics</h1>
@ -331,13 +290,10 @@
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
@ -347,7 +303,6 @@
<a rel="me" href='https://facebook.com/homeassistantio'><i class="icon-facebook"></i></a>
<a rel="me" href='https://plus.google.com/110560654828510104551'><i class="icon-google-plus"></i></a>
<a rel="me" href='https://github.com/home-assistant/home-assistant'><i class="icon-github"></i></a>
<div class="credit">
Contact us at <a href='mailto:hello@home-assistant.io'>hello@home-assistant.io</a>.<br>
Website powered by <a href='http://jekyllrb.com/'>Jekyll</a> and the <a href='https://github.com/coogie/oscailte'>Oscalite theme</a>.<br />
@ -359,7 +314,6 @@
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
@ -367,4 +321,4 @@
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>
</html>

View file

@ -3,17 +3,14 @@
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Packages - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Describes all there is to know about configuration packages in Home Assistant.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/docs/configuration/packages/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Packages">
<meta property="og:site_name" content="Home Assistant">
@ -21,39 +18,31 @@
<meta property="og:type" content="article">
<meta property="og:description" content="Describes all there is to know about configuration packages in Home Assistant.">
<meta property="og:image" content="https://home-assistant.io/images/default-social.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@home_assistant">
<meta name="twitter:title" content="Packages">
<meta name="twitter:description" content="Describes all there is to know about configuration packages in Home Assistant.">
<meta name="twitter:image" content="https://home-assistant.io/images/default-social.png">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet">
<link href="/atom.xml" rel="alternate" title="Home Assistant" type="application/atom+xml">
<link rel='shortcut icon' href='/images/favicon.ico' />
<link rel='icon' type='image/png' href='/images/favicon-192x192.png' sizes='192x192' />
</head>
<body >
<header>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item three-tenths lap-two-sixths palm-one-whole ha-title">
<a href="/" class="site-title">
<img width='40' src='/demo/favicon-192x192.png'>
<span>Home Assistant</span>
</a>
</div>
<div class="grid__item seven-tenths lap-four-sixths palm-one-whole">
<nav>
<input type="checkbox" id="toggle">
<label for="toggle" class="toggle" data-open="Main Menu" data-close="Close Menu"></label>
<ul class="menu pull-right">
<li><a href="/getting-started/">Getting started</a></li>
<li><a href="/components/">Components</a></li>
<li><a href="/docs/">Docs</a></li>
@ -64,38 +53,22 @@
</ul>
</nav>
</div>
</div>
</div>
</header>
<div class="grid-wrapper">
<div class="grid grid-center">
<div class="grid__item two-thirds lap-one-whole palm-one-whole">
<article class="page">
<div class='edit-github'><a href='https://github.com/home-assistant/home-assistant.github.io/tree/current/source/_docs/configuration/packages.markdown'>Edit this page on GitHub</a></div>
<header>
<h1 class="title indent">
Packages
</h1>
</header>
<hr class="divider">
<p>Packages in Home Assistant provides a way to bundle different components configuration together. We were already introduced to the two configuration styles (specifying platforms entries together or individually) on the <a href="/docs/configuration/devices/">adding devices</a> page. Both of these configuration methods require you to create the component key in the main <code class="highlighter-rouge">configuration.yaml</code> file. With packages we have a way to include different components, or parts of configuration using any of the <code class="highlighter-rouge">!include</code> directives introduced in <a href="/docs/configuration/splitting_configuration">splitting the configuration</a>.</p>
<p>Packages are configured under the core <code class="highlighter-rouge">homeassistant/packages</code> in the configuration and take the format of a packages name (no spaces, all lower case) followed by a dictionary with the package config. For example, package <code class="highlighter-rouge">pack_1</code> would be created as:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">homeassistant</span><span class="pi">:</span>
<span class="s">...</span>
<span class="s">packages</span><span class="pi">:</span>
@ -103,13 +76,9 @@
<span class="s">...package configuration here...</span>
</code></pre>
</div>
<p>The package configuration can include: <code class="highlighter-rouge">switch</code>, <code class="highlighter-rouge">light</code>, <code class="highlighter-rouge">automation</code>, <code class="highlighter-rouge">groups</code> or the majority of the Home Assistant components.</p>
<p>It can be specified inline or in a seperate YAML file using <code class="highlighter-rouge">!include</code>.</p>
<p>Inline example, main <code class="highlighter-rouge">configuration.yaml</code>:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">homeassistant</span><span class="pi">:</span>
<span class="s">...</span>
<span class="s">packages</span><span class="pi">:</span>
@ -122,18 +91,14 @@
<span class="s">...</span>
</code></pre>
</div>
<p>Include example, main <code class="highlighter-rouge">configuration.yaml</code>:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">homeassistant</span><span class="pi">:</span>
<span class="s">...</span>
<span class="s">packages</span><span class="pi">:</span>
<span class="s">pack_1</span><span class="pi">:</span> <span class="kt">!include</span> <span class="s">my_package.yaml</span>
</code></pre>
</div>
<p>The file <code class="highlighter-rouge">my_package.yaml</code> contains the “top-level” configuration:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>switch:
- platform: rest
...
@ -142,17 +107,13 @@ light:
...
</code></pre>
</div>
<p>There are some rules for packages that will be merged:</p>
<ol>
<li>Component names may only use the basic form (e.g. <code class="highlighter-rouge">switch</code> and <code class="highlighter-rouge">switch 1</code> or <code class="highlighter-rouge">switch aa</code> is not accepted).</li>
<li>Platform based components (<code class="highlighter-rouge">light</code>, <code class="highlighter-rouge">switch</code>, etc) can always be merged.</li>
<li>
<p>Components where entities are identified by a key that will represent the entity_id (<code class="highlighter-rouge"><span class="p">{</span><span class="err">key:</span><span class="w"> </span><span class="err">config</span><span class="p">}</span></code>) need to have unique keys between packages and the main configuration file.</p>
<p>For example if we have the following in the main config. You are not allowed to re-use “my_input” again for <code class="highlighter-rouge">input_boolean</code> in a package:</p>
<p><code class="highlighter-rouge">yaml
input_boolean:
my_input:
@ -160,34 +121,21 @@ light:
</li>
<li>Any component that is not a platform [2], or dictionaries with Entity ID keys [3] cannot be merged and can only occur once between all packages and the main configuration.</li>
</ol>
<p class="note tip">
Components inside packages can only specify platform entries using configuration style 1, where all the platforms are grouped under the component name.
</p>
<h3><a class="title-link" name="create-a-packages-folder" href="#create-a-packages-folder"></a> Create a packages folder</h3>
<p>One way to organise packages would be to create a folder named “packages” in your Home Assistant configuration directory. In the packages directory you can store any number of packages in a YAML file. This entry in your <code class="highlighter-rouge">configuration.yaml</code> will load all packages:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">homeassistant</span><span class="pi">:</span>
<span class="s">packages</span><span class="pi">:</span> <span class="kt">!include_dir_named</span> <span class="s">packages</span>
</code></pre>
</div>
<p>This uses the concept splitting the configuration and will include all files in a directory with the keys representing the filenames.
See the documentation about <a href="/docs/configuration/splitting_configuration/">splitting the configuration</a> for more information about <code class="highlighter-rouge">!include_dir_named</code> and other include statements that might be helpful.</p>
</article>
</div>
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">
<div class="grid">
<section class="aside-module grid__item one-whole lap-one-half">
<div class='section'>
<h1 class="title delta">Topics</h1>
@ -374,13 +322,10 @@ See the documentation about <a href="/docs/configuration/splitting_configuration
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
@ -390,7 +335,6 @@ See the documentation about <a href="/docs/configuration/splitting_configuration
<a rel="me" href='https://facebook.com/homeassistantio'><i class="icon-facebook"></i></a>
<a rel="me" href='https://plus.google.com/110560654828510104551'><i class="icon-google-plus"></i></a>
<a rel="me" href='https://github.com/home-assistant/home-assistant'><i class="icon-github"></i></a>
<div class="credit">
Contact us at <a href='mailto:hello@home-assistant.io'>hello@home-assistant.io</a>.<br>
Website powered by <a href='http://jekyllrb.com/'>Jekyll</a> and the <a href='https://github.com/coogie/oscailte'>Oscalite theme</a>.<br />
@ -402,7 +346,6 @@ See the documentation about <a href="/docs/configuration/splitting_configuration
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
@ -410,4 +353,4 @@ See the documentation about <a href="/docs/configuration/splitting_configuration
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>
</html>

View file

@ -3,17 +3,14 @@
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Entity component platform options - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Shows how to customize polling interval for any component via configuration.yaml.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/docs/configuration/platform_options/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Entity component platform options">
<meta property="og:site_name" content="Home Assistant">
@ -21,39 +18,31 @@
<meta property="og:type" content="article">
<meta property="og:description" content="Shows how to customize polling interval for any component via configuration.yaml.">
<meta property="og:image" content="https://home-assistant.io/images/default-social.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@home_assistant">
<meta name="twitter:title" content="Entity component platform options">
<meta name="twitter:description" content="Shows how to customize polling interval for any component via configuration.yaml.">
<meta name="twitter:image" content="https://home-assistant.io/images/default-social.png">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet">
<link href="/atom.xml" rel="alternate" title="Home Assistant" type="application/atom+xml">
<link rel='shortcut icon' href='/images/favicon.ico' />
<link rel='icon' type='image/png' href='/images/favicon-192x192.png' sizes='192x192' />
</head>
<body >
<header>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item three-tenths lap-two-sixths palm-one-whole ha-title">
<a href="/" class="site-title">
<img width='40' src='/demo/favicon-192x192.png'>
<span>Home Assistant</span>
</a>
</div>
<div class="grid__item seven-tenths lap-four-sixths palm-one-whole">
<nav>
<input type="checkbox" id="toggle">
<label for="toggle" class="toggle" data-open="Main Menu" data-close="Close Menu"></label>
<ul class="menu pull-right">
<li><a href="/getting-started/">Getting started</a></li>
<li><a href="/components/">Components</a></li>
<li><a href="/docs/">Docs</a></li>
@ -64,69 +53,41 @@
</ul>
</nav>
</div>
</div>
</div>
</header>
<div class="grid-wrapper">
<div class="grid grid-center">
<div class="grid__item two-thirds lap-one-whole palm-one-whole">
<article class="page">
<div class='edit-github'><a href='https://github.com/home-assistant/home-assistant.github.io/tree/current/source/_docs/configuration/platform_options.markdown'>Edit this page on GitHub</a></div>
<header>
<h1 class="title indent">
Entity Component Platform Options
</h1>
</header>
<hr class="divider">
<p>Any component that is based on the entity component allows various extra options to be set per platform.</p>
<h3><a class="title-link" name="entity-namespace" href="#entity-namespace"></a> Entity namespace</h3>
<p>By setting an entity namespace, all entities will be prefixed with that namespace. That way <code class="highlighter-rouge">light.bathroom</code> can become <code class="highlighter-rouge">light.holiday_house_bathroom</code>.</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<span class="s">light</span><span class="pi">:</span>
<span class="s">platform</span><span class="pi">:</span> <span class="s">hue</span>
<span class="s">entity_namespace</span><span class="pi">:</span> <span class="s">holiday_house</span>
</code></pre>
</div>
<h3><a class="title-link" name="scan-interval" href="#scan-interval"></a> Scan Interval</h3>
<p>Platforms that require polling will be polled in an interval specified by the main component. For example a light will check every 30 seconds for a changed state. It is possible to overwrite this scan interval for any platform that is being polled by specifying a <code class="highlighter-rouge">scan_interval</code> config key. In the example below we setup the Philips Hue lights but tell Home Assistant to poll the devices every 10 seconds instead of the default 30 seconds.</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry to poll Hue lights every 10 seconds.</span>
<span class="s">light</span><span class="pi">:</span>
<span class="s">platform</span><span class="pi">:</span> <span class="s">hue</span>
<span class="s">scan_interval</span><span class="pi">:</span> <span class="s">10</span>
</code></pre>
</div>
</article>
</div>
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">
<div class="grid">
<section class="aside-module grid__item one-whole lap-one-half">
<div class='section'>
<h1 class="title delta">Topics</h1>
@ -313,13 +274,10 @@
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
@ -329,7 +287,6 @@
<a rel="me" href='https://facebook.com/homeassistantio'><i class="icon-facebook"></i></a>
<a rel="me" href='https://plus.google.com/110560654828510104551'><i class="icon-google-plus"></i></a>
<a rel="me" href='https://github.com/home-assistant/home-assistant'><i class="icon-github"></i></a>
<div class="credit">
Contact us at <a href='mailto:hello@home-assistant.io'>hello@home-assistant.io</a>.<br>
Website powered by <a href='http://jekyllrb.com/'>Jekyll</a> and the <a href='https://github.com/coogie/oscailte'>Oscalite theme</a>.<br />
@ -341,7 +298,6 @@
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
@ -349,4 +305,4 @@
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>
</html>

View file

@ -3,17 +3,14 @@
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Remote access - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Setting up remote access for Home Assistant.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/docs/configuration/remote/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Remote access">
<meta property="og:site_name" content="Home Assistant">
@ -21,39 +18,31 @@
<meta property="og:type" content="article">
<meta property="og:description" content="Setting up remote access for Home Assistant.">
<meta property="og:image" content="https://home-assistant.io/images/default-social.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@home_assistant">
<meta name="twitter:title" content="Remote access">
<meta name="twitter:description" content="Setting up remote access for Home Assistant.">
<meta name="twitter:image" content="https://home-assistant.io/images/default-social.png">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet">
<link href="/atom.xml" rel="alternate" title="Home Assistant" type="application/atom+xml">
<link rel='shortcut icon' href='/images/favicon.ico' />
<link rel='icon' type='image/png' href='/images/favicon-192x192.png' sizes='192x192' />
</head>
<body >
<header>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item three-tenths lap-two-sixths palm-one-whole ha-title">
<a href="/" class="site-title">
<img width='40' src='/demo/favicon-192x192.png'>
<span>Home Assistant</span>
</a>
</div>
<div class="grid__item seven-tenths lap-four-sixths palm-one-whole">
<nav>
<input type="checkbox" id="toggle">
<label for="toggle" class="toggle" data-open="Main Menu" data-close="Close Menu"></label>
<ul class="menu pull-right">
<li><a href="/getting-started/">Getting started</a></li>
<li><a href="/components/">Components</a></li>
<li><a href="/docs/">Docs</a></li>
@ -64,58 +53,30 @@
</ul>
</nav>
</div>
</div>
</div>
</header>
<div class="grid-wrapper">
<div class="grid grid-center">
<div class="grid__item two-thirds lap-one-whole palm-one-whole">
<article class="page">
<div class='edit-github'><a href='https://github.com/home-assistant/home-assistant.github.io/tree/current/source/_docs/configuration/remote.markdown'>Edit this page on GitHub</a></div>
<header>
<h1 class="title indent">
Remote Access
</h1>
</header>
<hr class="divider">
<p>If youre interested in logging in to Home Assistant while away, youll have to make your instance remotely accessible.</p>
<p>The most common approach is to set up port forwarding from your router to port 8123 on the computer that is hosting Home Assistant. General instructions on how to do this can be found by searching <code class="highlighter-rouge">&lt;router model&gt; port forwarding instructions</code>.</p>
<p>A problem with making a port accessible is that some Internet Service Providers only offer dynamic IPs. This can cause you to lose access to Home Assistant while away. You can solve this by using a free Dynamic DNS service like <a href="https://www.duckdns.org/">DuckDNS</a>.</p>
<p>Remember: Just putting a port up is not secure. You should definitely consider encrypting your traffic if you are accessing your Home Assistant installation remotely. For details please check the <a href="/blog/2015/12/13/setup-encryption-using-lets-encrypt/">set up encryption using Lets Encrypt</a> blog post.</p>
<p>Protect your communication with a <a href="/cookbook/tls_self_signed_certificate/">self-signed certificate</a> between your client and the Home Assistant instance.</p>
<p>For another way to access your Home Assistant frontend, check out <a href="/cookbook/tor_configuration/">the instructions how to use Tor</a>.</p>
</article>
</div>
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">
<div class="grid">
<section class="aside-module grid__item one-whole lap-one-half">
<div class='section'>
<h1 class="title delta">Topics</h1>
@ -302,13 +263,10 @@
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
@ -318,7 +276,6 @@
<a rel="me" href='https://facebook.com/homeassistantio'><i class="icon-facebook"></i></a>
<a rel="me" href='https://plus.google.com/110560654828510104551'><i class="icon-google-plus"></i></a>
<a rel="me" href='https://github.com/home-assistant/home-assistant'><i class="icon-github"></i></a>
<div class="credit">
Contact us at <a href='mailto:hello@home-assistant.io'>hello@home-assistant.io</a>.<br>
Website powered by <a href='http://jekyllrb.com/'>Jekyll</a> and the <a href='https://github.com/coogie/oscailte'>Oscalite theme</a>.<br />
@ -330,7 +287,6 @@
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
@ -338,4 +294,4 @@
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>
</html>

View file

@ -3,17 +3,14 @@
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Storing secrets - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Storing secrets outside of your configuration.yaml.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/docs/configuration/secrets/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Storing secrets">
<meta property="og:site_name" content="Home Assistant">
@ -21,39 +18,31 @@
<meta property="og:type" content="article">
<meta property="og:description" content="Storing secrets outside of your configuration.yaml.">
<meta property="og:image" content="https://home-assistant.io/images/default-social.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@home_assistant">
<meta name="twitter:title" content="Storing secrets">
<meta name="twitter:description" content="Storing secrets outside of your configuration.yaml.">
<meta name="twitter:image" content="https://home-assistant.io/images/default-social.png">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet">
<link href="/atom.xml" rel="alternate" title="Home Assistant" type="application/atom+xml">
<link rel='shortcut icon' href='/images/favicon.ico' />
<link rel='icon' type='image/png' href='/images/favicon-192x192.png' sizes='192x192' />
</head>
<body >
<header>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item three-tenths lap-two-sixths palm-one-whole ha-title">
<a href="/" class="site-title">
<img width='40' src='/demo/favicon-192x192.png'>
<span>Home Assistant</span>
</a>
</div>
<div class="grid__item seven-tenths lap-four-sixths palm-one-whole">
<nav>
<input type="checkbox" id="toggle">
<label for="toggle" class="toggle" data-open="Main Menu" data-close="Close Menu"></label>
<ul class="menu pull-right">
<li><a href="/getting-started/">Getting started</a></li>
<li><a href="/components/">Components</a></li>
<li><a href="/docs/">Docs</a></li>
@ -64,127 +53,82 @@
</ul>
</nav>
</div>
</div>
</div>
</header>
<div class="grid-wrapper">
<div class="grid grid-center">
<div class="grid__item two-thirds lap-one-whole palm-one-whole">
<article class="page">
<div class='edit-github'><a href='https://github.com/home-assistant/home-assistant.github.io/tree/current/source/_docs/configuration/secrets.markdown'>Edit this page on GitHub</a></div>
<header>
<h1 class="title indent">
Storing Secrets
</h1>
</header>
<hr class="divider">
<p>The <code class="highlighter-rouge">configuration.yaml</code> file is a plain-text file, thus it is readable by anyone who has access to the file. The file contains passwords and API tokens which need to be redacted if you want to share your configuration. By using <code class="highlighter-rouge">!secrets</code> you can remove any private information from you configuration files. This separation can also help you to keep easier track of your passwords and API keys. As they are all stored at one place and no longer spread across the <code class="highlighter-rouge">configuration.yaml</code> file or even multiple yaml files if you <a href="/topics/splitting_configuration/">split up your configuration</a>.</p>
<h3><a class="title-link" name="using-secretsyaml" href="#using-secretsyaml"></a> Using secrets.yaml</h3>
<p>The workflow for moving private information to <code class="highlighter-rouge">secrets.yaml</code> is very similar to the <a href="/topics/splitting_configuration/">splitting of the configuration</a>. Create a <code class="highlighter-rouge">secrets.yaml</code> file in your Home assistant configuration directory (The location of the folder differs between operating systems: on OS X and Linux its <code class="highlighter-rouge">~/.homeassistant</code> and on Windows its <code class="highlighter-rouge">%APPDATA%/.homeassistant</code>).</p>
<p>The entries for password and API keys in the <code class="highlighter-rouge">configuration.yaml</code> file usually looks like the example below.</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">http</span><span class="pi">:</span>
<span class="s">api_password</span><span class="pi">:</span> <span class="s">YOUR_PASSWORD</span>
</code></pre>
</div>
<p>Those entries need to be replaced with <code class="highlighter-rouge">!secret</code> and a identifier.</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">http</span><span class="pi">:</span>
<span class="s">api_password</span><span class="pi">:</span> <span class="kt">!secret</span> <span class="s">http_password</span>
</code></pre>
</div>
<p>The <code class="highlighter-rouge">secrets.yaml</code> file contains the corresponding password assigned to the identifier.</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">http_password</span><span class="pi">:</span> <span class="s">YOUR_PASSWORD</span>
</code></pre>
</div>
<h3><a class="title-link" name="debugging-secrets" href="#debugging-secrets"></a> Debugging secrets</h3>
<p>When you start splitting your configuration into multiple files, you might end up with configuration in sub folders. Secrets will be resolved in this order:</p>
<ul>
<li>A <code class="highlighter-rouge">secrets.yaml</code> located in the same folder as the yaml file referencing the secret,</li>
<li>next, parent folders will be searched for a <code class="highlighter-rouge">secrets.yaml</code> file with the secret, stopping at the folder with the main <code class="highlighter-rouge">configuration.yaml</code>,</li>
<li>lastly, <code class="highlighter-rouge">keyring</code> will be queried for the secret (more info below)</li>
</ul>
<p>To see where secrets are being loaded from you can either add an option to your <code class="highlighter-rouge">secrets.yaml</code> file or use the <code class="highlighter-rouge">check_config</code> script.</p>
<p><em>Option 1</em>: Print where secrets are retrieved from to the Home Assistant log by adding the following to <code class="highlighter-rouge">secrets.yaml</code>:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">logger</span><span class="pi">:</span> <span class="s">debug</span>
</code></pre>
</div>
<p>This will not print the actual secrets value to the log.</p>
<p><em>Option 2</em>: View where secrets are retrieved from and the contents of all <code class="highlighter-rouge">secrets.yaml</code> files used, you can use the <code class="highlighter-rouge">check_config</code> script from the command line:</p>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code>hass --script check_config --secrets
</code></pre>
</div>
<p>This will print all your secrets</p>
<h3><a class="title-link" name="storing-passwords-in-a-keyring-managed-by-your-os" href="#storing-passwords-in-a-keyring-managed-by-your-os"></a> Storing passwords in a keyring managed by your OS</h3>
<p>Using <a href="http://pythonhosted.org/keyring/">Keyring</a> is an alternative way to <code class="highlighter-rouge">secrets.yaml</code>. They can be managed from the command line via the keyring script.</p>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>hass --script keyring --help
</code></pre>
</div>
<p>To store a password in keyring, replace your password or API key with <code class="highlighter-rouge">!secret</code> and an identifier in <code class="highlighter-rouge">configuration.yaml</code> file.</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">http</span><span class="pi">:</span>
<span class="s">api_password</span><span class="pi">:</span> <span class="kt">!secret</span> <span class="s">http_password</span>
</code></pre>
</div>
<p>Create an entry in your keyring.</p>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>hass --script keyring <span class="nb">set </span>http_password
</code></pre>
</div>
<p>If you launch Home Assistant now, you will be prompted for the keyring password to unlock your keyring.</p>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>hass
Config directory: /home/fab/.homeassistant
Please enter password <span class="k">for </span>encrypted keyring:
</code></pre>
</div>
<p class="note warning">
If your are using the Python Keyring, <a href="/getting-started/autostart/">autostarting</a> of Home Assistant will no longer work.
</p>
</article>
</div>
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">
<div class="grid">
<section class="aside-module grid__item one-whole lap-one-half">
<div class='section'>
<h1 class="title delta">Topics</h1>
@ -371,13 +315,10 @@ Please enter password <span class="k">for </span>encrypted keyring:
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
@ -387,7 +328,6 @@ Please enter password <span class="k">for </span>encrypted keyring:
<a rel="me" href='https://facebook.com/homeassistantio'><i class="icon-facebook"></i></a>
<a rel="me" href='https://plus.google.com/110560654828510104551'><i class="icon-google-plus"></i></a>
<a rel="me" href='https://github.com/home-assistant/home-assistant'><i class="icon-github"></i></a>
<div class="credit">
Contact us at <a href='mailto:hello@home-assistant.io'>hello@home-assistant.io</a>.<br>
Website powered by <a href='http://jekyllrb.com/'>Jekyll</a> and the <a href='https://github.com/coogie/oscailte'>Oscalite theme</a>.<br />
@ -399,7 +339,6 @@ Please enter password <span class="k">for </span>encrypted keyring:
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
@ -407,4 +346,4 @@ Please enter password <span class="k">for </span>encrypted keyring:
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>
</html>

View file

@ -3,17 +3,14 @@
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Securing - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Instructions how to secure your Home Assistant installation.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/docs/configuration/securing/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Securing">
<meta property="og:site_name" content="Home Assistant">
@ -21,39 +18,31 @@
<meta property="og:type" content="article">
<meta property="og:description" content="Instructions how to secure your Home Assistant installation.">
<meta property="og:image" content="https://home-assistant.io/images/default-social.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@home_assistant">
<meta name="twitter:title" content="Securing">
<meta name="twitter:description" content="Instructions how to secure your Home Assistant installation.">
<meta name="twitter:image" content="https://home-assistant.io/images/default-social.png">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet">
<link href="/atom.xml" rel="alternate" title="Home Assistant" type="application/atom+xml">
<link rel='shortcut icon' href='/images/favicon.ico' />
<link rel='icon' type='image/png' href='/images/favicon-192x192.png' sizes='192x192' />
</head>
<body >
<header>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item three-tenths lap-two-sixths palm-one-whole ha-title">
<a href="/" class="site-title">
<img width='40' src='/demo/favicon-192x192.png'>
<span>Home Assistant</span>
</a>
</div>
<div class="grid__item seven-tenths lap-four-sixths palm-one-whole">
<nav>
<input type="checkbox" id="toggle">
<label for="toggle" class="toggle" data-open="Main Menu" data-close="Close Menu"></label>
<ul class="menu pull-right">
<li><a href="/getting-started/">Getting started</a></li>
<li><a href="/components/">Components</a></li>
<li><a href="/docs/">Docs</a></li>
@ -64,38 +53,22 @@
</ul>
</nav>
</div>
</div>
</div>
</header>
<div class="grid-wrapper">
<div class="grid grid-center">
<div class="grid__item two-thirds lap-one-whole palm-one-whole">
<article class="page">
<div class='edit-github'><a href='https://github.com/home-assistant/home-assistant.github.io/tree/current/source/_docs/configuration/securing.markdown'>Edit this page on GitHub</a></div>
<header>
<h1 class="title indent">
Securing
</h1>
</header>
<hr class="divider">
<p>One major advantage of Home Assistant is that its not dependent on cloud services. Even if youre only using Home Assistant on a local network, you should take steps to secure your instance.</p>
<h3><a class="title-link" name="checklist" href="#checklist"></a> Checklist</h3>
<ul>
<li><a href="https://home-assistant.io/getting-started/basic/#password-protecting-the-web-interface">Protect your web interface with a password</a></li>
<li>Secure your host. Sources could be <a href="https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/pdf/Security_Guide/Red_Hat_Enterprise_Linux-7-Security_Guide-en-US.pdf">Red Hat Enterprise Linux 7 Security Guide</a>, <a href="https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.0.0.pdf">CIS Red Hat Enterprise Linux 7 Benchmark</a>, or the <a href="https://www.debian.org/doc/manuals/securing-debian-howto/index.en.html">Securing Debian Manual</a>.</li>
@ -103,28 +76,17 @@
<li>Dont run Home Assistant as root consider the Principle of Least Privilege.</li>
<li>Keep your <a href="/topics/secrets/">secrets</a> safe.</li>
</ul>
<p>If you want to allow remote access, consider these additional points:</p>
<ul>
<li>Protect your communication with <a href="/blog/2015/12/13/setup-encryption-using-lets-encrypt/">TLS</a></li>
<li>Protect your communication with <a href="/cookbook/tor_configuration/">Tor</a></li>
<li>Protect your communication with a <a href="/cookbook/tls_self_signed_certificate/">self-signed certificate</a></li>
<li>Use a <a href="/cookbook/apache_configuration/">proxy</a></li>
</ul>
</article>
</div>
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">
<div class="grid">
<section class="aside-module grid__item one-whole lap-one-half">
<div class='section'>
<h1 class="title delta">Topics</h1>
@ -311,13 +273,10 @@
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
@ -327,7 +286,6 @@
<a rel="me" href='https://facebook.com/homeassistantio'><i class="icon-facebook"></i></a>
<a rel="me" href='https://plus.google.com/110560654828510104551'><i class="icon-google-plus"></i></a>
<a rel="me" href='https://github.com/home-assistant/home-assistant'><i class="icon-github"></i></a>
<div class="credit">
Contact us at <a href='mailto:hello@home-assistant.io'>hello@home-assistant.io</a>.<br>
Website powered by <a href='http://jekyllrb.com/'>Jekyll</a> and the <a href='https://github.com/coogie/oscailte'>Oscalite theme</a>.<br />
@ -339,7 +297,6 @@
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
@ -347,4 +304,4 @@
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>
</html>

View file

@ -3,17 +3,14 @@
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Splitting up the configuration - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Splitting the configuration.yaml into several files.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/docs/configuration/splitting_configuration/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Splitting up the configuration">
<meta property="og:site_name" content="Home Assistant">
@ -21,39 +18,31 @@
<meta property="og:type" content="article">
<meta property="og:description" content="Splitting the configuration.yaml into several files.">
<meta property="og:image" content="https://home-assistant.io/images/default-social.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@home_assistant">
<meta name="twitter:title" content="Splitting up the configuration">
<meta name="twitter:description" content="Splitting the configuration.yaml into several files.">
<meta name="twitter:image" content="https://home-assistant.io/images/default-social.png">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet">
<link href="/atom.xml" rel="alternate" title="Home Assistant" type="application/atom+xml">
<link rel='shortcut icon' href='/images/favicon.ico' />
<link rel='icon' type='image/png' href='/images/favicon-192x192.png' sizes='192x192' />
</head>
<body >
<header>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item three-tenths lap-two-sixths palm-one-whole ha-title">
<a href="/" class="site-title">
<img width='40' src='/demo/favicon-192x192.png'>
<span>Home Assistant</span>
</a>
</div>
<div class="grid__item seven-tenths lap-four-sixths palm-one-whole">
<nav>
<input type="checkbox" id="toggle">
<label for="toggle" class="toggle" data-open="Main Menu" data-close="Close Menu"></label>
<ul class="menu pull-right">
<li><a href="/getting-started/">Getting started</a></li>
<li><a href="/components/">Components</a></li>
<li><a href="/docs/">Docs</a></li>
@ -64,44 +53,25 @@
</ul>
</nav>
</div>
</div>
</div>
</header>
<div class="grid-wrapper">
<div class="grid grid-center">
<div class="grid__item two-thirds lap-one-whole palm-one-whole">
<article class="page">
<div class='edit-github'><a href='https://github.com/home-assistant/home-assistant.github.io/tree/current/source/_docs/configuration/splitting_configuration.markdown'>Edit this page on GitHub</a></div>
<header>
<h1 class="title indent">
Splitting Up the Configuration
</h1>
</header>
<hr class="divider">
<p>So youve been using Home Assistant for a while now and your <a href="https://home-assistant.io/cookbook/configuration_yaml_from_bassclarinetl2/">configuration.yaml file brings people to tears</a> or you simply want to start off with the distributed approach, heres how to “split the configuration.yaml” into more manageable (read: humanly readable) pieces.</p>
<p>First off, several community members have sanitized (read: without api keys/passwords etc) versions of their configurations available for viewing, you can see a list of them <a href="https://home-assistant.io/cookbook/#example-configurationyaml">here</a>.</p>
<p>As commenting code doesnt always happen, please read on for the details.</p>
<p>Now despite the logical assumption that the <code class="highlighter-rouge">configuration.yaml</code> will be replaced by this process it will in fact remain, albeit in a much less cluttered form.</p>
<p>In this lighter version we will still need what could be called the core snippet:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">homeassistant</span><span class="pi">:</span>
<span class="c1"># Name of the location where Home Assistant is running</span>
<span class="s">name</span><span class="pi">:</span> <span class="s">My Home Assistant Instance</span>
@ -115,13 +85,9 @@
<span class="s">customize</span><span class="pi">:</span> <span class="kt">!include</span> <span class="s">customize.yaml</span>
</code></pre>
</div>
<p>Note that each line after <code class="highlighter-rouge">homeassistant:</code> is indented two (2) spaces. Since the configuration files in Home Assistant are based on the YAML language, indentation and spacing are important. Also note that seemingly strange entry under <code class="highlighter-rouge">customize:</code>.</p>
<p><code class="highlighter-rouge">!include filename.yaml</code> is the statement that tells Home Assistant to insert the contents of <code class="highlighter-rouge">filename.yaml</code> at that point. This is how we are going to break a monolithic and hard to read file (when it gets big) into more manageable chunks.</p>
<p>Now before we start splitting out the different components, lets look at the other components (in our example) that will stay in the base file:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">history</span><span class="pi">:</span>
<span class="s">frontend</span><span class="pi">:</span>
<span class="s">logbook</span><span class="pi">:</span>
@ -145,11 +111,8 @@
</code></pre>
</div>
<p>As with the core snippet, indentation makes a difference. The component headers (<code class="highlighter-rouge">mqtt:</code>) should be fully left aligned (aka no indent), and the parameters (<code class="highlighter-rouge">broker:</code>) should be indented two (2) spaces.</p>
<p>While some of these components can technically be moved to a separate file they are so small or “one offs” where splitting them off is superfluous. Also, youll notice the # symbol (hash/pound). This represents a “comment” as far as the commands are interpreted. Put another way, any line prefixed with a <code class="highlighter-rouge">#</code> will be ignored. This makes breaking up files for human readability really convenient, not to mention turning off features while leaving the entry intact. (Look at the <code class="highlighter-rouge">zigbee:</code> entry above and the b entry further down)</p>
<p>Now, lets assume that a blank file has been created in the Home Assistant configuration directory for each of the following:</p>
<div class="language-text highlighter-rouge"><pre class="highlight"><code>automation.yaml
zones.yaml
sensors.yaml
@ -158,11 +121,8 @@ device_tracker.yaml
customize.yaml
</code></pre>
</div>
<p><code class="highlighter-rouge">automation.yaml</code> will hold all the automation component details. <code class="highlighter-rouge">zones.yaml</code> will hold the zone component details and so forth. These files can be called anything but giving them names that match their function will make things easier to keep track of.</p>
<p>Inside the base configuration file add the following entries:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">automation</span><span class="pi">:</span> <span class="kt">!include</span> <span class="s">automation.yaml</span>
<span class="s">zone</span><span class="pi">:</span> <span class="kt">!include</span> <span class="s">zones.yaml</span>
<span class="s">sensor</span><span class="pi">:</span> <span class="kt">!include</span> <span class="s">sensors.yaml</span>
@ -170,13 +130,9 @@ customize.yaml
<span class="s">device_tracker</span><span class="pi">:</span> <span class="kt">!include</span> <span class="s">device_tracker.yaml</span>
</code></pre>
</div>
<p>Note that there can only be one <code class="highlighter-rouge">!include:</code> for each component so chaining them isnt going to work. If that sounds like greek, dont worry about it.</p>
<p>Alright, so weve got the single components and the include statements in the base file, what goes in those extra files?</p>
<p>Lets look at the <code class="highlighter-rouge">device_tracker.yaml</code> file from our example:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">owntracks</span>
<span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">nmap_tracker</span>
<span class="s">hosts</span><span class="pi">:</span> <span class="s">192.168.2.0/24</span>
@ -187,11 +143,8 @@ customize.yaml
<span class="s">consider_home</span><span class="pi">:</span> <span class="s">120</span>
</code></pre>
</div>
<p>This small example illustrates how the “split” files work. In this case, we start with a “comment block” identifying the file followed by two (2) device tracker entries (<code class="highlighter-rouge">owntracks</code> and <code class="highlighter-rouge">nmap</code>). These files follow <a href="/getting-started/devices/#style-2-list-each-device-separately">“style 1”</a> that is to say a fully left aligned leading entry (<code class="highlighter-rouge">- platform: owntracks</code>) followed by the parameter entries indented two (2) spaces.</p>
<p>This (large) sensor configuration gives us another example:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1">### sensors.yaml</span>
<span class="c1">### METEOBRIDGE #############################################</span>
<span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">tcp</span>
@ -229,26 +182,18 @@ customize.yaml
<span class="s">name</span><span class="pi">:</span> <span class="s1">'</span><span class="s">Ann</span><span class="nv"> </span><span class="s">Arbor'</span>
</code></pre>
</div>
<p>Youll notice that this example includes a secondary parameter section (under the steam section) as well as a better example of the way comments can be used to break down files into sections.</p>
<p>That about wraps it up.</p>
<p>If you have issues checkout <code class="highlighter-rouge">home-assistant.log</code> in the configuration directory as well as your indentations. If all else fails, head over to the <a href="https://gitter.im/balloob/home-assistant">Gitter Chatroom</a> and ask away.</p>
<h3><a class="title-link" name="debugging-multiple-configuration-files" href="#debugging-multiple-configuration-files"></a> Debugging multiple configuration files</h3>
<p>If you have many configuration files, the <code class="highlighter-rouge">check_config</code> script allows you to see how Home Assistant interprets them:</p>
<ul>
<li>Listing all loaded files: <code class="highlighter-rouge">hass --script check_config --files</code></li>
<li>Viewing a components config: <code class="highlighter-rouge">hass --script check_config --info light</code></li>
<li>Or all components config: <code class="highlighter-rouge">hass --script check_config --info all</code></li>
</ul>
<p>You can get help from the command line using: <code class="highlighter-rouge">hass --script check_config --help</code></p>
<h3><a class="title-link" name="advanced-usage" href="#advanced-usage"></a> Advanced Usage</h3>
<p>We offer four advanced options to include whole directories at once.</p>
<ul>
<li><code class="highlighter-rouge">!include_dir_list</code> will return the content of a directory as a list with each file content being an entry in the list.</li>
@ -256,9 +201,7 @@ customize.yaml
<li><code class="highlighter-rouge">!include_dir_merge_list</code> will return the content of a directory as a list by merging all files (which should contain a list) into 1 big list.</li>
<li><code class="highlighter-rouge">!include_dir_merge_named</code> will return the content of a directory as a dictionary by loading each file and merging it into 1 big dictionary.</li>
</ul>
<p>These work recursively. As an example using <code class="highlighter-rouge">!include_dir_* automation</code>, will include all 6 files shown below:</p>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code>.
└── .homeassistant
├── automation
@ -273,11 +216,8 @@ customize.yaml
└── configuration.yaml <span class="o">(</span>not included<span class="o">)</span>
</code></pre>
</div>
<h4><a class="title-link" name="example-include_dir_list" href="#example-include_dir_list"></a> Example: <code class="highlighter-rouge">!include_dir_list</code></h4>
<p><code class="highlighter-rouge">configuration.yaml</code></p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">automation</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Automation 1</span>
<span class="s">trigger</span><span class="pi">:</span>
@ -297,17 +237,12 @@ customize.yaml
<span class="s">entity_id</span><span class="pi">:</span> <span class="s">light.entryway</span>
</code></pre>
</div>
<p>can be turned into:</p>
<p><code class="highlighter-rouge">configuration.yaml</code></p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">automation</span><span class="pi">:</span> <span class="kt">!include_dir_list</span> <span class="s">automation/presence/</span>
</code></pre>
</div>
<p><code class="highlighter-rouge">automation/presence/automation1.yaml</code></p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">alias</span><span class="pi">:</span> <span class="s">Automation 1</span>
<span class="s">trigger</span><span class="pi">:</span>
<span class="s">platform</span><span class="pi">:</span> <span class="s">state</span>
@ -318,9 +253,7 @@ customize.yaml
<span class="s">entity_id</span><span class="pi">:</span> <span class="s">light.entryway</span>
</code></pre>
</div>
<p><code class="highlighter-rouge">automation/presence/automation2.yaml</code></p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">alias</span><span class="pi">:</span> <span class="s">Automation 2</span>
<span class="s">trigger</span><span class="pi">:</span>
<span class="s">platform</span><span class="pi">:</span> <span class="s">state</span>
@ -331,13 +264,9 @@ customize.yaml
<span class="s">entity_id</span><span class="pi">:</span> <span class="s">light.entryway</span>
</code></pre>
</div>
<p>It is important to note that each file must contain only <strong>one</strong> entry when using <code class="highlighter-rouge">!include_dir_list</code>.</p>
<h4><a class="title-link" name="example-include_dir_named" href="#example-include_dir_named"></a> Example: <code class="highlighter-rouge">!include_dir_named</code></h4>
<p><code class="highlighter-rouge">configuration.yaml</code></p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code>
<span class="s">alexa</span><span class="pi">:</span>
<span class="s">intents</span><span class="pi">:</span>
@ -367,18 +296,13 @@ customize.yaml
<span class="no">{% endif %}</span>
</code></pre>
</div>
<p>can be turned into:</p>
<p><code class="highlighter-rouge">configuration.yaml</code></p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">alexa</span><span class="pi">:</span>
<span class="s">intents</span><span class="pi">:</span> <span class="kt">!include_dir_named</span> <span class="s">alexa/</span>
</code></pre>
</div>
<p><code class="highlighter-rouge">alexa/LocateIntent.yaml</code></p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code>
<span class="s">action</span><span class="pi">:</span>
<span class="s">service</span><span class="pi">:</span> <span class="s">notify.pushover</span>
@ -396,9 +320,7 @@ customize.yaml
<span class="no">{%- endfor -%}</span>
</code></pre>
</div>
<p><code class="highlighter-rouge">alexa/WhereAreWeIntent.yaml</code></p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code>
<span class="s">speech</span><span class="pi">:</span>
<span class="s">type</span><span class="pi">:</span> <span class="s">plaintext</span>
@ -410,11 +332,8 @@ customize.yaml
<span class="no">{% endif %}</span>
</code></pre>
</div>
<h4><a class="title-link" name="example-include_dir_merge_list" href="#example-include_dir_merge_list"></a> Example: <code class="highlighter-rouge">!include_dir_merge_list</code></h4>
<p><code class="highlighter-rouge">configuration.yaml</code></p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">automation</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Automation 1</span>
<span class="s">trigger</span><span class="pi">:</span>
@ -434,17 +353,12 @@ customize.yaml
<span class="s">entity_id</span><span class="pi">:</span> <span class="s">light.entryway</span>
</code></pre>
</div>
<p>can be turned into:</p>
<p><code class="highlighter-rouge">configuration.yaml</code></p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">automation</span><span class="pi">:</span> <span class="kt">!include_dir_merge_list</span> <span class="s">automation/</span>
</code></pre>
</div>
<p><code class="highlighter-rouge">automation/presence.yaml</code></p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Automation 1</span>
<span class="s">trigger</span><span class="pi">:</span>
<span class="s">platform</span><span class="pi">:</span> <span class="s">state</span>
@ -463,13 +377,9 @@ customize.yaml
<span class="s">entity_id</span><span class="pi">:</span> <span class="s">light.entryway</span>
</code></pre>
</div>
<p>It is important to note that when using <code class="highlighter-rouge">!include_dir_merge_list</code>, you must include a list in each file (each list item is denoted with a hyphen [-]). Each file may contain one or more entries.</p>
<h4><a class="title-link" name="example-include_dir_merge_named" href="#example-include_dir_merge_named"></a> Example: <code class="highlighter-rouge">!include_dir_merge_named</code></h4>
<p><code class="highlighter-rouge">configuration.yaml</code></p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">group</span><span class="pi">:</span>
<span class="s">bedroom</span><span class="pi">:</span>
<span class="s">name</span><span class="pi">:</span> <span class="s">Bedroom</span>
@ -491,17 +401,12 @@ customize.yaml
<span class="pi">-</span> <span class="s">camera.front_porch</span>
</code></pre>
</div>
<p>can be turned into:</p>
<p><code class="highlighter-rouge">configuration.yaml</code></p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">group</span><span class="pi">:</span> <span class="kt">!include_dir_merge_named</span> <span class="s">group/</span>
</code></pre>
</div>
<p><code class="highlighter-rouge">group/interior.yaml</code></p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">bedroom</span><span class="pi">:</span>
<span class="s">name</span><span class="pi">:</span> <span class="s">Bedroom</span>
<span class="s">entities</span><span class="pi">:</span>
@ -514,9 +419,7 @@ customize.yaml
<span class="pi">-</span> <span class="s">thermostat.home</span>
</code></pre>
</div>
<p><code class="highlighter-rouge">group/exterior.yaml</code></p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">front_yard</span><span class="pi">:</span>
<span class="s">name</span><span class="pi">:</span> <span class="s">Front Yard</span>
<span class="s">entities</span><span class="pi">:</span>
@ -527,18 +430,10 @@ customize.yaml
<span class="pi">-</span> <span class="s">camera.front_porch</span>
</code></pre>
</div>
</article>
</div>
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">
<div class="grid">
<section class="aside-module grid__item one-whole lap-one-half">
<div class='section'>
<h1 class="title delta">Topics</h1>
@ -725,13 +620,10 @@ customize.yaml
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
@ -741,7 +633,6 @@ customize.yaml
<a rel="me" href='https://facebook.com/homeassistantio'><i class="icon-facebook"></i></a>
<a rel="me" href='https://plus.google.com/110560654828510104551'><i class="icon-google-plus"></i></a>
<a rel="me" href='https://github.com/home-assistant/home-assistant'><i class="icon-github"></i></a>
<div class="credit">
Contact us at <a href='mailto:hello@home-assistant.io'>hello@home-assistant.io</a>.<br>
Website powered by <a href='http://jekyllrb.com/'>Jekyll</a> and the <a href='https://github.com/coogie/oscailte'>Oscalite theme</a>.<br />
@ -753,7 +644,6 @@ customize.yaml
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
@ -761,4 +651,4 @@ customize.yaml
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>
</html>

View file

@ -3,17 +3,14 @@
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>State Objects - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Describes all there is to know about state objects in Home Assistant.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/docs/configuration/state_object/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="State Objects">
<meta property="og:site_name" content="Home Assistant">
@ -21,39 +18,31 @@
<meta property="og:type" content="article">
<meta property="og:description" content="Describes all there is to know about state objects in Home Assistant.">
<meta property="og:image" content="https://home-assistant.io/images/default-social.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@home_assistant">
<meta name="twitter:title" content="State Objects">
<meta name="twitter:description" content="Describes all there is to know about state objects in Home Assistant.">
<meta name="twitter:image" content="https://home-assistant.io/images/default-social.png">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet">
<link href="/atom.xml" rel="alternate" title="Home Assistant" type="application/atom+xml">
<link rel='shortcut icon' href='/images/favicon.ico' />
<link rel='icon' type='image/png' href='/images/favicon-192x192.png' sizes='192x192' />
</head>
<body >
<header>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item three-tenths lap-two-sixths palm-one-whole ha-title">
<a href="/" class="site-title">
<img width='40' src='/demo/favicon-192x192.png'>
<span>Home Assistant</span>
</a>
</div>
<div class="grid__item seven-tenths lap-four-sixths palm-one-whole">
<nav>
<input type="checkbox" id="toggle">
<label for="toggle" class="toggle" data-open="Main Menu" data-close="Close Menu"></label>
<ul class="menu pull-right">
<li><a href="/getting-started/">Getting started</a></li>
<li><a href="/components/">Components</a></li>
<li><a href="/docs/">Docs</a></li>
@ -64,40 +53,23 @@
</ul>
</nav>
</div>
</div>
</div>
</header>
<div class="grid-wrapper">
<div class="grid grid-center">
<div class="grid__item two-thirds lap-one-whole palm-one-whole">
<article class="page">
<div class='edit-github'><a href='https://github.com/home-assistant/home-assistant.github.io/tree/current/source/_docs/configuration/state_object.markdown'>Edit this page on GitHub</a></div>
<header>
<h1 class="title indent">
State Objects
</h1>
</header>
<hr class="divider">
<p>Your devices are represented in Home Assistant as entities. The entities will write their current state to the state machine for other entities/templates/frontend to access. States are a current representation of the entity.</p>
<p>If you overwrite a state via the states dev tool or the API, it will not impact the actual device. If the device state is being polled, it will overwrite the state in the state machine the next polling.</p>
<p>All states will always have an entity id, a state and a timestamp when last updated and last changed.</p>
<table>
<thead>
<tr>
@ -140,11 +112,8 @@
</tr>
</tbody>
</table>
<p>The attributes of an entity are optional. There are a few attributes that are used by Home Assistant for representing the entity in a specific way. Each component will also have its own attributes to represent extra state data about the entity. For example, the light component has attributes for the current brightness and color of the light. When an attribute is not available, Home Assistant will not write it to the state.</p>
<p>When using templates, attributes will be available by their name. For example <code class="highlighter-rouge">state.attributes.assumed_state</code>.</p>
<table>
<thead>
<tr>
@ -179,20 +148,11 @@
</tr>
</tbody>
</table>
<p>When an attribute contains spaces, you can retrieve it like this: <code class="highlighter-rouge">states.sensor.livingroom.attributes["Battery numeric"]</code>.</p>
</article>
</div>
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">
<div class="grid">
<section class="aside-module grid__item one-whole lap-one-half">
<div class='section'>
<h1 class="title delta">Topics</h1>
@ -379,13 +339,10 @@
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
@ -395,7 +352,6 @@
<a rel="me" href='https://facebook.com/homeassistantio'><i class="icon-facebook"></i></a>
<a rel="me" href='https://plus.google.com/110560654828510104551'><i class="icon-google-plus"></i></a>
<a rel="me" href='https://github.com/home-assistant/home-assistant'><i class="icon-github"></i></a>
<div class="credit">
Contact us at <a href='mailto:hello@home-assistant.io'>hello@home-assistant.io</a>.<br>
Website powered by <a href='http://jekyllrb.com/'>Jekyll</a> and the <a href='https://github.com/coogie/oscailte'>Oscalite theme</a>.<br />
@ -407,7 +363,6 @@
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
@ -415,4 +370,4 @@
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>
</html>

View file

@ -3,17 +3,14 @@
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Templating - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Instructions how to use the templating feature of Home Assistant.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/docs/configuration/templating/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Templating">
<meta property="og:site_name" content="Home Assistant">
@ -21,39 +18,31 @@
<meta property="og:type" content="article">
<meta property="og:description" content="Instructions how to use the templating feature of Home Assistant.">
<meta property="og:image" content="https://home-assistant.io/images/default-social.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@home_assistant">
<meta name="twitter:title" content="Templating">
<meta name="twitter:description" content="Instructions how to use the templating feature of Home Assistant.">
<meta name="twitter:image" content="https://home-assistant.io/images/default-social.png">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet">
<link href="/atom.xml" rel="alternate" title="Home Assistant" type="application/atom+xml">
<link rel='shortcut icon' href='/images/favicon.ico' />
<link rel='icon' type='image/png' href='/images/favicon-192x192.png' sizes='192x192' />
</head>
<body >
<header>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item three-tenths lap-two-sixths palm-one-whole ha-title">
<a href="/" class="site-title">
<img width='40' src='/demo/favicon-192x192.png'>
<span>Home Assistant</span>
</a>
</div>
<div class="grid__item seven-tenths lap-four-sixths palm-one-whole">
<nav>
<input type="checkbox" id="toggle">
<label for="toggle" class="toggle" data-open="Main Menu" data-close="Close Menu"></label>
<ul class="menu pull-right">
<li><a href="/getting-started/">Getting started</a></li>
<li><a href="/components/">Components</a></li>
<li><a href="/docs/">Docs</a></li>
@ -64,59 +53,37 @@
</ul>
</nav>
</div>
</div>
</div>
</header>
<div class="grid-wrapper">
<div class="grid grid-center">
<div class="grid__item two-thirds lap-one-whole palm-one-whole">
<article class="page">
<div class='edit-github'><a href='https://github.com/home-assistant/home-assistant.github.io/tree/current/source/_docs/configuration/templating.markdown'>Edit this page on GitHub</a></div>
<header>
<h1 class="title indent">
Templating
</h1>
</header>
<hr class="divider">
<p>This is an advanced feature of Home Assistant. Youll need a basic understanding of the following things:</p>
<ul>
<li><a href="/developers/architecture/">Home Assistant architecture</a>, especially states.</li>
<li><a href="/topics/state_object/">State object</a></li>
</ul>
<p>Templating is a powerful feature in Home Assistant that allows the user control over information that is going into and out of the system. It is used for:</p>
<ul>
<li>Formatting outgoing messages in, for example, the <a href="/components/notify/">notify</a> and <a href="/components/alexa/">alexa</a> components.</li>
<li>Process incoming data from sources that provide raw data, like <a href="/components/mqtt/">MQTT</a>, <a href="/components/sensor.rest/">REST sensor</a>, or the <a href="/components/sensor.command_line/">command line sensor</a>.</li>
<li>[Advanced Automation templating]auto-template]</li>
</ul>
<h2><a class="title-link" name="building-templates" href="#building-templates"></a> Building templates</h2>
<p>Templating in Home Assistant is powered by the <a href="http://jinja.pocoo.org/">Jinja2</a> templating engine. This means that we are using their syntax and make some custom Home Assistant variables available to templates during rendering. We will not go over the basics of the syntax, as Jinja2 does a lot better job at this in their <a href="http://jinja.pocoo.org/docs/dev/templates/">Jinja2 documentation</a>.</p>
<p class="note">
The frontend has a template editor developer tool to help develop and debug templates.
</p>
<p>Templates can get big pretty fast. To keep a clear overview, consider using YAML multiline strings to define your templates:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">script</span><span class="pi">:</span>
<span class="s">msg_who_is_home</span><span class="pi">:</span>
<span class="s">sequence</span><span class="pi">:</span>
@ -129,19 +96,14 @@ The frontend has a template editor developer tool to help develop and debug temp
<span class="no">{% endif %}</span>
</code></pre>
</div>
<p><a href="http://jinja.pocoo.org/">Jinja2</a> supports a width variety of operations:</p>
<ul>
<li><a href="http://jinja.pocoo.org/docs/dev/templates/#math">Mathematical operation</a></li>
<li><a href="http://jinja.pocoo.org/docs/dev/templates/#comparisons">Comparisons</a></li>
<li><a href="http://jinja.pocoo.org/docs/dev/templates/#logic">Logic</a></li>
</ul>
<h2><a class="title-link" name="home-assistant-template-extensions" href="#home-assistant-template-extensions"></a> Home Assistant template extensions</h2>
<p>Home Assistant adds extensions to allow templates to access all of the current states:</p>
<ul>
<li>Iterating <code class="highlighter-rouge">states</code> will yield each state sorted alphabetically by entity ID.</li>
<li>Iterating <code class="highlighter-rouge">states.domain</code> will yield each state of that domain sorted alphabetically by entity ID.</li>
@ -164,21 +126,15 @@ The frontend has a template editor developer tool to help develop and debug temp
<li>Filter <code class="highlighter-rouge">max</code> will obtain the larget item in a sequence.</li>
<li>Filter <code class="highlighter-rouge">min</code> will obtain the smallest item in a sequence.</li>
</ul>
<h2><a class="title-link" name="examples" href="#examples"></a> Examples</h2>
<h3><a class="title-link" name="states" href="#states"></a> States</h3>
<p>The next two statements result in same value if state exists. The second one will result in an error if state does not exist.</p>
<div class="language-text highlighter-rouge"><pre class="highlight"><code>{{ states('device_tracker.paulus') }}
{{ states.device_tracker.paulus.state }}
</code></pre>
</div>
<h3><a class="title-link" name="attributes" href="#attributes"></a> Attributes</h3>
<p>Print an attribute if state is defined</p>
<div class="language-text highlighter-rouge"><pre class="highlight"><code>{% if states.device_tracker.paulus %}
{{ states.device_tracker.paulus.attributes.battery }}
{% else %}
@ -186,11 +142,8 @@ The frontend has a template editor developer tool to help develop and debug temp
{% endif %}
</code></pre>
</div>
<h3><a class="title-link" name="sensor-states" href="#sensor-states"></a> Sensor states</h3>
<p>Print out a list of all the sensor states.</p>
<div class="language-text highlighter-rouge"><pre class="highlight"><code>{% for state in states.sensor %}
{{ state.entity_id }}={{ state.state }},
{% endfor %}
@ -214,11 +167,8 @@ The frontend has a template editor developer tool to help develop and debug temp
{{ as_timestamp(now()) - as_timestamp(states.binary_sensor.garage_door.last_changed) }}
</code></pre>
</div>
<h3><a class="title-link" name="distance-examples" href="#distance-examples"></a> Distance examples</h3>
<p>If only 1 location is passed in, Home Assistant will measure the distance from home.</p>
<div class="language-text highlighter-rouge"><pre class="highlight"><code>Using Lat Lng coordinates: {{ distance(123.45, 123.45) }}
Using State: {{ distance(states.device_tracker.paulus) }}
@ -228,39 +178,28 @@ These can also be combined in any combination:
{{ distance('device_tracker.anne_therese', 'device_tracker.paulus') }}
</code></pre>
</div>
<h3><a class="title-link" name="closest-examples" href="#closest-examples"></a> Closest examples</h3>
<p>Find entities closest to the Home Assistant location:</p>
<div class="language-text highlighter-rouge"><pre class="highlight"><code>Query all entities: {{ closest(states) }}
Query all entities of a specific domain: {{ closest('states.device_tracker') }}
Query all entities in group.children: {{ closest('group.children') }}
Query all entities in group.children: {{ closest(states.group.children) }}
</code></pre>
</div>
<p>Find entities closest to a coordinate or another entity. All previous arguments still apply for 2nd argument.</p>
<div class="language-text highlighter-rouge"><pre class="highlight"><code>Closest to a coordinate: {{ closest(23.456, 23.456, 'group.children') }}
Closest to an entity: {{ closest('zone.school', 'group.children') }}
Closest to an entity: {{ closest(states.zone.school, 'group.children') }}
</code></pre>
</div>
<h3><a class="title-link" name="combined" href="#combined"></a> Combined</h3>
<p>Since closest returns a state, we can combine it with distance too.</p>
<div class="language-text highlighter-rouge"><pre class="highlight"><code>{{ closest(states).name }} is {{ distance(closest(states)) }} meters away.
</code></pre>
</div>
<h2><a class="title-link" name="processing-incoming-data" href="#processing-incoming-data"></a> Processing incoming data</h2>
<p>The other part of templating is processing incoming data. It will allow you to modify incoming data and extract only the data you care about. This will work only for platforms and components that mentioned support for this in their documentation.</p>
<p>It depends per component or platform, but it is common to be able to define a template using the <code class="highlighter-rouge">value_template</code> configuration key. When a new value arrives, your template will be rendered while having access to the following values on top of the usual Home Assistant extensions:</p>
<table>
<thead>
<tr>
@ -279,7 +218,6 @@ Closest to an entity: {{ closest(states.zone.school, 'group.children') }}
</tr>
</tbody>
</table>
<div class="language-text highlighter-rouge"><pre class="highlight"><code># Incoming value:
{"primes": [2, 3, 5, 7, 11, 13]}
@ -302,18 +240,10 @@ Closest to an entity: {{ closest(states.zone.school, 'group.children') }}
{{ value_json["001"] }}
</code></pre>
</div>
</article>
</div>
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">
<div class="grid">
<section class="aside-module grid__item one-whole lap-one-half">
<div class='section'>
<h1 class="title delta">Topics</h1>
@ -500,13 +430,10 @@ Closest to an entity: {{ closest(states.zone.school, 'group.children') }}
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
@ -516,7 +443,6 @@ Closest to an entity: {{ closest(states.zone.school, 'group.children') }}
<a rel="me" href='https://facebook.com/homeassistantio'><i class="icon-facebook"></i></a>
<a rel="me" href='https://plus.google.com/110560654828510104551'><i class="icon-google-plus"></i></a>
<a rel="me" href='https://github.com/home-assistant/home-assistant'><i class="icon-github"></i></a>
<div class="credit">
Contact us at <a href='mailto:hello@home-assistant.io'>hello@home-assistant.io</a>.<br>
Website powered by <a href='http://jekyllrb.com/'>Jekyll</a> and the <a href='https://github.com/coogie/oscailte'>Oscalite theme</a>.<br />
@ -528,7 +454,6 @@ Closest to an entity: {{ closest(states.zone.school, 'group.children') }}
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
@ -536,4 +461,4 @@ Closest to an entity: {{ closest(states.zone.school, 'group.children') }}
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>
</html>

View file

@ -3,17 +3,14 @@
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Troubleshooting your configuration - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Common problems with tweaking your configuration and their solutions.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/docs/configuration/troubleshooting/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Troubleshooting your configuration">
<meta property="og:site_name" content="Home Assistant">
@ -21,39 +18,31 @@
<meta property="og:type" content="article">
<meta property="og:description" content="Common problems with tweaking your configuration and their solutions.">
<meta property="og:image" content="https://home-assistant.io/images/default-social.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@home_assistant">
<meta name="twitter:title" content="Troubleshooting your configuration">
<meta name="twitter:description" content="Common problems with tweaking your configuration and their solutions.">
<meta name="twitter:image" content="https://home-assistant.io/images/default-social.png">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet">
<link href="/atom.xml" rel="alternate" title="Home Assistant" type="application/atom+xml">
<link rel='shortcut icon' href='/images/favicon.ico' />
<link rel='icon' type='image/png' href='/images/favicon-192x192.png' sizes='192x192' />
</head>
<body >
<header>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item three-tenths lap-two-sixths palm-one-whole ha-title">
<a href="/" class="site-title">
<img width='40' src='/demo/favicon-192x192.png'>
<span>Home Assistant</span>
</a>
</div>
<div class="grid__item seven-tenths lap-four-sixths palm-one-whole">
<nav>
<input type="checkbox" id="toggle">
<label for="toggle" class="toggle" data-open="Main Menu" data-close="Close Menu"></label>
<ul class="menu pull-right">
<li><a href="/getting-started/">Getting started</a></li>
<li><a href="/components/">Components</a></li>
<li><a href="/docs/">Docs</a></li>
@ -64,58 +53,34 @@
</ul>
</nav>
</div>
</div>
</div>
</header>
<div class="grid-wrapper">
<div class="grid grid-center">
<div class="grid__item two-thirds lap-one-whole palm-one-whole">
<article class="page">
<div class='edit-github'><a href='https://github.com/home-assistant/home-assistant.github.io/tree/current/source/_docs/configuration/troubleshooting.markdown'>Edit this page on GitHub</a></div>
<header>
<h1 class="title indent">
Troubleshooting Your Configuration
</h1>
</header>
<hr class="divider">
<p>It can happen that you run into trouble while configuring Home Assistant. Perhaps a component is not showing up or is acting strangely. This page will discuss a few of the most common problems.</p>
<p>Before we dive into common issues, make sure you know where your configuration directory is. Home Assistant will print out the configuration directory it is using when starting up.</p>
<p>Whenever a component or configuration option results in a warning, it will be stored in <code class="highlighter-rouge">home-assistant.log</code> in the configuration directory. This file is reset on start of Home Assistant.</p>
<h3><a class="title-link" name="my-component-does-not-show-up" href="#my-component-does-not-show-up"></a> My component does not show up</h3>
<p>When a component does not show up, many different things can be the case. Before you try any of these steps, make sure to look at the <code class="highlighter-rouge">home-assistant.log</code> file and see if there are any errors related to your component you are trying to set up.</p>
<p>If you have incorrect entries in your configuration files you can use the <code class="highlighter-rouge">check_config</code> script to assist in identifying them: <code class="highlighter-rouge">hass --script check_config</code>.</p>
<h4><a class="title-link" name="problems-with-the-configuration" href="#problems-with-the-configuration"></a> Problems with the configuration</h4>
<p>One of the most common problems with Home Assistant is an invalid <code class="highlighter-rouge">configuration.yaml</code> file.</p>
<ul>
<li>You can test your configuration using the command line with: <code class="highlighter-rouge">hass --script check_config</code></li>
<li>You can verify your configurations yaml structure using <a href="http://yaml-online-parser.appspot.com/">this online YAML parser</a> or <a href="http://www.yamllint.com/">YAML Lint</a>.</li>
<li>To learn more about the quirks of YAML, read <a href="https://docs.saltstack.com/en/latest/topics/troubleshooting/yaml_idiosyncrasies.html">YAML IDIOSYNCRASIES</a> by SaltStack (the examples there are specific to SaltStack, but do explain YAML issues well).</li>
</ul>
<p><code class="highlighter-rouge">configuration.yaml</code> does not allow multiple sections to have the same name. If you want to load multiple platforms for one component, you can append a <a href="/getting-started/devices/#style-2-list-each-device-separately">number or string</a> to the name or nest them using <a href="/getting-started/devices/#style-1-collect-every-entity-under-the-parent">this style</a>:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">sensor</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">forecast</span>
<span class="s">...</span>
@ -123,41 +88,27 @@
<span class="s">...</span>
</code></pre>
</div>
<p>Another common problem is that a required configuration setting is missing. If this is the case, the component will report this to <code class="highlighter-rouge">home-assistant.log</code>. You can have a look at <a href="/components/">the various component pages</a> for instructions on how to setup the components.</p>
<p>See the <a href="/components/logger/">logger</a> component for instructions on how to define the level of logging you require for specific modules.</p>
<p>If you find any errors or want to expand the documentation, please <a href="https://github.com/home-assistant/home-assistant.io/issues">let us know</a>.</p>
<h4><a class="title-link" name="problems-with-dependencies" href="#problems-with-dependencies"></a> Problems with dependencies</h4>
<p>Almost all components have external dependencies to communicate with your devices and services. Sometimes Home Assistant is unable to install the necessary dependencies. If this is the case, it should show up in <code class="highlighter-rouge">home-assistant.log</code>.</p>
<p>The first step is trying to restart Home Assistant and see if the problem persists. If it does, look at the log to see what the error is. If you cant figure it out, please <a href="https://github.com/home-assistant/home-assistant/issues">report it</a> so we can investigate what is going on.</p>
<h4><a class="title-link" name="problems-with-components" href="#problems-with-components"></a> Problems with components</h4>
<p>It can happen that some components either do not work right away or stop working after Home Assistant has been running for a while. If this happens to you, please <a href="https://github.com/home-assistant/home-assistant/issues">report it</a> so that we can have a look.</p>
<h4><a class="title-link" name="multiple-files" href="#multiple-files"></a> Multiple files</h4>
<p>If you are using multiple files for your setup, make sure that the pointers are correct and the format of the files is valid.</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">light</span><span class="pi">:</span> <span class="kt">!include</span> <span class="s">devices/lights.yaml</span>
<span class="s">sensor</span><span class="pi">:</span> <span class="kt">!include</span> <span class="s">devices/sensors.yaml</span>
</code></pre>
</div>
<p>Contents of <code class="highlighter-rouge">lights.yaml</code> (notice it does not contain <code class="highlighter-rouge">light: </code>):</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">hyperion</span>
<span class="s">host</span><span class="pi">:</span> <span class="s">192.168.1.98</span>
<span class="s">...</span>
</code></pre>
</div>
<p>Contents of <code class="highlighter-rouge">sensors.yaml</code>:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">mqtt</span>
<span class="s">name</span><span class="pi">:</span> <span class="s2">"</span><span class="s">Room</span><span class="nv"> </span><span class="s">Humidity"</span>
<span class="s">state_topic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">room/humidity"</span>
@ -167,22 +118,13 @@
<span class="s">...</span>
</code></pre>
</div>
<p class="note">
Whenever you report an issue, be aware that we are volunteers who do not have access to every single device in the world nor unlimited time to fix every problem out there.
</p>
</article>
</div>
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">
<div class="grid">
<section class="aside-module grid__item one-whole lap-one-half">
<div class='section'>
<h1 class="title delta">Topics</h1>
@ -369,13 +311,10 @@ Whenever you report an issue, be aware that we are volunteers who do not have ac
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
@ -385,7 +324,6 @@ Whenever you report an issue, be aware that we are volunteers who do not have ac
<a rel="me" href='https://facebook.com/homeassistantio'><i class="icon-facebook"></i></a>
<a rel="me" href='https://plus.google.com/110560654828510104551'><i class="icon-google-plus"></i></a>
<a rel="me" href='https://github.com/home-assistant/home-assistant'><i class="icon-github"></i></a>
<div class="credit">
Contact us at <a href='mailto:hello@home-assistant.io'>hello@home-assistant.io</a>.<br>
Website powered by <a href='http://jekyllrb.com/'>Jekyll</a> and the <a href='https://github.com/coogie/oscailte'>Oscalite theme</a>.<br />
@ -397,7 +335,6 @@ Whenever you report an issue, be aware that we are volunteers who do not have ac
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
@ -405,4 +342,4 @@ Whenever you report an issue, be aware that we are volunteers who do not have ac
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>
</html>

View file

@ -3,17 +3,14 @@
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>YAML - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Details about YAML to configure Home Assistant.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/docs/configuration/yaml/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="YAML">
<meta property="og:site_name" content="Home Assistant">
@ -21,39 +18,31 @@
<meta property="og:type" content="article">
<meta property="og:description" content="Details about YAML to configure Home Assistant.">
<meta property="og:image" content="https://home-assistant.io/images/default-social.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@home_assistant">
<meta name="twitter:title" content="YAML">
<meta name="twitter:description" content="Details about YAML to configure Home Assistant.">
<meta name="twitter:image" content="https://home-assistant.io/images/default-social.png">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet">
<link href="/atom.xml" rel="alternate" title="Home Assistant" type="application/atom+xml">
<link rel='shortcut icon' href='/images/favicon.ico' />
<link rel='icon' type='image/png' href='/images/favicon-192x192.png' sizes='192x192' />
</head>
<body >
<header>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item three-tenths lap-two-sixths palm-one-whole ha-title">
<a href="/" class="site-title">
<img width='40' src='/demo/favicon-192x192.png'>
<span>Home Assistant</span>
</a>
</div>
<div class="grid__item seven-tenths lap-four-sixths palm-one-whole">
<nav>
<input type="checkbox" id="toggle">
<label for="toggle" class="toggle" data-open="Main Menu" data-close="Close Menu"></label>
<ul class="menu pull-right">
<li><a href="/getting-started/">Getting started</a></li>
<li><a href="/components/">Components</a></li>
<li><a href="/docs/">Docs</a></li>
@ -64,63 +53,41 @@
</ul>
</nav>
</div>
</div>
</div>
</header>
<div class="grid-wrapper">
<div class="grid grid-center">
<div class="grid__item two-thirds lap-one-whole palm-one-whole">
<article class="page">
<div class='edit-github'><a href='https://github.com/home-assistant/home-assistant.github.io/tree/current/source/_docs/configuration/yaml.markdown'>Edit this page on GitHub</a></div>
<header>
<h1 class="title indent">
YAML
</h1>
</header>
<hr class="divider">
<p>Home Assistant uses the <a href="http://yaml.org/">YAML</a> syntax for configuration. YAML might take a while to get used to but is really powerful in allowing you to express complex configurations.</p>
<p>For each component that you want to use in Home Assistant, you add code in your <code class="highlighter-rouge">configuration.yaml</code> file to specify its settings.
The following example entry specifies that you want to use the <a href="/components/notify">notify component</a> with the <a href="/components/notify.pushbullet">pushbullet platform</a>.</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">notify</span><span class="pi">:</span>
<span class="s">platform</span><span class="pi">:</span> <span class="s">pushbullet</span>
<span class="s">api_key</span><span class="pi">:</span> <span class="s2">"</span><span class="s">o.1234abcd"</span>
<span class="s">name</span><span class="pi">:</span> <span class="s">pushbullet</span>
</code></pre>
</div>
<ul>
<li>A <strong>component</strong> provides the core logic for some functionality (like <code class="highlighter-rouge">notify</code> provides sending notifications).</li>
<li>A <strong>platform</strong> makes the connection to a specific software or hardware platform (like <code class="highlighter-rouge">pushbullet</code> works with the service from pushbullet.com).</li>
</ul>
<p>The basics of YAML syntax are block collections and mappings containing key-value pairs. Each item in a collection starts with a <code class="highlighter-rouge">-</code> while mappings have the format <code class="highlighter-rouge">key: value</code>. If you specify duplicate keys, the last value for a key is used.</p>
<p>Note that indentation is an important part of specifying relationships using YAML. Things that are indented are nested “inside” things that are one level higher. So in the above example, <code class="highlighter-rouge">platform: pushbullet</code> is a property of (nested inside) the <code class="highlighter-rouge">notify</code> component.
Getting the right indentation can be tricky if youre not using an editor with a fixed width font. Tabs are not allowed to be used for indentation. Convention is to use 2 spaces for each level of indentation.
You can use <a href="http://www.yamllint.com/">YAMLLint</a> to check if your YAML-syntax is correct before loading it into Home Assistant which will save you some time.
<em>Please pay attention on not putting in private data, as it is a 3rd-party website not maintained by Home Assistant.</em></p>
<p>Text following a <strong>#</strong> are comments and are ignored by the system.</p>
<p>The next example shows an <a href="/components/input_select">input_select</a> component that uses a block collection for the options values.
The other properties (like name) are specified using mappings. Note that the second line just has <code class="highlighter-rouge">threat:</code> with no value on the same line. Here threat is the name of the input_select and the values for it are everything nested below it.</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">input_select</span><span class="pi">:</span>
<span class="s">threat</span><span class="pi">:</span>
<span class="s">name</span><span class="pi">:</span> <span class="s">Threat level</span>
@ -133,9 +100,7 @@ The other properties (like name) are specified using mappings. Note that the sec
<span class="s">initial</span><span class="pi">:</span> <span class="s">0</span>
</code></pre>
</div>
<p>The following example shows nesting a collection of mappings in a mapping. In Home Assistant, this would create two sensors that each use the MQTT platform but have different values for their <code class="highlighter-rouge">state_topic</code> (one of the properties used for MQTT sensors).</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">sensor</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">mqtt</span>
<span class="s">state_topic</span><span class="pi">:</span> <span class="s">sensor/topic</span>
@ -143,19 +108,10 @@ The other properties (like name) are specified using mappings. Note that the sec
<span class="s">state_topic</span><span class="pi">:</span> <span class="s">sensor2/topic</span>
</code></pre>
</div>
</article>
</div>
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">
<div class="grid">
<section class="aside-module grid__item one-whole lap-one-half">
<div class='section'>
<h1 class="title delta">Topics</h1>
@ -342,13 +298,10 @@ The other properties (like name) are specified using mappings. Note that the sec
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
@ -358,7 +311,6 @@ The other properties (like name) are specified using mappings. Note that the sec
<a rel="me" href='https://facebook.com/homeassistantio'><i class="icon-facebook"></i></a>
<a rel="me" href='https://plus.google.com/110560654828510104551'><i class="icon-google-plus"></i></a>
<a rel="me" href='https://github.com/home-assistant/home-assistant'><i class="icon-github"></i></a>
<div class="credit">
Contact us at <a href='mailto:hello@home-assistant.io'>hello@home-assistant.io</a>.<br>
Website powered by <a href='http://jekyllrb.com/'>Jekyll</a> and the <a href='https://github.com/coogie/oscailte'>Oscalite theme</a>.<br />
@ -370,7 +322,6 @@ The other properties (like name) are specified using mappings. Note that the sec
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
@ -378,4 +329,4 @@ The other properties (like name) are specified using mappings. Note that the sec
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>
</html>