Site updated at 2016-07-24 17:39:50 UTC

This commit is contained in:
Travis CI 2016-07-24 17:39:51 +00:00
parent 2d9a218a1b
commit 29118ce15d
1007 changed files with 168343 additions and 140 deletions

View file

@ -0,0 +1,248 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Apache Configuration - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Configure Apache to work with home assistant as a subdomain">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/apache_configuration/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Apache Configuration">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/apache_configuration/">
<meta property="og:type" content="article">
<meta property="og:description" content="Configure Apache to work with home assistant as a subdomain">
<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="Apache Configuration">
<meta name="twitter:description" content="Configure Apache to work with home assistant as a subdomain">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Apache Configuration
</h1>
</header>
<hr class="divider">
<p>This is an example about how you can configure Apache to act as a proxy for home assistant.</p>
<p>This is useful if you want to have:</p>
<ul>
<li>a subdomain redirecting to your home assistant instance</li>
<li>several subdomain for several instance</li>
<li>HTTPS redirection</li>
</ul>
<h4><a class="title-link" name="subdomain" href="#subdomain"></a> Subdomain</h4>
<p>So you already have a working Apache server available at example.org.<br />
Your home assistant is correctly working on this web server and available at localhost:8123</p>
<p>To be able to access to your home assistant instance by using https://home.example.org, add to following file into <code>/etc/httpd/conf/extra/hass.conf</code></p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre>&lt;VirtualHost *:443&gt;
ProxyPreserveHost On
ProxyRequests Off
ServerName home.example.org
ProxyPass / http://localhost:8123/
ProxyPassReverse / http://localhost:8123/
&lt;/VirtualHost&gt;
</pre></div>
</div>
</div>
<p>and make sure that this file is read by apaches main configiuration file <code>/etc/httpd/conf/httpd.conf</code></p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre>...
Include conf/extra/hass.conf
...
</pre></div>
</div>
</div>
<p>If you dont want HTTPS, you can change <code>&lt;VirtualHost *:443&gt;</code> to <code>&lt;VirtualHost *:80&gt;</code> or better consider redirecting all HTTP to HTTPS.</p>
<h4><a class="title-link" name="multiple-instance" href="#multiple-instance"></a> Multiple Instance</h4>
<p>You already have home assistant running on localhost:8123 and available at home.example.org as describe before.<br />
The configuration file for this home assistant is available in <code>/home/alice/.homeassistant/configuration.yaml</code></p>
<p>You want another instance available at https://countryside.example.org</p>
<p>You can either :<br />
* Create a new user, <code>bob</code>, to hold the configuration file in <code>/home/bob/.homeassistant/configuration.yaml</code> and run home assistant as this new user<br />
* Create another configuration directory in <code>/home/alice/.homeassistan2/configuration.yaml</code> and run home assistant using <code>hass --config /home/alice/.homeassistant2/</code></p>
<p>In both solution, change port number used by modifying <code>configuration.yaml</code></p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="key">http</span>:
<span class="key">server_port</span>: <span class="string"><span class="content">8124</span></span>
<span class="error">...</span>
</pre></div>
</div>
</div>
<p>Start home assistant: Now, you have another instance running on localhost:8124</p>
<p>To access this instance by using https://countryside.example.org add to <code>/etc/httpd/conf/extra/hass.conf</code></p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre>&lt;VirtualHost *:443&gt;
ProxyPreserveHost On
ProxyRequests Off
ServerName countryside.example.org
ProxyPass / http://localhost:8124/
ProxyPassReverse / http://localhost:8124/
&lt;/VirtualHost&gt;
</pre></div>
</div>
</div>
<h4><a class="title-link" name="http-to-https-redirection" href="#http-to-https-redirection"></a> HTTP to HTTPS redirection</h4>
<p>Add to your <code>/etc/httpd/conf/extra/hass.conf</code></p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre>&lt;VirtualHost *:80&gt;
ServerName example.org
ServerSignature Off
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [NE,R,L]
&lt;/VirtualHost&gt;
</pre></div>
</div>
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/apache_configuration.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Infrastructure</h1>
<ul class='divided'>
<li>
Apache Configuration
</li>
<li>
<a href='/cookbook/tor_configuration/'>Tor Onion Service Configuration</a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,288 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Examples for flashing lights - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Automation examples for flashing lights in case of an alarm.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/automation_flashing_lights/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Examples for flashing lights">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/automation_flashing_lights/">
<meta property="og:type" content="article">
<meta property="og:description" content="Automation examples for flashing lights in case of an alarm.">
<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="Examples for flashing lights">
<meta name="twitter:description" content="Automation examples for flashing lights in case of an alarm.">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Examples for Flashing Lights
</h1>
</header>
<hr class="divider">
<h4><a class="title-link" name="flashing-lights-triggered-by-an-alarm" href="#flashing-lights-triggered-by-an-alarm"></a> Flashing lights triggered by an alarm</h4>
<p>For flashing regular lights in case the the triggering of an alarm.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="comment"># AlmAct1 - switch to activate the alarm in Room1</span>
<span class="comment"># AlmSnd1 - switch for a buzzer</span>
<span class="key">automation</span>:
- <span class="string"><span class="content">alias: 'Alarm_PIR_Room1'</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">binary_sensor.PIR1</span></span>
<span class="key">state</span>: <span class="string"><span class="content">'on'</span></span>
<span class="key">condition</span>:
- <span class="string"><span class="content">condition: state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">switch.AlmAct1</span></span>
<span class="key">state</span>: <span class="string"><span class="content">'on'</span></span>
- <span class="string"><span class="content">condition: state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">script.alarm_room1</span></span>
<span class="key">state</span>: <span class="string"><span class="content">'off'</span></span>
<span class="key">action</span>:
<span class="comment"># start alarm on movement if alarm activated</span>
<span class="comment"># and the alarm is not triggered</span>
<span class="key">service</span>: <span class="string"><span class="content">script.turn_on</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">script.alarm_room1</span></span>
- <span class="string"><span class="content">alias: 'flash_room1_start'</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">switch.AlmSnd1</span></span>
<span class="key">state</span>: <span class="string"><span class="content">'on'</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">script.turn_on</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">script.flash_room1</span></span>
- <span class="string"><span class="content">alias: 'flash_room1_stop'</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">switch.REL1</span></span>
<span class="key">state</span>: <span class="string"><span class="content">'off'</span></span>
<span class="key">condition</span>:
<span class="key">condition</span>: <span class="string"><span class="content">state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">switch.AlmSnd1</span></span>
<span class="key">state</span>: <span class="string"><span class="content">'off'</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">script.turn_off</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">script.flash_room1</span></span>
<span class="key">script</span>:
<span class="key">alarm_room1</span>:
<span class="key">alias</span>: <span class="string"><span class="content">Alarm room1</span></span>
<span class="key">sequence</span>:
- <span class="string"><span class="content">alias: Alarm Room1 Start</span></span>
<span class="key">service</span>: <span class="string"><span class="content">homeassistant.turn_on</span></span>
<span class="key">data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">switch.AlmSnd1</span></span>
- <span class="string"><span class="content">alias: Set Ack Room1</span></span>
<span class="key">service</span>: <span class="string"><span class="content">homeassistant.turn_on</span></span>
<span class="key">data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">input_boolean.ack1</span></span>
- <span class="string"><span class="content">alias: email_Room1</span></span>
<span class="key">service</span>: <span class="string"><span class="content">notify.email</span></span>
<span class="key">data</span>:
<span class="key">message</span>: <span class="string"><span class="content">'Movement alarm in Room1'</span></span>
- <span class="string"><span class="content">delay:</span><span class="content">
# time interval for alarm sound and light flashing
seconds: 60</span></span>
- <span class="string"><span class="content">alias: Alarm Room1 Stop</span></span>
<span class="key">service</span>: <span class="string"><span class="content">homeassistant.turn_off</span></span>
<span class="key">data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">switch.AlmSnd1</span></span>
<span class="key">flash_room1</span>:
<span class="key">alias</span>: <span class="string"><span class="content">Flash Room1 On</span></span>
<span class="key">sequence</span>:
- <span class="string"><span class="content">alias: Light Room1 On</span></span>
<span class="key">service</span>: <span class="string"><span class="content">homeassistant.turn_on</span></span>
<span class="key">data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">switch.REL1</span></span>
- <span class="string"><span class="content">delay:</span><span class="content">
# time for flash light on
seconds: 1</span></span>
- <span class="string"><span class="content">alias: Light Room1 Off</span></span>
<span class="key">service</span>: <span class="string"><span class="content">homeassistant.turn_off</span></span>
<span class="key">data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">switch.REL1</span></span>
- <span class="string"><span class="content">delay:</span><span class="content">
# time for flash light off
seconds: 1</span></span>
- <span class="string"><span class="content">alias: loop_room1</span></span>
<span class="key">service</span>: <span class="string"><span class="content">script.turn_on</span></span>
<span class="key">data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">script.flash_room1</span></span>
</pre></div>
</div>
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/automation_flashing_lights.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Automation Examples</h1>
<ul class='divided'>
<li>
<a href='/cookbook/automation_for_rainy_days/'>Automation for rainy days</a>
</li>
<li>
<a href='/cookbook/dim_lights_when_playing_media/'>Dim lights when playing media</a>
</li>
<li>
<a href='/cookbook/basic_example_use_trigger_values/'>Example using use_trigger_values</a>
</li>
<li>
Examples for flashing lights
</li>
<li>
<a href='/cookbook/automation_sun/'>Examples using the sun</a>
</li>
<li>
<a href='/cookbook/foscam_away_mode_PTZ/'>Foscam Recording during Away Mode Only using Pan/Tilt/Zoom Control and Motion Detection</a>
</li>
<li>
<a href='/cookbook/perform_actions_based_on_input_select/'>Perform actions based on input select</a>
</li>
<li>
<a href='/cookbook/restart_ha_if_wemo_switch_is_not_detected/'>Restart Home Assistant if Wemo Switch is not detected</a>
</li>
<li>
<a href='/cookbook/send_a_reminder/'>Send a reminder</a>
</li>
<li>
<a href='/cookbook/notify_if_over_threshold/'>Send notification based on sensor</a>
</li>
<li>
<a href='/cookbook/notify_if__new_ha_release/'>Send notification if new Home Assistant release</a>
</li>
<li>
<a href='/cookbook/track_battery_level/'>Track your battery level</a>
</li>
<li>
<a href='/cookbook/turn_on_light_for_10_minutes_when_motion_detected/'>Turn on lights for 10 minutes after motion detected</a>
</li>
<li>
<a href='/cookbook/automation_using_timeinterval_inputboolean/'>Using time interval and input boolean</a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,239 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Automation for rainy days - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Basic example how to use weather conditions to set states">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/automation_for_rainy_days/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Automation for rainy days">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/automation_for_rainy_days/">
<meta property="og:type" content="article">
<meta property="og:description" content="Basic example how to use weather conditions to set states">
<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="Automation for rainy days">
<meta name="twitter:description" content="Basic example how to use weather conditions to set states">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Automation for Rainy Days
</h1>
</header>
<hr class="divider">
<p>This requires a <a href="/components/sensor.forecast/">forecast.io</a> sensor with the condition <code>weather_precip</code> that tells if its raining or not.</p>
<p>Turn on a light in the living room when it starts raining, someone is home, and its afternoon or later.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="key">automation</span>:
<span class="key">alias</span>: <span class="string"><span class="content">'Rainy Day'</span></span>
<span class="key">trigger</span>:
- <span class="string"><span class="content">platform: state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">sensor.weather_precip</span></span>
<span class="key">state</span>: <span class="string"><span class="content">'rain'</span></span>
- <span class="string"><span class="content">platform: state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">group.all_devices</span></span>
<span class="key">state</span>: <span class="string"><span class="content">'home'</span></span>
- <span class="string"><span class="content">platform: time</span></span>
<span class="key">after</span>: <span class="string"><span class="content">'14:00'</span></span>
<span class="key">before</span>: <span class="string"><span class="content">'23:00'</span></span>
<span class="key">condition</span>: <span class="string"><span class="content">use_trigger_values</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">light.turn_on</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">light.couch_lamp</span></span>
</pre></div>
</div>
</div>
<p>And then of course turn off the lamp when it stops raining but only if its within an hour before sunset.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="key">automation 2</span>:
<span class="key">alias</span>: <span class="string"><span class="content">'Rain is over'</span></span>
<span class="key">trigger</span>:
- <span class="string"><span class="content">platform: state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">sensor.weather_precip</span></span>
<span class="key">state</span>: <span class="string"><span class="content">'None'</span></span>
- <span class="string"><span class="content">platform: sun</span></span>
<span class="key">event</span>: <span class="string"><span class="content">'sunset'</span></span>
<span class="key">offset</span>: <span class="string"><span class="content">'-01:00:00'</span></span>
<span class="key">condition</span>: <span class="string"><span class="content">use_trigger_values</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">light.turn_off</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">light.couch_lamp</span></span>
</pre></div>
</div>
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/automation_for_rainy_days.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Automation Examples</h1>
<ul class='divided'>
<li>
Automation for rainy days
</li>
<li>
<a href='/cookbook/dim_lights_when_playing_media/'>Dim lights when playing media</a>
</li>
<li>
<a href='/cookbook/basic_example_use_trigger_values/'>Example using use_trigger_values</a>
</li>
<li>
<a href='/cookbook/automation_flashing_lights/'>Examples for flashing lights</a>
</li>
<li>
<a href='/cookbook/automation_sun/'>Examples using the sun</a>
</li>
<li>
<a href='/cookbook/foscam_away_mode_PTZ/'>Foscam Recording during Away Mode Only using Pan/Tilt/Zoom Control and Motion Detection</a>
</li>
<li>
<a href='/cookbook/perform_actions_based_on_input_select/'>Perform actions based on input select</a>
</li>
<li>
<a href='/cookbook/restart_ha_if_wemo_switch_is_not_detected/'>Restart Home Assistant if Wemo Switch is not detected</a>
</li>
<li>
<a href='/cookbook/send_a_reminder/'>Send a reminder</a>
</li>
<li>
<a href='/cookbook/notify_if_over_threshold/'>Send notification based on sensor</a>
</li>
<li>
<a href='/cookbook/notify_if__new_ha_release/'>Send notification if new Home Assistant release</a>
</li>
<li>
<a href='/cookbook/track_battery_level/'>Track your battery level</a>
</li>
<li>
<a href='/cookbook/turn_on_light_for_10_minutes_when_motion_detected/'>Turn on lights for 10 minutes after motion detected</a>
</li>
<li>
<a href='/cookbook/automation_using_timeinterval_inputboolean/'>Using time interval and input boolean</a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,294 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Examples using the sun - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Automation examples that use the sun.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/automation_sun/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Examples using the sun">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/automation_sun/">
<meta property="og:type" content="article">
<meta property="og:description" content="Automation examples that use the sun.">
<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="Examples using the sun">
<meta name="twitter:description" content="Automation examples that use the sun.">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Examples Using the Sun
</h1>
</header>
<hr class="divider">
<h4><a class="title-link" name="turn-on-the-living-room-lights-45-minutes-before-sunset-if-anyone-home" href="#turn-on-the-living-room-lights-45-minutes-before-sunset-if-anyone-home"></a> Turn on the living room lights 45 minutes before sunset if anyone home</h4>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="key">automation</span>:
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">sun</span></span>
<span class="key">event</span>: <span class="string"><span class="content">sunset</span></span>
<span class="key">offset</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">-00:45:00</span><span class="delimiter">&quot;</span></span>
<span class="key">condition</span>:
<span class="key">condition</span>: <span class="string"><span class="content">state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">group.all_devices</span></span>
<span class="key">state</span>: <span class="string"><span class="content">home</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">homeassistant.turn_on</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">group.living_room_lights</span></span>
</pre></div>
</div>
</div>
<h4><a class="title-link" name="natural-wake-up-light" href="#natural-wake-up-light"></a> Natural wake up light</h4>
<p><em>Note, Philips Hue is currently the only light platform that support transitions.</em></p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="key">automation</span>:
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">time</span></span>
<span class="key">after</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">07:15:00</span><span class="delimiter">&quot;</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">light.turn_on</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">light.bedroom</span></span>
<span class="key">data</span>:
<span class="comment"># 900 seconds = 15 minutes</span>
<span class="key">transition</span>: <span class="string"><span class="content">900</span></span>
</pre></div>
</div>
</div>
<h4><a class="title-link" name="send-sun-risesun-set-notifications" href="#send-sun-risesun-set-notifications"></a> Send sun rise/sun set notifications</h4>
<p>Notifications send through <a href="/components/notify.pushbullet/">PushBullet</a> when the sun state is changed.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="key">automation</span>:
- <span class="string"><span class="content">alias: 'Send notification when sun rises'</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">sun</span></span>
<span class="key">event</span>: <span class="string"><span class="content">sunrise</span></span>
<span class="key">offset</span>: <span class="string"><span class="content">'+00:00:00'</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">notify.pushbullet</span></span>
<span class="key">data</span>:
<span class="key">message</span>: <span class="string"><span class="content">'The sun is up.'</span></span>
- <span class="string"><span class="content">alias: 'Send notification when sun sets'</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">sun</span></span>
<span class="key">event</span>: <span class="string"><span class="content">sunset</span></span>
<span class="key">offset</span>: <span class="string"><span class="content">'+00:00:00'</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">notify.pushbullet</span></span>
<span class="key">data</span>:
<span class="key">message</span>: <span class="string"><span class="content">'The sun is down.'</span></span>
</pre></div>
</div>
</div>
<h4><a class="title-link" name="automations-for-lights-and-blinds-based-on-solar-elevation" href="#automations-for-lights-and-blinds-based-on-solar-elevation"></a> Automations for lights and blinds based on solar elevation</h4>
<p>Solar elevation automations can cope with offsets from sunset / sunrise as the seasons change better than using a time based offsets.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre>- <span class="string"><span class="content">alias: 'Turn a few lights on when the sun gets dim'</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">numeric_state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">sun.sun</span></span>
<span class="key">value_template</span>: <span class="string"><span class="content">'{{ state.attributes.elevation }}'</span></span>
<span class="key">below</span>: <span class="string"><span class="content">3.5</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">scene.turn_on</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">scene.background_lights</span></span>
- <span class="string"><span class="content">alias: 'Turn more lights on as the sun gets dimmer'</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">numeric_state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">sun.sun</span></span>
<span class="key">value_template</span>: <span class="string"><span class="content">'{{ state.attributes.elevation }}'</span></span>
<span class="key">below</span>: <span class="string"><span class="content">1.5</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">scene.turn_on</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">scene.more_lights</span></span>
- <span class="string"><span class="content">alias: 'Close blind at dusk'</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">numeric_state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">sun.sun</span></span>
<span class="key">value_template</span>: <span class="string"><span class="content">'{{ state.attributes.elevation }}'</span></span>
<span class="key">below</span>: <span class="string"><span class="content">-2.5</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">switch.turn_off</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">switch.blind</span></span>
</pre></div>
</div>
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/automation_sun.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Automation Examples</h1>
<ul class='divided'>
<li>
<a href='/cookbook/automation_for_rainy_days/'>Automation for rainy days</a>
</li>
<li>
<a href='/cookbook/dim_lights_when_playing_media/'>Dim lights when playing media</a>
</li>
<li>
<a href='/cookbook/basic_example_use_trigger_values/'>Example using use_trigger_values</a>
</li>
<li>
<a href='/cookbook/automation_flashing_lights/'>Examples for flashing lights</a>
</li>
<li>
Examples using the sun
</li>
<li>
<a href='/cookbook/foscam_away_mode_PTZ/'>Foscam Recording during Away Mode Only using Pan/Tilt/Zoom Control and Motion Detection</a>
</li>
<li>
<a href='/cookbook/perform_actions_based_on_input_select/'>Perform actions based on input select</a>
</li>
<li>
<a href='/cookbook/restart_ha_if_wemo_switch_is_not_detected/'>Restart Home Assistant if Wemo Switch is not detected</a>
</li>
<li>
<a href='/cookbook/send_a_reminder/'>Send a reminder</a>
</li>
<li>
<a href='/cookbook/notify_if_over_threshold/'>Send notification based on sensor</a>
</li>
<li>
<a href='/cookbook/notify_if__new_ha_release/'>Send notification if new Home Assistant release</a>
</li>
<li>
<a href='/cookbook/track_battery_level/'>Track your battery level</a>
</li>
<li>
<a href='/cookbook/turn_on_light_for_10_minutes_when_motion_detected/'>Turn on lights for 10 minutes after motion detected</a>
</li>
<li>
<a href='/cookbook/automation_using_timeinterval_inputboolean/'>Using time interval and input boolean</a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,222 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Using time interval and input boolean - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Automation to get a random color every 2 minutes that can be turned on/off.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/automation_using_timeinterval_inputboolean/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Using time interval and input boolean">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/automation_using_timeinterval_inputboolean/">
<meta property="og:type" content="article">
<meta property="og:description" content="Automation to get a random color every 2 minutes that can be turned on/off.">
<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="Using time interval and input boolean">
<meta name="twitter:description" content="Automation to get a random color every 2 minutes that can be turned on/off.">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Using Time Interval and Input Boolean
</h1>
</header>
<hr class="divider">
<h4><a class="title-link" name="change-hue-light-on-interval-to-random-color-based-on-state-of-a-input-boolean" href="#change-hue-light-on-interval-to-random-color-based-on-state-of-a-input-boolean"></a> Change Hue light on interval to random color based on state of a input boolean</h4>
<p><em>Note, Philips Hue is currently the only light platform that support the random effect.</em></p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="key">input_boolean</span>:
<span class="key">loop_livingcolors</span>:
<span class="key">name</span>: <span class="string"><span class="content">Loop LivingColors</span></span>
<span class="key">initial</span>: <span class="string"><span class="content">off</span></span>
<span class="key">icon</span>: <span class="string"><span class="content">mdi:spotlight</span></span>
<span class="key">automation</span>:
<span class="comment"># Changes Hue light every two minutes to random color if input boolean is set to on</span>
- <span class="string"><span class="content">alias: 'Set LivingColors to random color'</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">time</span></span>
<span class="key">minutes</span>: <span class="string"><span class="content">'/2'</span></span>
<span class="key">seconds</span>: <span class="string"><span class="content">0</span></span>
<span class="key">condition</span>:
<span class="key">condition</span>: <span class="string"><span class="content">state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">input_boolean.loop_livingcolors</span></span>
<span class="key">state</span>: <span class="string"><span class="content">'on'</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">light.turn_on</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">light.woonkamer_livingcolors</span></span>
<span class="key">data</span>:
<span class="key">effect</span>: <span class="string"><span class="content">random</span></span>
<span class="key">transition</span>: <span class="string"><span class="content">5</span></span>
<span class="key">brightness</span>: <span class="string"><span class="content">255</span></span>
</pre></div>
</div>
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/automation_using_timeinterval_inputboolean.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Automation Examples</h1>
<ul class='divided'>
<li>
<a href='/cookbook/automation_for_rainy_days/'>Automation for rainy days</a>
</li>
<li>
<a href='/cookbook/dim_lights_when_playing_media/'>Dim lights when playing media</a>
</li>
<li>
<a href='/cookbook/basic_example_use_trigger_values/'>Example using use_trigger_values</a>
</li>
<li>
<a href='/cookbook/automation_flashing_lights/'>Examples for flashing lights</a>
</li>
<li>
<a href='/cookbook/automation_sun/'>Examples using the sun</a>
</li>
<li>
<a href='/cookbook/foscam_away_mode_PTZ/'>Foscam Recording during Away Mode Only using Pan/Tilt/Zoom Control and Motion Detection</a>
</li>
<li>
<a href='/cookbook/perform_actions_based_on_input_select/'>Perform actions based on input select</a>
</li>
<li>
<a href='/cookbook/restart_ha_if_wemo_switch_is_not_detected/'>Restart Home Assistant if Wemo Switch is not detected</a>
</li>
<li>
<a href='/cookbook/send_a_reminder/'>Send a reminder</a>
</li>
<li>
<a href='/cookbook/notify_if_over_threshold/'>Send notification based on sensor</a>
</li>
<li>
<a href='/cookbook/notify_if__new_ha_release/'>Send notification if new Home Assistant release</a>
</li>
<li>
<a href='/cookbook/track_battery_level/'>Track your battery level</a>
</li>
<li>
<a href='/cookbook/turn_on_light_for_10_minutes_when_motion_detected/'>Turn on lights for 10 minutes after motion detected</a>
</li>
<li>
Using time interval and input boolean
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,221 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Example using use_trigger_values - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Basic example how to use use_trigger_values in automation">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/basic_example_use_trigger_values/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Example using use_trigger_values">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/basic_example_use_trigger_values/">
<meta property="og:type" content="article">
<meta property="og:description" content="Basic example how to use use_trigger_values in automation">
<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="Example using use_trigger_values">
<meta name="twitter:description" content="Basic example how to use use_trigger_values in automation">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Example Using Use_trigger_values
</h1>
</header>
<hr class="divider">
<p>Turn on lights during daytime when its dark enough &lt; 200 lux.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="key">automation</span>:
- <span class="string"><span class="content">alias: </span></span>
<span class="key">trigger</span>:
- <span class="string"><span class="content">platform: numeric_state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">sensor.sensor_luminance</span></span>
<span class="key">below</span>: <span class="string"><span class="content">200</span></span>
- <span class="string"><span class="content">platform: time</span></span>
<span class="key">after</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">08:00</span><span class="delimiter">&quot;</span></span>
<span class="key">before</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">23:00</span><span class="delimiter">&quot;</span></span>
<span class="key">condition</span>: <span class="string"><span class="content">use_trigger_values</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">homeassistant.turn_on</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">group.basic_lights</span></span>
<span class="key">automation 2</span>:
- <span class="string"><span class="content">alias: </span></span>
<span class="key">trigger</span>:
- <span class="string"><span class="content">platform: numeric_state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">sensor.sensor_luminance</span></span>
<span class="key">above</span>: <span class="string"><span class="content">200</span></span>
- <span class="string"><span class="content">platform: time</span></span>
<span class="key">after</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">23:00</span><span class="delimiter">&quot;</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">homeassistant.turn_off</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">group.basic_lights</span></span>
</pre></div>
</div>
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/basic_example_use_trigger_values.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Automation Examples</h1>
<ul class='divided'>
<li>
<a href='/cookbook/automation_for_rainy_days/'>Automation for rainy days</a>
</li>
<li>
<a href='/cookbook/dim_lights_when_playing_media/'>Dim lights when playing media</a>
</li>
<li>
Example using use_trigger_values
</li>
<li>
<a href='/cookbook/automation_flashing_lights/'>Examples for flashing lights</a>
</li>
<li>
<a href='/cookbook/automation_sun/'>Examples using the sun</a>
</li>
<li>
<a href='/cookbook/foscam_away_mode_PTZ/'>Foscam Recording during Away Mode Only using Pan/Tilt/Zoom Control and Motion Detection</a>
</li>
<li>
<a href='/cookbook/perform_actions_based_on_input_select/'>Perform actions based on input select</a>
</li>
<li>
<a href='/cookbook/restart_ha_if_wemo_switch_is_not_detected/'>Restart Home Assistant if Wemo Switch is not detected</a>
</li>
<li>
<a href='/cookbook/send_a_reminder/'>Send a reminder</a>
</li>
<li>
<a href='/cookbook/notify_if_over_threshold/'>Send notification based on sensor</a>
</li>
<li>
<a href='/cookbook/notify_if__new_ha_release/'>Send notification if new Home Assistant release</a>
</li>
<li>
<a href='/cookbook/track_battery_level/'>Track your battery level</a>
</li>
<li>
<a href='/cookbook/turn_on_light_for_10_minutes_when_motion_detected/'>Turn on lights for 10 minutes after motion detected</a>
</li>
<li>
<a href='/cookbook/automation_using_timeinterval_inputboolean/'>Using time interval and input boolean</a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,179 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Configuration.yaml by bah2830 - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/configuration_yaml_by_bah2830/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Configuration.yaml by bah2830">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/configuration_yaml_by_bah2830/">
<meta property="og:type" content="article">
<meta property="og:description" content="">
<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="Configuration.yaml by bah2830">
<meta name="twitter:description" content="">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Configuration.yaml by Bah2830
</h1>
</header>
<hr class="divider">
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/configuration_yaml_by_bah2830.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Example configuration.yaml</h1>
<ul class='divided'>
<li>
<a href='https://gist.github.com/CCOSTAN/9934de973a293b809868'>Configuration.yaml by Carlo Costanzo <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/danichispa/hass'>Configuration.yaml by Danichispa <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/GreenTurtwig/personal-home-automation/tree/master/Home%20Assistant'>Configuration.yaml by GreenTurtwig <i class="icon-external-link"></i></a>
</li>
<li>
Configuration.yaml by bah2830
</li>
<li>
<a href='/cookbook/configuration_yaml_from_bassclarinetl2/'>Configuration.yaml by bassclarinetl2</a>
</li>
<li>
<a href='https://github.com/brusc/Home-Assistant-Configuration'>Configuration.yaml by brusc <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/cbulock/home-assistant-configs'>Configuration.yaml by cbulock <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/geekofweek/homeassistant'>Configuration.yaml by geekofweek <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/gstevenson/ha-config'>Configuration.yaml by gstevenson <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/happyleavesaoc/my-home-automation/tree/master/homeassistant'>Configuration.yaml by happyleavesaoc <i class="icon-external-link"></i></a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,179 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Configuration.yaml by brusc - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/configuration_yaml_by_brusc/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Configuration.yaml by brusc">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/configuration_yaml_by_brusc/">
<meta property="og:type" content="article">
<meta property="og:description" content="">
<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="Configuration.yaml by brusc">
<meta name="twitter:description" content="">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Configuration.yaml by Brusc
</h1>
</header>
<hr class="divider">
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/configuration_yaml_by_brusc.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Example configuration.yaml</h1>
<ul class='divided'>
<li>
<a href='https://gist.github.com/CCOSTAN/9934de973a293b809868'>Configuration.yaml by Carlo Costanzo <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/danichispa/hass'>Configuration.yaml by Danichispa <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/GreenTurtwig/personal-home-automation/tree/master/Home%20Assistant'>Configuration.yaml by GreenTurtwig <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/bah2830/Home-Assistant-Configs'>Configuration.yaml by bah2830 <i class="icon-external-link"></i></a>
</li>
<li>
<a href='/cookbook/configuration_yaml_from_bassclarinetl2/'>Configuration.yaml by bassclarinetl2</a>
</li>
<li>
Configuration.yaml by brusc
</li>
<li>
<a href='https://github.com/cbulock/home-assistant-configs'>Configuration.yaml by cbulock <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/geekofweek/homeassistant'>Configuration.yaml by geekofweek <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/gstevenson/ha-config'>Configuration.yaml by gstevenson <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/happyleavesaoc/my-home-automation/tree/master/homeassistant'>Configuration.yaml by happyleavesaoc <i class="icon-external-link"></i></a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,179 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Configuration.yaml by Carlo Costanzo - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/configuration_yaml_by_carlo_costanzo/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Configuration.yaml by Carlo Costanzo">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/configuration_yaml_by_carlo_costanzo/">
<meta property="og:type" content="article">
<meta property="og:description" content="">
<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="Configuration.yaml by Carlo Costanzo">
<meta name="twitter:description" content="">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Configuration.yaml by Carlo Costanzo
</h1>
</header>
<hr class="divider">
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/configuration_yaml_by_carlo_costanzo.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Example configuration.yaml</h1>
<ul class='divided'>
<li>
Configuration.yaml by Carlo Costanzo
</li>
<li>
<a href='https://github.com/danichispa/hass'>Configuration.yaml by Danichispa <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/GreenTurtwig/personal-home-automation/tree/master/Home%20Assistant'>Configuration.yaml by GreenTurtwig <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/bah2830/Home-Assistant-Configs'>Configuration.yaml by bah2830 <i class="icon-external-link"></i></a>
</li>
<li>
<a href='/cookbook/configuration_yaml_from_bassclarinetl2/'>Configuration.yaml by bassclarinetl2</a>
</li>
<li>
<a href='https://github.com/brusc/Home-Assistant-Configuration'>Configuration.yaml by brusc <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/cbulock/home-assistant-configs'>Configuration.yaml by cbulock <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/geekofweek/homeassistant'>Configuration.yaml by geekofweek <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/gstevenson/ha-config'>Configuration.yaml by gstevenson <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/happyleavesaoc/my-home-automation/tree/master/homeassistant'>Configuration.yaml by happyleavesaoc <i class="icon-external-link"></i></a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,179 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Configuration.yaml by cbulock - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/configuration_yaml_by_cbulock/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Configuration.yaml by cbulock">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/configuration_yaml_by_cbulock/">
<meta property="og:type" content="article">
<meta property="og:description" content="">
<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="Configuration.yaml by cbulock">
<meta name="twitter:description" content="">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Configuration.yaml by Cbulock
</h1>
</header>
<hr class="divider">
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/configuration_yaml_by_cbulock.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Example configuration.yaml</h1>
<ul class='divided'>
<li>
<a href='https://gist.github.com/CCOSTAN/9934de973a293b809868'>Configuration.yaml by Carlo Costanzo <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/danichispa/hass'>Configuration.yaml by Danichispa <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/GreenTurtwig/personal-home-automation/tree/master/Home%20Assistant'>Configuration.yaml by GreenTurtwig <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/bah2830/Home-Assistant-Configs'>Configuration.yaml by bah2830 <i class="icon-external-link"></i></a>
</li>
<li>
<a href='/cookbook/configuration_yaml_from_bassclarinetl2/'>Configuration.yaml by bassclarinetl2</a>
</li>
<li>
<a href='https://github.com/brusc/Home-Assistant-Configuration'>Configuration.yaml by brusc <i class="icon-external-link"></i></a>
</li>
<li>
Configuration.yaml by cbulock
</li>
<li>
<a href='https://github.com/geekofweek/homeassistant'>Configuration.yaml by geekofweek <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/gstevenson/ha-config'>Configuration.yaml by gstevenson <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/happyleavesaoc/my-home-automation/tree/master/homeassistant'>Configuration.yaml by happyleavesaoc <i class="icon-external-link"></i></a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,179 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Configuration.yaml by Danichispa - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/configuration_yaml_by_danichispa/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Configuration.yaml by Danichispa">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/configuration_yaml_by_danichispa/">
<meta property="og:type" content="article">
<meta property="og:description" content="">
<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="Configuration.yaml by Danichispa">
<meta name="twitter:description" content="">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Configuration.yaml by Danichispa
</h1>
</header>
<hr class="divider">
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/configuration_yaml_by_danichispa.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Example configuration.yaml</h1>
<ul class='divided'>
<li>
<a href='https://gist.github.com/CCOSTAN/9934de973a293b809868'>Configuration.yaml by Carlo Costanzo <i class="icon-external-link"></i></a>
</li>
<li>
Configuration.yaml by Danichispa
</li>
<li>
<a href='https://github.com/GreenTurtwig/personal-home-automation/tree/master/Home%20Assistant'>Configuration.yaml by GreenTurtwig <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/bah2830/Home-Assistant-Configs'>Configuration.yaml by bah2830 <i class="icon-external-link"></i></a>
</li>
<li>
<a href='/cookbook/configuration_yaml_from_bassclarinetl2/'>Configuration.yaml by bassclarinetl2</a>
</li>
<li>
<a href='https://github.com/brusc/Home-Assistant-Configuration'>Configuration.yaml by brusc <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/cbulock/home-assistant-configs'>Configuration.yaml by cbulock <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/geekofweek/homeassistant'>Configuration.yaml by geekofweek <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/gstevenson/ha-config'>Configuration.yaml by gstevenson <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/happyleavesaoc/my-home-automation/tree/master/homeassistant'>Configuration.yaml by happyleavesaoc <i class="icon-external-link"></i></a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,179 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Configuration.yaml by geekofweek - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/configuration_yaml_by_geekofweek/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Configuration.yaml by geekofweek">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/configuration_yaml_by_geekofweek/">
<meta property="og:type" content="article">
<meta property="og:description" content="">
<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="Configuration.yaml by geekofweek">
<meta name="twitter:description" content="">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Configuration.yaml by Geekofweek
</h1>
</header>
<hr class="divider">
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/configuration_yaml_by_geekofweek.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Example configuration.yaml</h1>
<ul class='divided'>
<li>
<a href='https://gist.github.com/CCOSTAN/9934de973a293b809868'>Configuration.yaml by Carlo Costanzo <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/danichispa/hass'>Configuration.yaml by Danichispa <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/GreenTurtwig/personal-home-automation/tree/master/Home%20Assistant'>Configuration.yaml by GreenTurtwig <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/bah2830/Home-Assistant-Configs'>Configuration.yaml by bah2830 <i class="icon-external-link"></i></a>
</li>
<li>
<a href='/cookbook/configuration_yaml_from_bassclarinetl2/'>Configuration.yaml by bassclarinetl2</a>
</li>
<li>
<a href='https://github.com/brusc/Home-Assistant-Configuration'>Configuration.yaml by brusc <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/cbulock/home-assistant-configs'>Configuration.yaml by cbulock <i class="icon-external-link"></i></a>
</li>
<li>
Configuration.yaml by geekofweek
</li>
<li>
<a href='https://github.com/gstevenson/ha-config'>Configuration.yaml by gstevenson <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/happyleavesaoc/my-home-automation/tree/master/homeassistant'>Configuration.yaml by happyleavesaoc <i class="icon-external-link"></i></a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,179 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Configuration.yaml by GreenTurtwig - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/configuration_yaml_by_greenturtwig/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Configuration.yaml by GreenTurtwig">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/configuration_yaml_by_greenturtwig/">
<meta property="og:type" content="article">
<meta property="og:description" content="">
<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="Configuration.yaml by GreenTurtwig">
<meta name="twitter:description" content="">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Configuration.yaml by GreenTurtwig
</h1>
</header>
<hr class="divider">
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/configuration_yaml_by_greenturtwig.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Example configuration.yaml</h1>
<ul class='divided'>
<li>
<a href='https://gist.github.com/CCOSTAN/9934de973a293b809868'>Configuration.yaml by Carlo Costanzo <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/danichispa/hass'>Configuration.yaml by Danichispa <i class="icon-external-link"></i></a>
</li>
<li>
Configuration.yaml by GreenTurtwig
</li>
<li>
<a href='https://github.com/bah2830/Home-Assistant-Configs'>Configuration.yaml by bah2830 <i class="icon-external-link"></i></a>
</li>
<li>
<a href='/cookbook/configuration_yaml_from_bassclarinetl2/'>Configuration.yaml by bassclarinetl2</a>
</li>
<li>
<a href='https://github.com/brusc/Home-Assistant-Configuration'>Configuration.yaml by brusc <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/cbulock/home-assistant-configs'>Configuration.yaml by cbulock <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/geekofweek/homeassistant'>Configuration.yaml by geekofweek <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/gstevenson/ha-config'>Configuration.yaml by gstevenson <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/happyleavesaoc/my-home-automation/tree/master/homeassistant'>Configuration.yaml by happyleavesaoc <i class="icon-external-link"></i></a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,179 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Configuration.yaml by gstevenson - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/configuration_yaml_by_gstevenson/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Configuration.yaml by gstevenson">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/configuration_yaml_by_gstevenson/">
<meta property="og:type" content="article">
<meta property="og:description" content="">
<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="Configuration.yaml by gstevenson">
<meta name="twitter:description" content="">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Configuration.yaml by Gstevenson
</h1>
</header>
<hr class="divider">
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/configuration_yaml_by_gstevenson.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Example configuration.yaml</h1>
<ul class='divided'>
<li>
<a href='https://gist.github.com/CCOSTAN/9934de973a293b809868'>Configuration.yaml by Carlo Costanzo <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/danichispa/hass'>Configuration.yaml by Danichispa <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/GreenTurtwig/personal-home-automation/tree/master/Home%20Assistant'>Configuration.yaml by GreenTurtwig <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/bah2830/Home-Assistant-Configs'>Configuration.yaml by bah2830 <i class="icon-external-link"></i></a>
</li>
<li>
<a href='/cookbook/configuration_yaml_from_bassclarinetl2/'>Configuration.yaml by bassclarinetl2</a>
</li>
<li>
<a href='https://github.com/brusc/Home-Assistant-Configuration'>Configuration.yaml by brusc <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/cbulock/home-assistant-configs'>Configuration.yaml by cbulock <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/geekofweek/homeassistant'>Configuration.yaml by geekofweek <i class="icon-external-link"></i></a>
</li>
<li>
Configuration.yaml by gstevenson
</li>
<li>
<a href='https://github.com/happyleavesaoc/my-home-automation/tree/master/homeassistant'>Configuration.yaml by happyleavesaoc <i class="icon-external-link"></i></a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,179 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Configuration.yaml by happyleavesaoc - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/configuration_yaml_by_happyleavesaoc/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Configuration.yaml by happyleavesaoc">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/configuration_yaml_by_happyleavesaoc/">
<meta property="og:type" content="article">
<meta property="og:description" content="">
<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="Configuration.yaml by happyleavesaoc">
<meta name="twitter:description" content="">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Configuration.yaml by Happyleavesaoc
</h1>
</header>
<hr class="divider">
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/configuration_yaml_by_happyleavesaoc.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Example configuration.yaml</h1>
<ul class='divided'>
<li>
<a href='https://gist.github.com/CCOSTAN/9934de973a293b809868'>Configuration.yaml by Carlo Costanzo <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/danichispa/hass'>Configuration.yaml by Danichispa <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/GreenTurtwig/personal-home-automation/tree/master/Home%20Assistant'>Configuration.yaml by GreenTurtwig <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/bah2830/Home-Assistant-Configs'>Configuration.yaml by bah2830 <i class="icon-external-link"></i></a>
</li>
<li>
<a href='/cookbook/configuration_yaml_from_bassclarinetl2/'>Configuration.yaml by bassclarinetl2</a>
</li>
<li>
<a href='https://github.com/brusc/Home-Assistant-Configuration'>Configuration.yaml by brusc <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/cbulock/home-assistant-configs'>Configuration.yaml by cbulock <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/geekofweek/homeassistant'>Configuration.yaml by geekofweek <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/gstevenson/ha-config'>Configuration.yaml by gstevenson <i class="icon-external-link"></i></a>
</li>
<li>
Configuration.yaml by happyleavesaoc
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,628 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Configuration.yaml by bassclarinetl2 - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/configuration_yaml_from_bassclarinetl2/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Configuration.yaml by bassclarinetl2">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/configuration_yaml_from_bassclarinetl2/">
<meta property="og:type" content="article">
<meta property="og:description" content="">
<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="Configuration.yaml by bassclarinetl2">
<meta name="twitter:description" content="">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Configuration.yaml by Bassclarinetl2
</h1>
</header>
<hr class="divider">
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="key">homeassistant</span>:
<span class="comment"># Name of the location where Home Assistant is running</span>
<span class="key">name</span>: <span class="string"><span class="content">example.com</span></span>
<span class="comment"># Location required to calculate the time the sun rises and sets</span>
<span class="key">latitude</span>: <span class="string"><span class="content">37</span></span>
<span class="key">longitude</span>: <span class="string"><span class="content">-121</span></span>
<span class="comment"># C for Celcius, F for Fahrenheit</span>
<span class="key">temperature_unit</span>: <span class="string"><span class="content">F</span></span>
<span class="comment"># Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones</span>
<span class="key">time_zone</span>: <span class="string"><span class="content">America/Los_Angeles</span></span>
<span class="key">customize</span>:
<span class="key">switch.aeon_labs_smart_energy_switch_switch_2</span>:
<span class="key">friendly_name</span>: <span class="string"><span class="content">Mac Switch-Meter</span></span>
<span class="key">switch.leviton_unknown_type1a02_id0334_switch_3</span>:
<span class="key">friendly_name</span>: <span class="string"><span class="content">W Nightstand</span></span>
<span class="key">entity_picture</span>: <span class="string"><span class="content">/local/zwvapl.jpg</span></span>
<span class="key">switch.hub_switch</span>:
<span class="key">friendly_name</span>: <span class="string"><span class="content">Wink Hub Switch</span></span>
<span class="key">entity_picture</span>: <span class="string"><span class="content">/local/wemoswitch.jpg</span></span>
<span class="key">switch.leviton_unknown_type1a02_id0334_switch_4</span>:
<span class="key">friendly_name</span>: <span class="string"><span class="content">Christmas Tree</span></span>
<span class="key">entity_picture</span>: <span class="string"><span class="content">/local/zwvapl.jpg</span></span>
<span class="key">switch.leviton_unknown_type1a02_id0334_switch_5</span>:
<span class="key">friendly_name</span>: <span class="string"><span class="content">Roof Lights</span></span>
<span class="key">entity_picture</span>: <span class="string"><span class="content">/local/zwvapl.jpg</span></span>
<span class="key">light.w_bedroom_ceiling_</span>:
<span class="key">friendly_name</span>: <span class="string"><span class="content">Will's Bedroom Ceiling Lights (Wink)</span></span>
<span class="key">entity_picture</span>: <span class="string"><span class="content">/local/casetta.jpg</span></span>
<span class="key">light.living_room_wall_</span>:
<span class="key">friendly_name</span>: <span class="string"><span class="content">Living Room Couch Lights (Wink)</span></span>
<span class="key">entity_picture</span>: <span class="string"><span class="content">/local/casetta.jpg</span></span>
<span class="key">media_player.my_shield_android_tv</span>:
<span class="key">friendly_name</span>: <span class="string"><span class="content">Dalek (Cast)</span></span>
<span class="key">entity_picture</span>: <span class="string"><span class="content">/local/shieldtv.jpg</span></span>
<span class="key">media_player.chromecast</span>:
<span class="key">friendly_name</span>: <span class="string"><span class="content">Jeff chromecast</span></span>
<span class="key">entity_picture</span>: <span class="string"><span class="content">/local/chromecast.jpg</span></span>
<span class="key">media_player.kodi</span>:
<span class="key">friendly_name</span>: <span class="string"><span class="content">Tardis-Win7 (Kodi)</span></span>
<span class="key">entity_picture</span>: <span class="string"><span class="content">/local/kodi.png</span></span>
<span class="key">media_player.kodi_2</span>:
<span class="key">friendly_name</span>: <span class="string"><span class="content">Dalek (Kodi)</span></span>
<span class="key">media_player.roku_2_xd__12a18n045363</span>:
<span class="key">friendly_name</span>: <span class="string"><span class="content">Parents Roku</span></span>
<span class="key">entity_picture</span>: <span class="string"><span class="content">/local/roku2xd.jpg</span></span>
<span class="key">sensor.aeon_labs_smart_energy_switch_power_2</span>:
<span class="key">friendly_name</span>: <span class="string"><span class="content">Mac Usage (W)</span></span>
<span class="key">sensor.aeon_labs_smart_energy_switch_previous_reading_2</span>:
<span class="key">friendly_name</span>: <span class="string"><span class="content">Mac Usage Previous (W)</span></span>
<span class="key">hidden</span>: <span class="string"><span class="content">true</span></span>
<span class="key">sensor.aeon_labs_smart_energy_switch_energy_2</span>:
<span class="key">friendly_name</span>: <span class="string"><span class="content">Mac Usage (kWh)</span></span>
<span class="key">hidden</span>: <span class="string"><span class="content">true</span></span>
<span class="comment">#####################</span>
<span class="comment">## GROUPS</span>
<span class="comment">#####################</span>
<span class="key">group</span>:
<span class="key">w_bedroom</span>:
- <span class="string"><span class="content">switch.leviton_unknown_type1a02_id0334_switch_3</span></span>
- <span class="string"><span class="content">light.w_bedroom_ceiling_</span></span>
<span class="key">christmas</span>:
- <span class="string"><span class="content">switch.leviton_unknown_type1a02_id0334_switch_4</span></span>
- <span class="string"><span class="content">switch.leviton_unknown_type1a02_id0334_switch_5</span></span>
<span class="key">almanac</span>:
- <span class="string"><span class="content">sensor.date</span></span>
- <span class="string"><span class="content">sensor.time</span></span>
- <span class="string"><span class="content">sensor.time_utc</span></span>
- <span class="string"><span class="content">sun.sun</span></span>
<span class="key">tracker</span>:
- <span class="string"><span class="content">device_tracker.will_wnexus</span></span>
<span class="comment"># OpenWeatherMap:</span>
<span class="comment"># - sensor.weather_temperature</span>
<span class="comment"># - sensor.weather_humidity</span>
<span class="comment"># - sensor.weather_pressure</span>
<span class="comment"># - sensor.weather_rain</span>
<span class="comment"># - sensor.weather_wind_speed</span>
<span class="comment"># - sensor.weather_cloud_coverage</span>
<span class="comment"># - sensor.weather_forecast</span>
<span class="key">Meteobridge</span>:
- <span class="string"><span class="content">sensor.outdoor_temp_meteobridge</span></span>
- <span class="string"><span class="content">sensor.outdoor_humidity_meteobridge</span></span>
- <span class="string"><span class="content">sensor.outdoor_dewpoint_meteobridge</span></span>
- <span class="string"><span class="content">sensor.precip_rate_meteobridge</span></span>
- <span class="string"><span class="content">sensor.wind_direction_meteobridge</span></span>
- <span class="string"><span class="content">sensor.wind_gust_meteohub</span></span>
- <span class="string"><span class="content">sensor.wind_chill_meteobridge</span></span>
- <span class="string"><span class="content">sensor.wind_speed_meteobridge</span></span>
- <span class="string"><span class="content">sensor.indoor_dewpoint_meteobridge</span></span>
- <span class="string"><span class="content">sensor.indoor_humidity_meteobridge</span></span>
- <span class="string"><span class="content">sensor.indoor_temp_meteobridge</span></span>
- <span class="string"><span class="content">sensor.precip_change_meteobridge</span></span>
- <span class="string"><span class="content">sensor.precip_total_meteobridge</span></span>
- <span class="string"><span class="content">sensor.sea_level_pressure_meteobridge</span></span>
- <span class="string"><span class="content">sensor.barometric_pressure_meteobridge</span></span>
<span class="comment">####################</span>
<span class="comment">## ZONES</span>
<span class="comment">####################</span>
<span class="key">zone</span>:
<span class="key">name</span>: <span class="string"><span class="content">Home</span></span>
<span class="key">latitude</span>: <span class="string"><span class="content">37</span></span>
<span class="key">longitude</span>: <span class="string"><span class="content">-121 </span></span>
<span class="key">radius</span>: <span class="string"><span class="content">200</span></span>
<span class="key">icon</span>: <span class="string"><span class="content">mdi:home</span></span>
<span class="key">zone 2</span>:
<span class="key">name</span>: <span class="string"><span class="content">Barracuda_(SJ)</span></span>
<span class="key">latitude</span>: <span class="string"><span class="content">37</span></span>
<span class="key">longitude</span>: <span class="string"><span class="content">-121</span></span>
<span class="key">radius</span>: <span class="string"><span class="content">100</span></span>
<span class="key">zone 3</span>:
<span class="key">name</span>: <span class="string"><span class="content">SFC</span></span>
<span class="key">latitude</span>: <span class="string"><span class="content">37</span></span>
<span class="key">longitude</span>: <span class="string"><span class="content">-122</span></span>
<span class="key">radius</span>: <span class="string"><span class="content">95</span></span>
<span class="comment">####################</span>
<span class="comment">## NOTIFICATIONS</span>
<span class="comment">####################</span>
<span class="comment">####################</span>
<span class="comment">## AUTOMATION</span>
<span class="comment">####################</span>
<span class="key">automation</span>:
<span class="comment">#- alias: 'W_at_work' </span>
<span class="comment"># trigger:</span>
<span class="comment"># - platform: zone</span>
<span class="comment"># entity_id: device_tracker.will_wnexus</span>
<span class="comment"># zone: zone.barracuda_sj</span>
<span class="comment"># event: enter</span>
<span class="comment"># - platform: time</span>
<span class="comment"># after: '07:15'</span>
<span class="comment"># before: '09:00'</span>
<span class="comment"># action:</span>
<span class="comment"># service: ifttt.trigger</span>
<span class="comment"># data: {&quot;event&quot;:&quot;hassnotification_dadsms&quot;, &quot;value1&quot;: &quot;Will's at Work&quot;}</span>
- <span class="string"><span class="content">alias: &quot;Update_Update&quot;</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">updater.updater</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">ifttt.trigger</span></span>
<span class="key">data</span>: <span class="string"><span class="content">{&quot;event&quot;:&quot;hassnotification_willsms&quot;,&quot;value1&quot;:&quot;HASS has an update&quot;}</span></span>
- <span class="string"><span class="content">alias: 'Christmas Roof ON'</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">sun</span></span>
<span class="key">event</span>: <span class="string"><span class="content">sunset</span></span>
<span class="key">offset</span>: <span class="string"><span class="content">'-01:00:00'</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">homeassistant.turn_on</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">switch.leviton_unknown_type1a02_id0334_switch_5</span></span>
- <span class="string"><span class="content">alias: 'Christmas Roof OFF'</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">time</span></span>
<span class="key">hours</span>: <span class="string"><span class="content">1</span></span>
<span class="key">minutes</span>: <span class="string"><span class="content">0</span></span>
<span class="key">seconds</span>: <span class="string"><span class="content">0</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">homeassistant.turn_off</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">switch.leviton_unknown_type1a02_id0334_switch_5</span></span>
- <span class="string"><span class="content">alias: 'Christmas Tree ON'</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">time</span></span>
<span class="key">hours</span>: <span class="string"><span class="content">8</span></span>
<span class="key">minutes</span>: <span class="string"><span class="content">0</span></span>
<span class="key">seconds</span>: <span class="string"><span class="content">0</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">homeassistant.turn_on</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">switch.leviton_unknown_type1a02_id0334_switch_4</span></span>
- <span class="string"><span class="content">alias: 'Christmas Tree (OFF)'</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">time</span></span>
<span class="key">hours</span>: <span class="string"><span class="content">23</span></span>
<span class="key">minutes</span>: <span class="string"><span class="content">0</span></span>
<span class="key">seconds</span>: <span class="string"><span class="content">0</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">homeassistant.turn_off</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">switch.leviton_unknown_type1a02_id0334_switch_4</span></span>
<span class="comment">#- alias: test notify</span>
<span class="comment"># trigger:</span>
<span class="comment"># platform: time</span>
<span class="comment"># minutes: '/5' #every 5 min</span>
<span class="comment"># action:</span>
<span class="comment"># service: notify.pushEtta</span>
<span class="comment"># data: </span>
<span class="comment"># message: 5 Min Test</span>
<span class="comment">#################################</span>
<span class="comment">### COMPONENTS ###</span>
<span class="comment">#################################</span>
<span class="comment">#discovery:</span>
<span class="key">sun</span>:
<span class="comment">#updater:</span>
<span class="key">history</span>:
<span class="comment">#conversation:</span>
<span class="key">frontend</span>:
<span class="key">logbook</span>:
<span class="key">http</span>:
<span class="key">api_password</span>: <span class="string"><span class="content">Austin12#</span></span>
<span class="key">server_port</span>: <span class="string"><span class="content">8123</span></span>
<span class="key">ssl_certificate</span>: <span class="string"><span class="content">/etc/letsencrypt/live/example.com/fullchain.pem</span></span>
<span class="key">ssl_key</span>: <span class="string"><span class="content">/etc/letsencrypt/live/example.com/privkey.pem</span></span>
<span class="key">ifttt</span>:
<span class="key">key</span>: <span class="string"><span class="content">[redacted]</span></span>
<span class="key">media_player 1</span>:
<span class="key">platform</span>: <span class="string"><span class="content">plex</span></span>
<span class="comment">#media_player 2: </span>
<span class="comment"># platform: squeezebox</span>
<span class="comment"># host: 192.168.2.80</span>
<span class="comment"># port: 9000</span>
<span class="key">media_player 3</span>:
<span class="key">platform</span>: <span class="string"><span class="content">cast</span></span>
<span class="key">media_player 4</span>:
<span class="key">platform</span>: <span class="string"><span class="content">kodi</span></span>
<span class="key">url</span>: <span class="string"><span class="content">http://192.168.2.129:8080/jsonrpc</span></span>
<span class="key">user</span>: <span class="string"><span class="content">kodi</span></span>
<span class="key">password</span>: <span class="string"><span class="content">kodi</span></span>
<span class="key">media_player 5</span>:
<span class="key">platform</span>: <span class="string"><span class="content">plex</span></span>
<span class="key">media_player 6</span>:
<span class="key">platform</span>: <span class="string"><span class="content">kodi</span></span>
<span class="key">url</span>: <span class="string"><span class="content">http://192.168.2.165/jsonrpc</span></span>
<span class="key">media_player 7</span>:
<span class="key">platform</span>: <span class="string"><span class="content">samsungtv</span></span>
<span class="key">host</span>: <span class="string"><span class="content">192.168.2.90</span></span>
<span class="key">name</span>: <span class="string"><span class="content">Parents TV</span></span>
<span class="key">wink</span>:
<span class="key">access_token</span>: <span class="string"><span class="content">[redacted]</span></span>
<span class="key">refresh_token</span>: <span class="string"><span class="content">[redacted]</span></span>
<span class="key">zwave</span>:
<span class="key">usb_path</span>: <span class="string"><span class="content">/dev/ttyUSB0</span></span>
<span class="key">config_path</span>: <span class="string"><span class="content">/usr/local/share/python-openzwave/config</span></span>
<span class="key">polling_interval</span>: <span class="string"><span class="content">10000</span></span>
<span class="comment">#zigbee:</span>
<span class="comment"># device: /dev/ttyUSB1</span>
<span class="comment"># baud: 115200</span>
<span class="key">mqtt</span>:
<span class="key">broker</span>: <span class="string"><span class="content">127.0.0.1</span></span>
<span class="key">port</span>: <span class="string"><span class="content">8883</span></span>
<span class="key">username</span>: <span class="string"><span class="content">[redacted]</span></span>
<span class="key">password</span>: <span class="string"><span class="content">[redacted]</span></span>
<span class="key">device_tracker 1</span>:
<span class="key">platform</span>: <span class="string"><span class="content">owntracks</span></span>
<span class="key">track_new_devices</span>: <span class="string"><span class="content">yes</span></span>
<span class="key">interval_seconds</span>: <span class="string"><span class="content">40</span></span>
<span class="key">consider_home</span>: <span class="string"><span class="content">120 </span></span>
<span class="key">device_tracker 2</span>:
<span class="key">platform</span>: <span class="string"><span class="content">nmap_tracker</span></span>
<span class="key">hosts</span>: <span class="string"><span class="content">192.168.2.0/24</span></span>
<span class="key">home_interval</span>: <span class="string"><span class="content">3</span></span>
<span class="comment">#sensor:</span>
<span class="comment"># platform: openweathermap</span>
<span class="comment"># api_key: [redacted]</span>
<span class="comment"># forecast: 1</span>
<span class="comment"># monitored_conditions:</span>
<span class="comment"># - temperature</span>
<span class="comment"># - wind_speed</span>
<span class="comment"># - humidity</span>
<span class="comment"># - pressure</span>
<span class="comment"># - clouds</span>
<span class="comment"># - rain</span>
<span class="key">sensor 2</span>:
<span class="key">platform</span>: <span class="string"><span class="content">time_date</span></span>
<span class="key">display_options</span>:
- <span class="string"><span class="content">'time'</span></span>
- <span class="string"><span class="content">'date'</span></span>
- <span class="string"><span class="content">'time_utc'</span></span>
<span class="comment">### BEGIN METEO SENSORS ###</span>
<span class="key">sensor 3</span>:
<span class="key">platform</span>: <span class="string"><span class="content">tcp</span></span>
<span class="key">name</span>: <span class="string"><span class="content">Outdoor Temp (Meteobridge)</span></span>
<span class="key">host</span>: <span class="string"><span class="content">192.168.2.82</span></span>
<span class="key">port</span>: <span class="string"><span class="content">5556</span></span>
<span class="key">timeout</span>: <span class="string"><span class="content">6</span></span>
<span class="key">payload</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Content-type: text/xml; charset=UTF-8\n\n</span><span class="delimiter">&quot;</span></span>
<span class="key">value_template</span>: <span class="string"><span class="delimiter">&quot;</span><span class="delimiter">&quot;</span></span>
<span class="key">unit</span>: <span class="string"><span class="content">C</span></span>
<span class="key">sensor 4</span>:
<span class="key">platform</span>: <span class="string"><span class="content">tcp</span></span>
<span class="key">name</span>: <span class="string"><span class="content">Outdoor Humidity (Meteobridge)</span></span>
<span class="key">host</span>: <span class="string"><span class="content">192.168.2.82</span></span>
<span class="key">port</span>: <span class="string"><span class="content">5556</span></span>
<span class="key">timeout</span>: <span class="string"><span class="content">6</span></span>
<span class="key">payload</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Content-type: text/xml; charset=UTF-8\n\n</span><span class="delimiter">&quot;</span></span>
<span class="key">value_template</span>: <span class="string"><span class="delimiter">&quot;</span><span class="delimiter">&quot;</span></span>
<span class="key">unit</span>: <span class="string"><span class="content">Percent</span></span>
<span class="key">sensor 5</span>:
<span class="key">platform</span>: <span class="string"><span class="content">tcp</span></span>
<span class="key">name</span>: <span class="string"><span class="content">Outdoor Dewpoint (Meteobridge)</span></span>
<span class="key">host</span>: <span class="string"><span class="content">192.168.2.82</span></span>
<span class="key">port</span>: <span class="string"><span class="content">5556</span></span>
<span class="key">timeout</span>: <span class="string"><span class="content">6</span></span>
<span class="key">payload</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Content-type: text/xml; charset=UTF-8\n\n</span><span class="delimiter">&quot;</span></span>
<span class="key">value_template</span>: <span class="string"><span class="delimiter">&quot;</span><span class="delimiter">&quot;</span></span>
<span class="key">unit</span>: <span class="string"><span class="content">C</span></span>
<span class="key">sensor 6</span>:
<span class="key">platform</span>: <span class="string"><span class="content">tcp</span></span>
<span class="key">name</span>: <span class="string"><span class="content">Wind Direction (Meteobridge)</span></span>
<span class="key">host</span>: <span class="string"><span class="content">192.168.2.82</span></span>
<span class="key">port</span>: <span class="string"><span class="content">5556</span></span>
<span class="key">timeout</span>: <span class="string"><span class="content">6</span></span>
<span class="key">payload</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Content-type: text/xml; charset=UTF-8\n\n</span><span class="delimiter">&quot;</span></span>
<span class="key">value_template</span>: <span class="string"><span class="delimiter">&quot;</span><span class="delimiter">&quot;</span></span>
<span class="key">unit</span>: <span class="string"><span class="content">Degrees</span></span>
<span class="key">sensor 7</span>:
<span class="key">platform</span>: <span class="string"><span class="content">tcp</span></span>
<span class="key">name</span>: <span class="string"><span class="content">Wind Gust (Meteohub)</span></span>
<span class="key">host</span>: <span class="string"><span class="content">192.168.2.82</span></span>
<span class="key">port</span>: <span class="string"><span class="content">5556</span></span>
<span class="key">timeout</span>: <span class="string"><span class="content">6</span></span>
<span class="key">payload</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Content-type: text/xml; charset=UTF-8\n\n</span><span class="delimiter">&quot;</span></span>
<span class="key">value_template</span>: <span class="string"><span class="delimiter">&quot;</span><span class="delimiter">&quot;</span></span>
<span class="key">unit</span>: <span class="string"><span class="content">m/s</span></span>
<span class="key">sensor 8</span>:
<span class="key">platform</span>: <span class="string"><span class="content">tcp</span></span>
<span class="key">name</span>: <span class="string"><span class="content">Wind Speed (Meteobridge)</span></span>
<span class="key">host</span>: <span class="string"><span class="content">192.168.2.82</span></span>
<span class="key">port</span>: <span class="string"><span class="content">5556</span></span>
<span class="key">timeout</span>: <span class="string"><span class="content">6</span></span>
<span class="key">payload</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Content-type: text/xml; charset=UTF-8\n\n</span><span class="delimiter">&quot;</span></span>
<span class="key">value_template</span>: <span class="string"><span class="delimiter">&quot;</span><span class="delimiter">&quot;</span></span>
<span class="key">unit</span>: <span class="string"><span class="content">m/s</span></span>
<span class="key">sensor 9</span>:
<span class="key">platform</span>: <span class="string"><span class="content">tcp</span></span>
<span class="key">name</span>: <span class="string"><span class="content">Wind Chill (Meteobridge)</span></span>
<span class="key">host</span>: <span class="string"><span class="content">192.168.2.82</span></span>
<span class="key">port</span>: <span class="string"><span class="content">5556</span></span>
<span class="key">timeout</span>: <span class="string"><span class="content">6</span></span>
<span class="key">payload</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Content-type: text/xml; charset=UTF-8\n\n</span><span class="delimiter">&quot;</span></span>
<span class="key">value_template</span>: <span class="string"><span class="delimiter">&quot;</span><span class="delimiter">&quot;</span></span>
<span class="key">unit</span>: <span class="string"><span class="content">C</span></span>
<span class="key">sensor 10</span>:
<span class="key">platform</span>: <span class="string"><span class="content">tcp</span></span>
<span class="key">name</span>: <span class="string"><span class="content">Precip Rate (Meteobridge)</span></span>
<span class="key">host</span>: <span class="string"><span class="content">192.168.2.82</span></span>
<span class="key">port</span>: <span class="string"><span class="content">5556</span></span>
<span class="key">timeout</span>: <span class="string"><span class="content">6</span></span>
<span class="key">payload</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Content-type: text/xml; charset=UTF-8\n\n</span><span class="delimiter">&quot;</span></span>
<span class="key">value_template</span>: <span class="string"><span class="delimiter">&quot;</span><span class="delimiter">&quot;</span></span>
<span class="key">unit</span>: <span class="string"><span class="content">mm/hr</span></span>
<span class="key">sensor 11</span>:
<span class="key">platform</span>: <span class="string"><span class="content">tcp</span></span>
<span class="key">name</span>: <span class="string"><span class="content">Precip Total (Meteobridge)</span></span>
<span class="key">host</span>: <span class="string"><span class="content">192.168.2.82</span></span>
<span class="key">port</span>: <span class="string"><span class="content">5556</span></span>
<span class="key">timeout</span>: <span class="string"><span class="content">6</span></span>
<span class="key">payload</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Content-type: text/xml; charaset=UTF-8\n\n</span><span class="delimiter">&quot;</span></span>
<span class="key">value_template</span>: <span class="string"><span class="delimiter">&quot;</span><span class="delimiter">&quot;</span></span>
<span class="key">unit</span>: <span class="string"><span class="content">mm</span></span>
<span class="key">sensor 12</span>:
<span class="key">platform</span>: <span class="string"><span class="content">tcp</span></span>
<span class="key">name</span>: <span class="string"><span class="content">Precip Change (Meteobridge)</span></span>
<span class="key">host</span>: <span class="string"><span class="content">192.168.2.82</span></span>
<span class="key">port</span>: <span class="string"><span class="content">5556</span></span>
<span class="key">timeout</span>: <span class="string"><span class="content">6</span></span>
<span class="key">payload</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Content-type: text/xml; charaset=UTF-8\n\n</span><span class="delimiter">&quot;</span></span>
<span class="key">value_template</span>: <span class="string"><span class="delimiter">&quot;</span><span class="delimiter">&quot;</span></span>
<span class="key">unit</span>: <span class="string"><span class="content">mm</span></span>
<span class="key">sensor 13</span>:
<span class="key">platform</span>: <span class="string"><span class="content">tcp</span></span>
<span class="key">name</span>: <span class="string"><span class="content">Indoor Temp (Meteobridge)</span></span>
<span class="key">host</span>: <span class="string"><span class="content">192.168.2.82</span></span>
<span class="key">port</span>: <span class="string"><span class="content">5556</span></span>
<span class="key">timeout</span>: <span class="string"><span class="content">6</span></span>
<span class="key">payload</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Content-type: text/xml; charaset=UTF-8\n\n</span><span class="delimiter">&quot;</span></span>
<span class="key">value_template</span>: <span class="string"><span class="delimiter">&quot;</span><span class="delimiter">&quot;</span></span>
<span class="key">unit</span>: <span class="string"><span class="content">C</span></span>
<span class="key">sensor 14</span>:
<span class="key">platform</span>: <span class="string"><span class="content">tcp</span></span>
<span class="key">name</span>: <span class="string"><span class="content">Indoor Humidity (Meteobridge)</span></span>
<span class="key">host</span>: <span class="string"><span class="content">192.168.2.82</span></span>
<span class="key">port</span>: <span class="string"><span class="content">5556</span></span>
<span class="key">timeout</span>: <span class="string"><span class="content">6</span></span>
<span class="key">payload</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Content-type: text/xml; charaset=UTF-8\n\n</span><span class="delimiter">&quot;</span></span>
<span class="key">value_template</span>: <span class="string"><span class="delimiter">&quot;</span><span class="delimiter">&quot;</span></span>
<span class="key">unit</span>: <span class="string"><span class="content">percent</span></span>
<span class="key">sensor 15</span>:
<span class="key">platform</span>: <span class="string"><span class="content">tcp</span></span>
<span class="key">name</span>: <span class="string"><span class="content">Indoor Dewpoint (Meteobridge)</span></span>
<span class="key">host</span>: <span class="string"><span class="content">192.168.2.82</span></span>
<span class="key">port</span>: <span class="string"><span class="content">5556</span></span>
<span class="key">timeout</span>: <span class="string"><span class="content">6</span></span>
<span class="key">payload</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Content-type: text/xml; charaset=UTF-8\n\n</span><span class="delimiter">&quot;</span></span>
<span class="key">value_template</span>: <span class="string"><span class="delimiter">&quot;</span><span class="delimiter">&quot;</span></span>
<span class="key">unit</span>: <span class="string"><span class="content">C</span></span>
<span class="key">sensor 16</span>:
<span class="key">platform</span>: <span class="string"><span class="content">tcp</span></span>
<span class="key">name</span>: <span class="string"><span class="content">Barometric Pressure (Meteobridge)</span></span>
<span class="key">host</span>: <span class="string"><span class="content">192.168.2.82</span></span>
<span class="key">port</span>: <span class="string"><span class="content">5556</span></span>
<span class="key">timeout</span>: <span class="string"><span class="content">6</span></span>
<span class="key">payload</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Content-type: text/xml; charaset=UTF-8\n\n</span><span class="delimiter">&quot;</span></span>
<span class="key">value_template</span>: <span class="string"><span class="delimiter">&quot;</span><span class="delimiter">&quot;</span></span>
<span class="key">unit</span>: <span class="string"><span class="content">mb</span></span>
<span class="key">sensor 17</span>:
<span class="key">platform</span>: <span class="string"><span class="content">tcp</span></span>
<span class="key">name</span>: <span class="string"><span class="content">Sea Level Pressure (Meteobridge)</span></span>
<span class="key">host</span>: <span class="string"><span class="content">192.168.2.82</span></span>
<span class="key">port</span>: <span class="string"><span class="content">5556</span></span>
<span class="key">timeout</span>: <span class="string"><span class="content">6</span></span>
<span class="key">payload</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Content-type: text/xml; charaset=UTF-8\n\n</span><span class="delimiter">&quot;</span></span>
<span class="key">value_template</span>: <span class="string"><span class="delimiter">&quot;</span><span class="delimiter">&quot;</span></span>
<span class="key">unit</span>: <span class="string"><span class="content">mb</span></span>
<span class="key">sensor 18</span>:
<span class="key">platform</span>: <span class="string"><span class="content">steam_online</span></span>
<span class="key">api_key</span>: <span class="string"><span class="content">[Redact]</span></span>
<span class="key">accounts</span>:
- <span class="string"><span class="content">76561198012067051 </span></span>
<span class="key">switch</span>:
<span class="key">platform</span>: <span class="string"><span class="content">wemo</span></span>
</pre></div>
</div>
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/configuration_yaml_from_bassclarinetl2.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Example configuration.yaml</h1>
<ul class='divided'>
<li>
<a href='https://gist.github.com/CCOSTAN/9934de973a293b809868'>Configuration.yaml by Carlo Costanzo <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/danichispa/hass'>Configuration.yaml by Danichispa <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/GreenTurtwig/personal-home-automation/tree/master/Home%20Assistant'>Configuration.yaml by GreenTurtwig <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/bah2830/Home-Assistant-Configs'>Configuration.yaml by bah2830 <i class="icon-external-link"></i></a>
</li>
<li>
Configuration.yaml by bassclarinetl2
</li>
<li>
<a href='https://github.com/brusc/Home-Assistant-Configuration'>Configuration.yaml by brusc <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/cbulock/home-assistant-configs'>Configuration.yaml by cbulock <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/geekofweek/homeassistant'>Configuration.yaml by geekofweek <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/gstevenson/ha-config'>Configuration.yaml by gstevenson <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/happyleavesaoc/my-home-automation/tree/master/homeassistant'>Configuration.yaml by happyleavesaoc <i class="icon-external-link"></i></a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,261 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Dim lights when playing media - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Dim lights up or down when playing media">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/dim_lights_when_playing_media/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Dim lights when playing media">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/dim_lights_when_playing_media/">
<meta property="og:type" content="article">
<meta property="og:description" content="Dim lights up or down when playing media">
<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="Dim lights when playing media">
<meta name="twitter:description" content="Dim lights up or down when playing media">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Dim Lights When Playing Media
</h1>
</header>
<hr class="divider">
<p>Like it how the lights dim up/down at the movies? Do it at home as well!</p>
<p>This example uses the media player, Philips Hue (transitions) and the sun component. Well use actions to detect media player state changes and scenes to control multiple lights, color settings and transition between scenes.</p>
<h4><a class="title-link" name="scenes" href="#scenes"></a> Scenes</h4>
<p>One scene for normal light, one for when movies are on. A 2 second transition gives a nice feel to the switch.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="key">scene</span>:
- <span class="string"><span class="content">name: Livingroom normal</span></span>
<span class="key">entities</span>:
<span class="key">light.light1</span>:
<span class="key">state</span>: <span class="string"><span class="content">on</span></span>
<span class="key">transition</span>: <span class="string"><span class="content">2</span></span>
<span class="key">brightness</span>: <span class="string"><span class="content">150</span></span>
<span class="key">xy_color</span>: <span class="string"><span class="content">[ 0.4448, 0.4066 ]</span></span>
<span class="key">light.light2</span>:
<span class="key">state</span>: <span class="string"><span class="content">on</span></span>
<span class="key">transition</span>: <span class="string"><span class="content">2</span></span>
<span class="key">brightness</span>: <span class="string"><span class="content">215</span></span>
<span class="key">xy_color</span>: <span class="string"><span class="content">[ 0.4448, 0.4066 ]</span></span>
- <span class="string"><span class="content">name: Livingroom dim</span></span>
<span class="key">entities</span>:
<span class="key">light.light1</span>:
<span class="key">state</span>: <span class="string"><span class="content">on</span></span>
<span class="key">transition</span>: <span class="string"><span class="content">2</span></span>
<span class="key">brightness</span>: <span class="string"><span class="content">75</span></span>
<span class="key">xy_color</span>: <span class="string"><span class="content">[ 0.5926, 0.3814 ]</span></span>
<span class="key">light.light2</span>:
<span class="key">state</span>: <span class="string"><span class="content">on</span></span>
<span class="key">transition</span>: <span class="string"><span class="content">2</span></span>
<span class="key">brightness</span>: <span class="string"><span class="content">145</span></span>
<span class="key">xy_color</span>: <span class="string"><span class="content">[ 0.5529, 0.4107 ]</span></span>
</pre></div>
</div>
</div>
<h4><a class="title-link" name="automation" href="#automation"></a> Automation</h4>
<p>The paused/stopped state is best matched using “from: playing”. Adding in the sun condition as we only want this when its dark.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="key">automation</span>:
- <span class="string"><span class="content">alias: &quot;Media player paused/stopped&quot;</span></span>
<span class="key">trigger</span>:
- <span class="string"><span class="content">platform: state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">media_player.htpc</span></span>
<span class="key">from</span>: <span class="string"><span class="content">'playing'</span></span>
<span class="key">condition</span>:
- <span class="string"><span class="content">condition: state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">sun.sun</span></span>
<span class="key">state</span>: <span class="string"><span class="content">'below_horizon'</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">scene.turn_on</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">scene.livingroom_normal</span></span>
- <span class="string"><span class="content">alias: &quot;Media player playing&quot;</span></span>
<span class="key">trigger</span>:
- <span class="string"><span class="content">platform: state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">media_player.htpc</span></span>
<span class="key">to</span>: <span class="string"><span class="content">'playing'</span></span>
<span class="key">condition</span>:
- <span class="string"><span class="content">condition: state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">sun.sun</span></span>
<span class="key">state</span>: <span class="string"><span class="content">'below_horizon'</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">scene.turn_on</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">scene.livingroom_dim</span></span>
</pre></div>
</div>
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/dim_lights_when_playing_media.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Automation Examples</h1>
<ul class='divided'>
<li>
<a href='/cookbook/automation_for_rainy_days/'>Automation for rainy days</a>
</li>
<li>
Dim lights when playing media
</li>
<li>
<a href='/cookbook/basic_example_use_trigger_values/'>Example using use_trigger_values</a>
</li>
<li>
<a href='/cookbook/automation_flashing_lights/'>Examples for flashing lights</a>
</li>
<li>
<a href='/cookbook/automation_sun/'>Examples using the sun</a>
</li>
<li>
<a href='/cookbook/foscam_away_mode_PTZ/'>Foscam Recording during Away Mode Only using Pan/Tilt/Zoom Control and Motion Detection</a>
</li>
<li>
<a href='/cookbook/perform_actions_based_on_input_select/'>Perform actions based on input select</a>
</li>
<li>
<a href='/cookbook/restart_ha_if_wemo_switch_is_not_detected/'>Restart Home Assistant if Wemo Switch is not detected</a>
</li>
<li>
<a href='/cookbook/send_a_reminder/'>Send a reminder</a>
</li>
<li>
<a href='/cookbook/notify_if_over_threshold/'>Send notification based on sensor</a>
</li>
<li>
<a href='/cookbook/notify_if__new_ha_release/'>Send notification if new Home Assistant release</a>
</li>
<li>
<a href='/cookbook/track_battery_level/'>Track your battery level</a>
</li>
<li>
<a href='/cookbook/turn_on_light_for_10_minutes_when_motion_detected/'>Turn on lights for 10 minutes after motion detected</a>
</li>
<li>
<a href='/cookbook/automation_using_timeinterval_inputboolean/'>Using time interval and input boolean</a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,270 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Foscam Recording during Away Mode Only using Pan/Tilt/Zoom Control and Motion Detection - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Example of how to set Foscam to only have Motion Detection Recording while no one is home. When users are home the Foscam will indicate it is not r...">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/foscam_away_mode_PTZ/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Foscam Recording during Away Mode Only using Pan/Tilt/Zoom Control and Motion Detection">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/foscam_away_mode_PTZ/">
<meta property="og:type" content="article">
<meta property="og:description" content="Example of how to set Foscam to only have Motion Detection Recording while no one is home. When users are home the Foscam will indicate it is not recording by pointing down and away from users">
<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="Foscam Recording during Away Mode Only using Pan/Tilt/Zoom Control and Motion Detection">
<meta name="twitter:description" content="Example of how to set Foscam to only have Motion Detection Recording while no one is home. When users are home the Foscam will indicate it is not recording by pointing down and away from users">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Foscam Recording During Away Mode Only Using Pan/Tilt/Zoom Control and Motion Detection
</h1>
</header>
<hr class="divider">
<p>This requires a <a href="/components/camera.foscam/">Foscam IP Camera</a> camera with PTZ (Pan, Tilt, Zoom) and CGI functionality (<a href="http://www.ipcamcontrol.net/files/Foscam%20IPCamera%20CGI%20User%20Guide-V1.0.4.pdf">Source</a>)</p>
<p>Foscam Cameras can be controlled by Home Assistant through a number of CGI commands. <br />
The following outlines examples of the switch, services, and scripts required to move between 2 preset destinations while controlling motion detection, but many other options of movement are provided in the Foscam CGI User Guide linked above.</p>
<p>The <code>switch.foscam_motion</code> will control whether the motion detection is on or off. This switch supports <code>statecmd</code>, which checks the current state of motion detection.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="comment"># Replace admin and password with an &quot;Admin&quot; priviledged Foscam user</span>
<span class="comment"># Replace ipaddress with the local IP address of your Foscam</span>
<span class="key">switch</span>:
<span class="key">platform</span>: <span class="string"><span class="content">command_line</span></span>
<span class="key">switches</span>:
<span class="comment">#Switch for Foscam Motion Detection</span>
<span class="key">foscam_motion</span>:
<span class="key">oncmd</span>: <span class="string"><span class="content">'curl -k &quot;https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig&amp;isEnable=1&amp;usr=admin&amp;pwd=password&quot;'</span></span>
<span class="key">offcmd</span>: <span class="string"><span class="content">'curl -k &quot;https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig&amp;isEnable=0&amp;usr=admin&amp;pwd=password&quot;'</span></span>
<span class="key">statecmd</span>: <span class="string"><span class="content">'curl -k --silent &quot;https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=getMotionDetectConfig&amp;usr=admin&amp;pwd=password&quot; | grep -oP &quot;(?&lt;=isEnable&gt;).*?(?=&lt;/isEnable&gt;)&quot;'</span></span>
<span class="key">value_template</span>: <span class="string"><span class="content">''</span></span>
</pre></div>
</div>
</div>
<p>The service <code>shell_command.foscam_turn_off</code> sets the camera to point down and away to indicate it is not recording, and <code>shell_command.foscam_turn_on</code> sets the camera to point where Id like to record. h of these services require preset points to be added to your camera. See source above for additional information.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="key">shell_command</span>:
<span class="comment">#Created a preset point in Foscam Web Interface named Off which essentially points the camera down and away</span>
<span class="key">foscam_turn_off</span>: <span class="string"><span class="content">'curl -k &quot;https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=ptzGotoPresetPoint&amp;name=Off&amp;usr=admin&amp;pwd=password&quot;'</span></span>
<span class="comment">#Created a preset point in Foscam Web Interface named Main which points in the direction I would like to record</span>
<span class="key">foscam_turn_on</span>: <span class="string"><span class="content">'curl -k &quot;https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=ptzGotoPresetPoint&amp;name=Main&amp;usr=admin&amp;pwd=password&quot;'</span></span>
</pre></div>
</div>
</div>
<p>The <code>script.foscam_off</code> and <code>script.foscam_on</code> can be used to set the motion detection appropriately, and then move the camera. These scripts can be called as part of an automation with <code>device_tracker</code> triggers to set <code>home</code> and <code>not_home</code> modes for your Foscam and disable motion detection recording while <code>home</code>.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="key">script</span>:
<span class="key">foscam_off</span>:
<span class="key">sequence</span>:
- <span class="string"><span class="content">service: switch.turn_off</span></span>
<span class="key">data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">switch.foscam_motion</span></span>
- <span class="string"><span class="content">service: shell_command.foscam_turn_off</span></span>
<span class="key">foscam_on</span>:
<span class="key">sequence</span>:
- <span class="string"><span class="content">service: switch.turn_off</span></span>
<span class="key">data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">switch.foscam_motion</span></span>
- <span class="string"><span class="content">service: shell_command.foscam_turn_on</span></span>
- <span class="string"><span class="content">service: switch.turn_on</span></span>
<span class="key">data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">switch.foscam_motion</span></span>
</pre></div>
</div>
</div>
<p>To automate Foscam being set to “on” (facing the correct way with motion sensor on), I used the following simple automation:</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="key">automation</span>:
- <span class="string"><span class="content">alias: Set Foscam to Away Mode when I leave home</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">group.family</span></span>
<span class="key">from</span>: <span class="string"><span class="content">'home'</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">script.foscam_on</span></span>
- <span class="string"><span class="content">alias: Set Foscam to Home Mode when I arrive Home</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">group.family</span></span>
<span class="key">to</span>: <span class="string"><span class="content">'home'</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">script.foscam_off</span></span>
</pre></div>
</div>
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/foscam_away_mode_PTZ.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Automation Examples</h1>
<ul class='divided'>
<li>
<a href='/cookbook/automation_for_rainy_days/'>Automation for rainy days</a>
</li>
<li>
<a href='/cookbook/dim_lights_when_playing_media/'>Dim lights when playing media</a>
</li>
<li>
<a href='/cookbook/basic_example_use_trigger_values/'>Example using use_trigger_values</a>
</li>
<li>
<a href='/cookbook/automation_flashing_lights/'>Examples for flashing lights</a>
</li>
<li>
<a href='/cookbook/automation_sun/'>Examples using the sun</a>
</li>
<li>
Foscam Recording during Away Mode Only using Pan/Tilt/Zoom Control and Motion Detection
</li>
<li>
<a href='/cookbook/perform_actions_based_on_input_select/'>Perform actions based on input select</a>
</li>
<li>
<a href='/cookbook/restart_ha_if_wemo_switch_is_not_detected/'>Restart Home Assistant if Wemo Switch is not detected</a>
</li>
<li>
<a href='/cookbook/send_a_reminder/'>Send a reminder</a>
</li>
<li>
<a href='/cookbook/notify_if_over_threshold/'>Send notification based on sensor</a>
</li>
<li>
<a href='/cookbook/notify_if__new_ha_release/'>Send notification if new Home Assistant release</a>
</li>
<li>
<a href='/cookbook/track_battery_level/'>Track your battery level</a>
</li>
<li>
<a href='/cookbook/turn_on_light_for_10_minutes_when_motion_detected/'>Turn on lights for 10 minutes after motion detected</a>
</li>
<li>
<a href='/cookbook/automation_using_timeinterval_inputboolean/'>Using time interval and input boolean</a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

263
cookbook/index.html Normal file
View file

@ -0,0 +1,263 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Cookbook - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Community maintained list of different ways to use Home Assistant.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Cookbook">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/">
<meta property="og:type" content="website">
<meta property="og:description" content="Community maintained list of different ways to use 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="Cookbook">
<meta name="twitter:description" content="Community maintained list of different ways to use 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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Cookbook
</h1>
</header>
<hr class="divider">
<p>This is a community curated list of different ways to use Home Assistant. Most of these examples are using the <a href="/getting-started/automation/">automation</a> component and other built-in <a href="/components/#automation">automation related</a> and <a href="/components/#organization">organization</a> components available.</p>
<p>New recipes can be added via the <a href="https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook">home-assistant.io repository</a>.</p>
<h3><a class="title-link" name="automation-examples" href="#automation-examples"></a> Automation Examples</h3>
<ul>
<li>
<p><a href="/cookbook/automation_for_rainy_days/">Automation for rainy days</a></p>
</li>
<li>
<p><a href="/cookbook/dim_lights_when_playing_media/">Dim lights when playing media</a></p>
</li>
<li>
<p><a href="/cookbook/basic_example_use_trigger_values/">Example using use_trigger_values</a></p>
</li>
<li>
<p><a href="/cookbook/automation_flashing_lights/">Examples for flashing lights</a></p>
</li>
<li>
<p><a href="/cookbook/automation_sun/">Examples using the sun</a></p>
</li>
<li>
<p><a href="/cookbook/foscam_away_mode_PTZ/">Foscam Recording during Away Mode Only using Pan/Tilt/Zoom Control and Motion Detection</a></p>
</li>
<li>
<p><a href="/cookbook/perform_actions_based_on_input_select/">Perform actions based on input select</a></p>
</li>
<li>
<p><a href="/cookbook/restart_ha_if_wemo_switch_is_not_detected/">Restart Home Assistant if Wemo Switch is not detected</a></p>
</li>
<li>
<p><a href="/cookbook/send_a_reminder/">Send a reminder</a></p>
</li>
<li>
<p><a href="/cookbook/notify_if_over_threshold/">Send notification based on sensor</a></p>
</li>
<li>
<p><a href="/cookbook/notify_if__new_ha_release/">Send notification if new Home Assistant release</a></p>
</li>
<li>
<p><a href="/cookbook/track_battery_level/">Track your battery level</a></p>
</li>
<li>
<p><a href="/cookbook/turn_on_light_for_10_minutes_when_motion_detected/">Turn on lights for 10 minutes after motion detected</a></p>
</li>
<li>
<p><a href="/cookbook/automation_using_timeinterval_inputboolean/">Using time interval and input boolean</a></p>
</li>
</ul>
<h3><a class="title-link" name="automation-in-python-examples" href="#automation-in-python-examples"></a> Automation in Python Examples</h3>
<ul>
<li><a href="/cookbook/python_component_simple_alarm/">Flash lights when intruder detected</a></li>
</ul>
<h3><a class="title-link" name="custom-python-component-examples" href="#custom-python-component-examples"></a> Custom Python Component Examples</h3>
<ul>
<li>
<p><a href="/cookbook/python_component_mqtt_basic/">Basic MQTT Example</a></p>
</li>
<li>
<p><a href="/cookbook/python_component_basic_service/">Basic Service Example</a></p>
</li>
<li>
<p><a href="/cookbook/python_component_basic_state/">Basic State Setting Example</a></p>
</li>
</ul>
<h3><a class="title-link" name="example-configurationyaml" href="#example-configurationyaml"></a> Example configuration.yaml</h3>
<ul>
<li>
<p><a href="https://gist.github.com/CCOSTAN/9934de973a293b809868">Configuration.yaml by Carlo Costanzo <i class="icon-external-link"></i></a></p>
</li>
<li>
<p><a href="https://github.com/danichispa/hass">Configuration.yaml by Danichispa <i class="icon-external-link"></i></a></p>
</li>
<li>
<p><a href="https://github.com/GreenTurtwig/personal-home-automation/tree/master/Home%20Assistant">Configuration.yaml by GreenTurtwig <i class="icon-external-link"></i></a></p>
</li>
<li>
<p><a href="https://github.com/bah2830/Home-Assistant-Configs">Configuration.yaml by bah2830 <i class="icon-external-link"></i></a></p>
</li>
<li>
<p><a href="/cookbook/configuration_yaml_from_bassclarinetl2/">Configuration.yaml by bassclarinetl2</a></p>
</li>
<li>
<p><a href="https://github.com/brusc/Home-Assistant-Configuration">Configuration.yaml by brusc <i class="icon-external-link"></i></a></p>
</li>
<li>
<p><a href="https://github.com/cbulock/home-assistant-configs">Configuration.yaml by cbulock <i class="icon-external-link"></i></a></p>
</li>
<li>
<p><a href="https://github.com/geekofweek/homeassistant">Configuration.yaml by geekofweek <i class="icon-external-link"></i></a></p>
</li>
<li>
<p><a href="https://github.com/gstevenson/ha-config">Configuration.yaml by gstevenson <i class="icon-external-link"></i></a></p>
</li>
<li>
<p><a href="https://github.com/happyleavesaoc/my-home-automation/tree/master/homeassistant">Configuration.yaml by happyleavesaoc <i class="icon-external-link"></i></a></p>
</li>
</ul>
<h3><a class="title-link" name="infrastructure" href="#infrastructure"></a> Infrastructure</h3>
<ul>
<li>
<p><a href="/cookbook/apache_configuration/">Apache Configuration</a></p>
</li>
<li>
<p><a href="/cookbook/tor_configuration/">Tor Onion Service Configuration</a></p>
</li>
</ul>
<h3><a class="title-link" name="jupyter-notebooks" href="#jupyter-notebooks"></a> Jupyter Notebooks</h3>
<ul>
<li>
<p><a href="https://github.com/home-assistant/home-assistant-notebooks/blob/master/database-examples.ipynb">Jupyter Notebooks Database <i class="icon-external-link"></i></a></p>
</li>
<li>
<p><a href="https://github.com/home-assistant/home-assistant-notebooks/blob/master/graph-single-sensor.ipynb">Jupyter Notebooks Graph <i class="icon-external-link"></i></a></p>
</li>
<li>
<p><a href="/cookbook/jupyther_notebooks_introduction/">Jupyter Notebooks Introduction</a></p>
</li>
<li>
<p><a href="https://github.com/home-assistant/home-assistant-notebooks/blob/master/home-assistant-python-api.ipynb">Notebook for Home Assistant Python API <i class="icon-external-link"></i></a></p>
</li>
</ul>
</article>
</div>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,161 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Notebook for Home Assistant Python API - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Basic example how to work with the Home Assistant Python API in a Jupyter notebook.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/jupyther_notebooks_api/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Notebook for Home Assistant Python API">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/jupyther_notebooks_api/">
<meta property="og:type" content="article">
<meta property="og:description" content="Basic example how to work with the Home Assistant Python API in a Jupyter notebook.">
<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="Notebook for Home Assistant Python API">
<meta name="twitter:description" content="Basic example how to work with the Home Assistant Python API in a Jupyter notebook.">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Notebook for Home Assistant Python API
</h1>
</header>
<hr class="divider">
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/jupyther_notebooks_api.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Jupyter Notebooks</h1>
<ul class='divided'>
<li>
<a href='https://github.com/home-assistant/home-assistant-notebooks/blob/master/database-examples.ipynb'>Jupyter Notebooks Database <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/home-assistant/home-assistant-notebooks/blob/master/graph-single-sensor.ipynb'>Jupyter Notebooks Graph <i class="icon-external-link"></i></a>
</li>
<li>
<a href='/cookbook/jupyther_notebooks_introduction/'>Jupyter Notebooks Introduction</a>
</li>
<li>
Notebook for Home Assistant Python API
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,161 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Jupyter Notebooks Database - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Basic example how to work with stored Home Assistant information in a Jupyter notebook.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/jupyther_notebooks_database/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Jupyter Notebooks Database">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/jupyther_notebooks_database/">
<meta property="og:type" content="article">
<meta property="og:description" content="Basic example how to work with stored Home Assistant information in a Jupyter notebook.">
<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="Jupyter Notebooks Database">
<meta name="twitter:description" content="Basic example how to work with stored Home Assistant information in a Jupyter notebook.">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Jupyter Notebooks Database
</h1>
</header>
<hr class="divider">
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/jupyther_notebooks_database.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Jupyter Notebooks</h1>
<ul class='divided'>
<li>
Jupyter Notebooks Database
</li>
<li>
<a href='https://github.com/home-assistant/home-assistant-notebooks/blob/master/graph-single-sensor.ipynb'>Jupyter Notebooks Graph <i class="icon-external-link"></i></a>
</li>
<li>
<a href='/cookbook/jupyther_notebooks_introduction/'>Jupyter Notebooks Introduction</a>
</li>
<li>
<a href='https://github.com/home-assistant/home-assistant-notebooks/blob/master/home-assistant-python-api.ipynb'>Notebook for Home Assistant Python API <i class="icon-external-link"></i></a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,161 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Jupyter Notebooks Graph - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Basic example how to create a graph with a Jupyter notebook.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/jupyther_notebooks_graph/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Jupyter Notebooks Graph">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/jupyther_notebooks_graph/">
<meta property="og:type" content="article">
<meta property="og:description" content="Basic example how to create a graph with a Jupyter notebook.">
<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="Jupyter Notebooks Graph">
<meta name="twitter:description" content="Basic example how to create a graph with a Jupyter notebook.">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Jupyter Notebooks Graph
</h1>
</header>
<hr class="divider">
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/jupyther_notebooks_graph.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Jupyter Notebooks</h1>
<ul class='divided'>
<li>
<a href='https://github.com/home-assistant/home-assistant-notebooks/blob/master/database-examples.ipynb'>Jupyter Notebooks Database <i class="icon-external-link"></i></a>
</li>
<li>
Jupyter Notebooks Graph
</li>
<li>
<a href='/cookbook/jupyther_notebooks_introduction/'>Jupyter Notebooks Introduction</a>
</li>
<li>
<a href='https://github.com/home-assistant/home-assistant-notebooks/blob/master/home-assistant-python-api.ipynb'>Notebook for Home Assistant Python API <i class="icon-external-link"></i></a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,205 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Jupyter Notebooks Introduction - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Setup and first steps for Jupyter Notebooks and Home Assistant.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/jupyther_notebooks_introduction/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Jupyter Notebooks Introduction">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/jupyther_notebooks_introduction/">
<meta property="og:type" content="article">
<meta property="og:description" content="Setup and first steps for Jupyter Notebooks and 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="Jupyter Notebooks Introduction">
<meta name="twitter:description" content="Setup and first steps for Jupyter Notebooks and 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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Jupyter Notebooks Introduction
</h1>
</header>
<hr class="divider">
<p>The <a href="http://jupyter.org/">Jupyter Notebooks</a> allows you to create and share documents that contain live code, equations, visualizations, and explanatory text directly in your browser. The web application what is formerly known as the IPython Notebook supports over 40 programming languages.</p>
<p>Visit <a href="https://try.jupyter.org/">https://try.jupyter.org/</a> to get a preview before you install it locally.</p>
<p>The very first step is to install the requirement to run Jupyter Notebooks.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre>$ pip3 install jupyter matplotlib
</pre></div>
</div>
</div>
<p class="note warning">
Certain notebooks hosted in the <a href="https://github.com/home-assistant/home-assistant-notebooks">Home Assistant notebooks repository</a> require access to a running Home Assistant instance or parts of a Home Assistant installation. If you want to run those notebooks install Home Assistant with <code>$ pip3 install homeassistant</code> as well.
</p>
<p>Now you are able to start the application.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre>$ jupyter notebook
[I 17:22:18.081 NotebookApp] Writing notebook server cookie secret to /run/user/1000/jupyter/notebook_cookie_secret
[I 17:22:18.921 NotebookApp] Serving notebooks from local directory: /home/fabaff/home-assistant
[I 17:22:18.921 NotebookApp] 0 active kernels
[I 17:22:18.921 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/
[I 17:22:18.922 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
</pre></div>
</div>
</div>
<p>Open <a href="http://localhost:8888/">http://localhost:8888/</a> in your browser. Press “New” -&gt; “Python3” to open a new notebook.</p>
<p class="img">
<img src="/images/screenshots/jupyter-new.png" />
</p>
<p>You will get an emtpy notebook with one cell. Cells can contain code or text. To get the output of a cell you need to execute them with “Cell” -&gt; “Run Cells” from the menu or by pressing the icon.</p>
<p class="img">
<img src="/images/screenshots/jupyter-notebook.png" />
</p>
<p>The downloadable version of this notebook is available in the <a href="https://github.com/home-assistant/home-assistant-notebooks/blob/master/first-notebook.ipynb">Home Assistant notebooks repository</a>.</p>
<p>As you can see is the workflow very similar to working directly with a Python shell. One advantage is that you can go back and forth as you please and save your 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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/jupyther_notebooks_introduction.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Jupyter Notebooks</h1>
<ul class='divided'>
<li>
<a href='https://github.com/home-assistant/home-assistant-notebooks/blob/master/database-examples.ipynb'>Jupyter Notebooks Database <i class="icon-external-link"></i></a>
</li>
<li>
<a href='https://github.com/home-assistant/home-assistant-notebooks/blob/master/graph-single-sensor.ipynb'>Jupyter Notebooks Graph <i class="icon-external-link"></i></a>
</li>
<li>
Jupyter Notebooks Introduction
</li>
<li>
<a href='https://github.com/home-assistant/home-assistant-notebooks/blob/master/home-assistant-python-api.ipynb'>Notebook for Home Assistant Python API <i class="icon-external-link"></i></a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,212 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Send notification if new Home Assistant release - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Basic example of how to send a notification if a new Home Assistant release is available">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/notify_if__new_ha_release/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Send notification if new Home Assistant release">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/notify_if__new_ha_release/">
<meta property="og:type" content="article">
<meta property="og:description" content="Basic example of how to send a notification if a new Home Assistant release is available">
<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="Send notification if new Home Assistant release">
<meta name="twitter:description" content="Basic example of how to send a notification if a new Home Assistant release is available">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Send Notification if New Home Assistant Release
</h1>
</header>
<hr class="divider">
<p>The following example sends a notification via XMPP if a new Home Assistant release is available:</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="key">notify</span>:
- <span class="string"><span class="content">platform: xmpp</span></span>
<span class="key">name</span>: <span class="string"><span class="content">jabber</span></span>
<span class="key">sender</span>: <span class="string"><span class="content">sender@jabber.org</span></span>
<span class="key">password</span>: <span class="type">!secret</span> <span class="string"><span class="content">xmpp_password</span></span>
<span class="key">recipient</span>: <span class="string"><span class="content">recipient@jabber.org</span></span>
<span class="key">automation</span>:
- <span class="string"><span class="content">alias: Update notifications</span></span>
<span class="key">trigger</span>:
- <span class="string"><span class="content">platform: state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">updater.updater</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">notify.jabber</span></span>
<span class="key">data</span>:
<span class="key">message</span>: <span class="string"><span class="content">'There is a new Home Assistant release available.'</span></span>
</pre></div>
</div>
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/notify_if__new_ha_release.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Automation Examples</h1>
<ul class='divided'>
<li>
<a href='/cookbook/automation_for_rainy_days/'>Automation for rainy days</a>
</li>
<li>
<a href='/cookbook/dim_lights_when_playing_media/'>Dim lights when playing media</a>
</li>
<li>
<a href='/cookbook/basic_example_use_trigger_values/'>Example using use_trigger_values</a>
</li>
<li>
<a href='/cookbook/automation_flashing_lights/'>Examples for flashing lights</a>
</li>
<li>
<a href='/cookbook/automation_sun/'>Examples using the sun</a>
</li>
<li>
<a href='/cookbook/foscam_away_mode_PTZ/'>Foscam Recording during Away Mode Only using Pan/Tilt/Zoom Control and Motion Detection</a>
</li>
<li>
<a href='/cookbook/perform_actions_based_on_input_select/'>Perform actions based on input select</a>
</li>
<li>
<a href='/cookbook/restart_ha_if_wemo_switch_is_not_detected/'>Restart Home Assistant if Wemo Switch is not detected</a>
</li>
<li>
<a href='/cookbook/send_a_reminder/'>Send a reminder</a>
</li>
<li>
<a href='/cookbook/notify_if_over_threshold/'>Send notification based on sensor</a>
</li>
<li>
Send notification if new Home Assistant release
</li>
<li>
<a href='/cookbook/track_battery_level/'>Track your battery level</a>
</li>
<li>
<a href='/cookbook/turn_on_light_for_10_minutes_when_motion_detected/'>Turn on lights for 10 minutes after motion detected</a>
</li>
<li>
<a href='/cookbook/automation_using_timeinterval_inputboolean/'>Using time interval and input boolean</a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,230 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Send notification based on sensor - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Basic example of how to send a templated notification if a sensor is over a given threshold">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/notify_if_over_threshold/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Send notification based on sensor">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/notify_if_over_threshold/">
<meta property="og:type" content="article">
<meta property="og:description" content="Basic example of how to send a templated notification if a sensor is over a given threshold">
<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="Send notification based on sensor">
<meta name="twitter:description" content="Basic example of how to send a templated notification if a sensor is over a given threshold">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Send Notification Based on Sensor
</h1>
</header>
<hr class="divider">
<p>The following example sends a notification via pushbullet if a sensor is over a critical value:</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre>
<span class="key">notify me</span>:
<span class="key">platform</span>: <span class="string"><span class="content">pushbullet</span></span>
<span class="key">api_key</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">API_KEY_HERE</span><span class="delimiter">&quot;</span></span>
<span class="key">name</span>: <span class="string"><span class="content">mypushbullet</span></span>
<span class="key">automation</span>:
- <span class="string"><span class="content">alias: FanOn</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">numeric_state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">sensor.furnace</span></span>
<span class="key">above</span>: <span class="string"><span class="content">2</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">notify.mypushbullet</span></span>
<span class="key">data</span>:
<span class="key">title</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Furnace fan is running</span><span class="delimiter">&quot;</span></span>
<span class="key">message</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Fan running because current is {{ states.sensor.furnace.state }} amps</span><span class="delimiter">&quot;</span></span>
</pre></div>
</div>
</div>
<p>If you also want a notification when it drops back down below that limit, you could add this as well:</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre> - <span class="string"><span class="content">alias: FanOff</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">numeric_state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">sensor.furnace</span></span>
<span class="key">below</span>: <span class="string"><span class="content">2</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">notify.mypushbullet</span></span>
<span class="key">data</span>:
<span class="key">title</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Furnace fan is stopped</span><span class="delimiter">&quot;</span></span>
<span class="key">message</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Fan stopped because current is {{ states.sensor.furnace.state }} amps</span><span class="delimiter">&quot;</span></span>
</pre></div>
</div>
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/notify_if_over_threshold.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Automation Examples</h1>
<ul class='divided'>
<li>
<a href='/cookbook/automation_for_rainy_days/'>Automation for rainy days</a>
</li>
<li>
<a href='/cookbook/dim_lights_when_playing_media/'>Dim lights when playing media</a>
</li>
<li>
<a href='/cookbook/basic_example_use_trigger_values/'>Example using use_trigger_values</a>
</li>
<li>
<a href='/cookbook/automation_flashing_lights/'>Examples for flashing lights</a>
</li>
<li>
<a href='/cookbook/automation_sun/'>Examples using the sun</a>
</li>
<li>
<a href='/cookbook/foscam_away_mode_PTZ/'>Foscam Recording during Away Mode Only using Pan/Tilt/Zoom Control and Motion Detection</a>
</li>
<li>
<a href='/cookbook/perform_actions_based_on_input_select/'>Perform actions based on input select</a>
</li>
<li>
<a href='/cookbook/restart_ha_if_wemo_switch_is_not_detected/'>Restart Home Assistant if Wemo Switch is not detected</a>
</li>
<li>
<a href='/cookbook/send_a_reminder/'>Send a reminder</a>
</li>
<li>
Send notification based on sensor
</li>
<li>
<a href='/cookbook/notify_if__new_ha_release/'>Send notification if new Home Assistant release</a>
</li>
<li>
<a href='/cookbook/track_battery_level/'>Track your battery level</a>
</li>
<li>
<a href='/cookbook/turn_on_light_for_10_minutes_when_motion_detected/'>Turn on lights for 10 minutes after motion detected</a>
</li>
<li>
<a href='/cookbook/automation_using_timeinterval_inputboolean/'>Using time interval and input boolean</a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,352 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Perform actions based on input select - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Example playing media to chromecast based on input select element">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/perform_actions_based_on_input_select/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Perform actions based on input select">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/perform_actions_based_on_input_select/">
<meta property="og:type" content="article">
<meta property="og:description" content="Example playing media to chromecast based on input select element">
<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="Perform actions based on input select">
<meta name="twitter:description" content="Example playing media to chromecast based on input select element">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Perform Actions Based on Input Select
</h1>
</header>
<hr class="divider">
<p>This example uses an <a href="/components/input_select/"><code>input_select</code></a> element to pick which mp3 file to play on a <a href="components/media_player.cast/">Chromecast</a>.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="comment"># Define our dropdown list</span>
<span class="key">input_select</span>:
<span class="key">lullaby</span>:
<span class="key">name</span>: <span class="string"><span class="content">Lullaby</span></span>
<span class="key">options</span>:
- <span class="string"><span class="content">Rain</span></span>
- <span class="string"><span class="content">Babbling Brook</span></span>
- <span class="string"><span class="content">None</span></span>
<span class="key">initial</span>: <span class="string"><span class="content">None</span></span>
<span class="key">icon</span>: <span class="string"><span class="content">mdi:weather-rainy</span></span>
<span class="comment"># Define our media player</span>
<span class="key">media_player</span>:
- <span class="string"><span class="content">platform: cast</span></span>
<span class="key">host</span>: <span class="string"><span class="content">chromecast-nursery</span></span>
<span class="key">name</span>: <span class="string"><span class="content">Nursery</span></span>
<span class="key">automation</span>:
<span class="comment"># If you select &quot;Rain&quot;, play the &quot;rain.mp3&quot; file</span>
- <span class="string"><span class="content">alias: Play Rain Lullaby</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">input_select.lullaby</span></span>
<span class="key">to</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Rain</span><span class="delimiter">&quot;</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">media_player.play_media</span></span>
<span class="key">data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">media_player.nursery</span></span>
<span class="key">media_id</span>: <span class="string"><span class="content">http://fileserver/rain.mp3</span></span>
<span class="key">media_type</span>: <span class="string"><span class="content">audio/mp4</span></span>
<span class="comment"># If you select &quot;Babbling Brook&quot;, play the &quot;babbling_brook.mp3&quot; file</span>
- <span class="string"><span class="content">alias: Play Babbling Brook Lullaby</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">input_select.lullaby</span></span>
<span class="key">to</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Babbling Brook</span><span class="delimiter">&quot;</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">media_player.play_media</span></span>
<span class="key">data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">media_player.nursery</span></span>
<span class="key">media_id</span>: <span class="string"><span class="content">http://fileserver/babbling_brook.mp3</span></span>
<span class="key">media_type</span>: <span class="string"><span class="content">audio/mp4</span></span>
<span class="comment"># If you select &quot;None, turn the Chromecast off</span>
- <span class="string"><span class="content">alias: Stop the Lullaby</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">input_select.lullaby</span></span>
<span class="key">to</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">None</span><span class="delimiter">&quot;</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">media_player.turn_off</span></span>
<span class="key">data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">media_player.nursery</span></span>
</pre></div>
</div>
</div>
<p>A little bit more complex example that uses <a href="/components/input_select/"><code>input_select</code></a> and template to decide what to play, and which <a href="components/media_player.cast/">Chromecast</a> to play on.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="key">input_select</span>:
<span class="key">radio_station</span>:
<span class="key">name</span>: <span class="string"><span class="content">Radio Station</span></span>
<span class="key">options</span>:
- <span class="string"><span class="content">Z88.3</span></span>
- <span class="string"><span class="content">Virgin</span></span>
- <span class="string"><span class="content">RMC</span></span>
- <span class="string"><span class="content">rmcHQ</span></span>
- <span class="string"><span class="content">105</span></span>
- <span class="string"><span class="content">None</span></span>
<span class="key">initial</span>: <span class="string"><span class="content">None</span></span>
<span class="key">icon</span>: <span class="string"><span class="content">mdi:radio</span></span>
<span class="key">radio_player</span>:
<span class="key">name</span>: <span class="string"><span class="content">Radio Player</span></span>
<span class="key">options</span>:
- <span class="string"><span class="content">Mansarda</span></span>
- <span class="string"><span class="content">Doccia</span></span>
- <span class="string"><span class="content">Bed</span></span>
- <span class="string"><span class="content">Bath</span></span>
- <span class="string"><span class="content">Salotto</span></span>
- <span class="string"><span class="content">Salotto Video</span></span>
- <span class="string"><span class="content">None</span></span>
<span class="key">initial</span>: <span class="string"><span class="content">None</span></span>
<span class="key">icon</span>: <span class="string"><span class="content">mdi:airplay</span></span>
<span class="key">automation</span>:
- <span class="string"><span class="content">alias: Stop Streaming Radio</span></span>
<span class="key">trigger</span>:
- <span class="string"><span class="content">platform: state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">input_select.radio_station</span></span>
<span class="key">to</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">None</span><span class="delimiter">&quot;</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">media_player.turn_off</span></span>
<span class="key">data_template</span>:
<span class="key">entity_id</span>: <span class="string"><span class="delimiter">&gt;</span><span class="content">
{% if is_state(&quot;input_select.radio_player&quot;, &quot;Mansarda&quot;) %}
media_player.bed_2
{%-elif is_state(&quot;input_select.radio_player&quot;, &quot;Doccia&quot;) %}
media_player.bed_3
{%-elif is_state(&quot;input_select.radio_player&quot;, &quot;Bed&quot;) %}
media_player.bed
{%-elif is_state(&quot;input_select.radio_player&quot;, &quot;Bath&quot;) %}
media_player.bath
{%-elif is_state(&quot;input_select.radio_player&quot;, &quot;Salotto&quot;) %}
media_player.salotto
{%-elif is_state(&quot;input_select.radio_player&quot;, &quot;Salotto Video&quot;) %}
media_player.salotto_video
{% else %}
none
{% endif %}</span></span>
- <span class="string"><span class="content">alias: Stream Radio - Template</span></span>
<span class="key">trigger</span>:
- <span class="string"><span class="content">platform: state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">input_select.radio_station</span></span>
<span class="key">action</span>:
- <span class="string"><span class="content">service: media_player.play_media</span></span>
<span class="key">data_template</span>:
<span class="key">entity_id</span>: <span class="string"><span class="delimiter">&gt;</span><span class="content">
{% if is_state(&quot;input_select.radio_player&quot;, &quot;Mansarda&quot;) %}
media_player.bed_2
{%-elif is_state(&quot;input_select.radio_player&quot;, &quot;Doccia&quot;) %}
media_player.bed_3
{%-elif is_state(&quot;input_select.radio_player&quot;, &quot;Bed&quot;) %}
media_player.bed
{%-elif is_state(&quot;input_select.radio_player&quot;, &quot;Bath&quot;) %}
media_player.bath
{%-elif is_state(&quot;input_select.radio_player&quot;, &quot;Salotto&quot;) %}
media_player.salotto
{%-elif is_state(&quot;input_select.radio_player&quot;, &quot;Salotto Video&quot;) %}
media_player.salotto_video
{% else %}
none
{% endif %}</span></span>
<span class="key">media_content_id</span>: <span class="string"><span class="delimiter">&gt;</span><span class="content">
{% if is_state(&quot;input_select.radio_station&quot;, &quot;Z88.3&quot;) %}
http://ice.zradio.org/z/high.mp3
{%-elif is_state(&quot;input_select.radio_station&quot;, &quot;Virgin&quot;) %}
http://icecast.unitedradio.it/Virgin.mp3
{%-elif is_state(&quot;input_select.radio_station&quot;, &quot;RMC&quot;) %}
http://icecast.unitedradio.it/RMC.mp3
{%-elif is_state(&quot;input_select.radio_station&quot;, &quot;rmcHQ&quot;) %}
http://icecast.unitedradio.it/rmcHQ.mp3
{%-elif is_state(&quot;input_select.radio_station&quot;, &quot;105&quot;) %}
http://icecast.unitedradio.it/Radio105.mp3
{% else %}
none
{% endif %}</span></span>
<span class="key">media_content_type</span>: <span class="string"><span class="content">'audio/mp4'</span></span>
</pre></div>
</div>
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/perform_actions_based_on_input_select.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Automation Examples</h1>
<ul class='divided'>
<li>
<a href='/cookbook/automation_for_rainy_days/'>Automation for rainy days</a>
</li>
<li>
<a href='/cookbook/dim_lights_when_playing_media/'>Dim lights when playing media</a>
</li>
<li>
<a href='/cookbook/basic_example_use_trigger_values/'>Example using use_trigger_values</a>
</li>
<li>
<a href='/cookbook/automation_flashing_lights/'>Examples for flashing lights</a>
</li>
<li>
<a href='/cookbook/automation_sun/'>Examples using the sun</a>
</li>
<li>
<a href='/cookbook/foscam_away_mode_PTZ/'>Foscam Recording during Away Mode Only using Pan/Tilt/Zoom Control and Motion Detection</a>
</li>
<li>
Perform actions based on input select
</li>
<li>
<a href='/cookbook/restart_ha_if_wemo_switch_is_not_detected/'>Restart Home Assistant if Wemo Switch is not detected</a>
</li>
<li>
<a href='/cookbook/send_a_reminder/'>Send a reminder</a>
</li>
<li>
<a href='/cookbook/notify_if_over_threshold/'>Send notification based on sensor</a>
</li>
<li>
<a href='/cookbook/notify_if__new_ha_release/'>Send notification if new Home Assistant release</a>
</li>
<li>
<a href='/cookbook/track_battery_level/'>Track your battery level</a>
</li>
<li>
<a href='/cookbook/turn_on_light_for_10_minutes_when_motion_detected/'>Turn on lights for 10 minutes after motion detected</a>
</li>
<li>
<a href='/cookbook/automation_using_timeinterval_inputboolean/'>Using time interval and input boolean</a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,207 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Basic Service Example - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/python_component_basic_service/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Basic Service Example">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/python_component_basic_service/">
<meta property="og:type" content="article">
<meta property="og:description" content="">
<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="Basic Service Example">
<meta name="twitter:description" content="">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Basic Service Example
</h1>
</header>
<hr class="divider">
<p>This is a simple “hello world” example to show the basics of registering a service. To use this example, create the file <code>&lt;config dir&gt;/custom_components/hello_service.py</code> and copy the below example code.</p>
<p>Services can be called from automation and from the service “Developer tools” in the frontend.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="comment"># The domain of your component. Should be equal to the name of your component.</span>
DOMAIN = <span class="string"><span class="delimiter">'</span><span class="content">hello_service</span><span class="delimiter">'</span></span>
ATTR_NAME = <span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>
DEFAULT_NAME = <span class="string"><span class="delimiter">'</span><span class="content">World</span><span class="delimiter">'</span></span>
<span class="keyword">def</span> <span class="function">setup</span>(hass, config):
<span class="docstring"><span class="delimiter">&quot;&quot;&quot;</span><span class="content">Setup is called when Home Assistant is loading our component.</span><span class="delimiter">&quot;&quot;&quot;</span></span>
<span class="keyword">def</span> <span class="function">handle_hello</span>(call):
name = call.data.get(ATTR_NAME, DEFAULT_NAME)
hass.states.set(<span class="string"><span class="delimiter">'</span><span class="content">hello_service.hello</span><span class="delimiter">'</span></span>, name)
hass.services.register(DOMAIN, <span class="string"><span class="delimiter">'</span><span class="content">hello</span><span class="delimiter">'</span></span>, handle_hello)
<span class="comment"># Return boolean to indicate that initialization was successfully.</span>
<span class="keyword">return</span> <span class="predefined-constant">True</span>
</pre></div>
</div>
</div>
<p>Load the component by adding the following to your <code>configuration.yaml</code>. When your component is loaded, a new service should be available to call.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="comment"># configuration.yaml entry</span>
<span class="key">hello_service</span>:
</pre></div>
</div>
</div>
<p>Open the frontend and in the sidebar, click the first icon in the developer tool section. This will open the Call Service developer tool. On the right, find your service and click on it. This will automatically fill in the correct values.</p>
<p>Pressing “Call Service” will now call your service without any parameters. This will cause your service to create a state with the default name World. If you want to specify the name, you have to specify parameters. Add the following JSON as Service Data and press “Call Service again”.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre>{
<span class="key"><span class="delimiter">&quot;</span><span class="content">name</span><span class="delimiter">&quot;</span></span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Planet</span><span class="delimiter">&quot;</span></span>
}
</pre></div>
</div>
</div>
<p>The service will now overwrite the previous state with “Planet”.</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/python_component_basic_service.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Custom Python Component Examples</h1>
<ul class='divided'>
<li>
<a href='/cookbook/python_component_mqtt_basic/'>Basic MQTT Example</a>
</li>
<li>
Basic Service Example
</li>
<li>
<a href='/cookbook/python_component_basic_state/'>Basic State Setting Example</a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,289 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Basic State Setting Example - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/python_component_basic_state/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Basic State Setting Example">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/python_component_basic_state/">
<meta property="og:type" content="article">
<meta property="og:description" content="">
<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="Basic State Setting Example">
<meta name="twitter:description" content="">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Basic State Setting Example
</h1>
</header>
<hr class="divider">
<p>This is a simple tutorial/example on how to write a component for <a href="https://home-assistant.io/">Home Assistant</a>. We will work on a component called “hello_state” to begin with. The purpose of this component is to display a given text in the frontend.</p>
<p>The setup of a development environment is described in the <a href="/developers/#starting-development">Developers section</a> of the documentation.</p>
<h2><a class="title-link" name="component" href="#component"></a> Component</h2>
<p>To get started, create the file <code>&lt;config dir&gt;/custom_components/hello_state.py</code> and copy the below example code.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="docstring"><span class="delimiter">&quot;&quot;&quot;</span><span class="content">
</span><span class="content">Support for showing text in the frontend.</span><span class="content">
</span><span class="content">
</span><span class="content">For more details about this component, please refer to the documentation at</span><span class="content">
</span><span class="content">https://home-assistant.io/components/hello_state/</span><span class="content">
</span><span class="delimiter">&quot;&quot;&quot;</span></span>
<span class="keyword">import</span> <span class="include">logging</span>
_LOGGER = logging.getLogger(__name__)
DOMAIN = <span class="string"><span class="delimiter">'</span><span class="content">hello_state</span><span class="delimiter">'</span></span>
DEPENDENCIES = []
<span class="keyword">def</span> <span class="function">setup</span>(hass, config=<span class="predefined-constant">None</span>):
<span class="docstring"><span class="delimiter">&quot;&quot;&quot;</span><span class="content">Setup the Hello State component. </span><span class="delimiter">&quot;&quot;&quot;</span></span>
_LOGGER.info(<span class="string"><span class="delimiter">&quot;</span><span class="content">The 'hello state' component is ready!</span><span class="delimiter">&quot;</span></span>)
<span class="keyword">return</span> <span class="predefined-constant">True</span>
</pre></div>
</div>
</div>
<ol>
<li>In the file header we decided to add some details: A short description and the link to the documentation.</li>
<li>We want to do some logging. This means that we import the Python logging module and create an alias.</li>
<li>The component name is equal to the domain name.</li>
<li>At the moment this component has no dependencies. For detail check <a href="/developers/creating_components/#dependencies">dependencies</a> section.</li>
<li>
<p>The <code>setup</code> function will take care of the initialization of our component.<br />
The component will only write a log message. Keep in mind for later that you have several options for the severity:</p>
<ul>
<li><code>_LOGGER.info(msg)</code></li>
<li><code>_LOGGER.warning(msg)</code></li>
<li><code>_LOGGER.error(msg)</code></li>
<li><code>_LOGGER.critical(msg)</code></li>
<li><code>_LOGGER.exception(msg)</code></li>
</ul>
</li>
<li>We return <code>True</code> if everything is ok.</li>
</ol>
<p>Add the component to your <code>configuration.yaml</code> file.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="key">hello_state</span>:
</pre></div>
</div>
</div>
<p>After a start or a restart of Home Assistant the component will create an entry in the log.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre>16-03-12 14:16:42 INFO (MainThread) [custom_components.hello_state] The 'hello state' component is ready!
</pre></div>
</div>
</div>
<p>The next step is the introduction of configuration options. Most configuration details are coming out of the <code>configuration.yaml</code> file. To do that we need to update the <code>def setup()</code> method to accept configuration information and access the configuration variable in the <code>setup</code> method.</p>
<p>More details about this topic can be found in the <a href="/developers/creating_components/#config-user-given-configuration">User given configuration</a> section.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="keyword">import</span> <span class="include">logging</span>
_LOGGER = logging.getLogger(__name__)
DOMAIN = <span class="string"><span class="delimiter">'</span><span class="content">hello_state</span><span class="delimiter">'</span></span>
DEPENDENCIES = []
CONF_TEXT = <span class="string"><span class="delimiter">'</span><span class="content">text</span><span class="delimiter">'</span></span>
DEFAULT_TEXT = <span class="string"><span class="delimiter">'</span><span class="content">No text!</span><span class="delimiter">'</span></span>
<span class="keyword">def</span> <span class="function">setup</span>(hass, config):
<span class="docstring"><span class="delimiter">&quot;&quot;&quot;</span><span class="content">Setup the Hello State component. </span><span class="delimiter">&quot;&quot;&quot;</span></span>
<span class="comment"># Get the text from the configuration. Use DEFAULT_TEXT if no name is provided.</span>
text = config[DOMAIN].get(CONF_TEXT, DEFAULT_TEXT)
<span class="comment"># States are in the format DOMAIN.OBJECT_ID</span>
hass.states.set(<span class="string"><span class="delimiter">'</span><span class="content">hello_state.Hello_State</span><span class="delimiter">'</span></span>, text)
<span class="keyword">return</span> <span class="predefined-constant">True</span>
</pre></div>
</div>
</div>
<p>To add the latest feature of our component, update the entry in your <code>configuration.yaml</code> file.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="key">hello_state</span>:
<span class="key">text</span>: <span class="string"><span class="content">'Hello, World!'</span></span>
</pre></div>
</div>
</div>
<p>Thanks to <code>DEFAULT_TEXT</code> variable the component will launch even if no <code>text:</code> field is used in the <code>configuration.yaml</code> file. Quite often there are variables which are required. Its important to check if all mandatory configuration variables are provided. If not, the setup should fail. We will use the <code>validate_config</code> function as a helper to achive this. The next listing shows the essential parts.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="keyword">from</span> <span class="include">homeassistant.helpers</span> <span class="keyword">import</span> <span class="include">validate_config</span>
[...]
<span class="keyword">if</span> <span class="keyword">not</span> validate_config(config, {DOMAIN: [CONF_TEXT]}, _LOGGER):
<span class="keyword">return</span> <span class="predefined-constant">False</span>
</pre></div>
</div>
</div>
<p>If <code>text:</code> is missing, there will be a warning in the log file.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre>16-03-12 14:37:37 ERROR (MainThread) [custom_components.hello_state] Missing required configuration items in hello_state: text
16-03-12 14:37:37 ERROR (MainThread) [homeassistant.bootstrap] component hello_state failed to initialize
</pre></div>
</div>
</div>
<p>After a start or a restart of Home Assistant the component will be visible in the frontend if the <code>configuration.yaml</code> file is up-to-date.</p>
<p class="img">
<img src="/images/screenshots/create-component01.png" />
</p>
<p>To get your component included in the Home Assistant releases, follow the steps described in the <a href="https://home-assistant.io/developers/#submitting-improvements">Submitting improvements</a> section. Basically you only need to move your component in the <code>homeassistant/component/</code> directory of your fork and create a Pull Request.</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/python_component_basic_state.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Custom Python Component Examples</h1>
<ul class='divided'>
<li>
<a href='/cookbook/python_component_mqtt_basic/'>Basic MQTT Example</a>
</li>
<li>
<a href='/cookbook/python_component_basic_service/'>Basic Service Example</a>
</li>
<li>
Basic State Setting Example
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,229 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Basic MQTT Example - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/python_component_mqtt_basic/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Basic MQTT Example">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/python_component_mqtt_basic/">
<meta property="og:type" content="article">
<meta property="og:description" content="">
<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="Basic MQTT Example">
<meta name="twitter:description" content="">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Basic MQTT Example
</h1>
</header>
<hr class="divider">
<p class="note">
This example requires you to have the <a href="/components/mqtt/">MQTT component</a> up and running.
</p>
<p>This is a simple hello world example to show the basics of using MQTT in a custom component. To use this example, create the file <code>&lt;config dir&gt;/custom_components/hello_mqtt.py</code> and copy the below example code.</p>
<p>This example follows a topic on MQTT and updates the state of an entity to the last message received on that topic. It will also register a service set_state that will publish a message to the MQTT topic that were listening to.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="keyword">import</span> <span class="include">homeassistant.loader</span> <span class="keyword">as</span> loader
<span class="comment"># The domain of your component. Should be equal to the name of your component.</span>
DOMAIN = <span class="string"><span class="delimiter">&quot;</span><span class="content">hello_mqtt</span><span class="delimiter">&quot;</span></span>
<span class="comment"># List of component names (string) your component depends upon.</span>
DEPENDENCIES = [<span class="string"><span class="delimiter">'</span><span class="content">mqtt</span><span class="delimiter">'</span></span>]
CONF_TOPIC = <span class="string"><span class="delimiter">'</span><span class="content">topic</span><span class="delimiter">'</span></span>
DEFAULT_TOPIC = <span class="string"><span class="delimiter">'</span><span class="content">home-assistant/hello_mqtt</span><span class="delimiter">'</span></span>
<span class="keyword">def</span> <span class="function">setup</span>(hass, config):
<span class="docstring"><span class="delimiter">&quot;&quot;&quot;</span><span class="content">Setup the Hello MQTT component.</span><span class="delimiter">&quot;&quot;&quot;</span></span>
mqtt = loader.get_component(<span class="string"><span class="delimiter">'</span><span class="content">mqtt</span><span class="delimiter">'</span></span>)
topic = config[DOMAIN].get(<span class="string"><span class="delimiter">'</span><span class="content">topic</span><span class="delimiter">'</span></span>, DEFAULT_TOPIC)
entity_id = <span class="string"><span class="delimiter">'</span><span class="content">hello_mqtt.last_message</span><span class="delimiter">'</span></span>
<span class="comment"># Listener to be called when we receive a message.</span>
<span class="keyword">def</span> <span class="function">message_received</span>(topic, payload, qos):
<span class="docstring"><span class="delimiter">&quot;&quot;&quot;</span><span class="content">A new MQTT message has been received.</span><span class="delimiter">&quot;&quot;&quot;</span></span>
hass.states.set(entity_id, payload)
<span class="comment"># Subscribe our listener to a topic.</span>
mqtt.subscribe(hass, topic, message_received)
<span class="comment"># Set the intial state</span>
hass.states.set(entity_id, <span class="string"><span class="delimiter">'</span><span class="content">No messages</span><span class="delimiter">'</span></span>)
<span class="comment"># Service to publish a message on MQTT.</span>
<span class="keyword">def</span> <span class="function">set_state_service</span>(call):
<span class="docstring"><span class="delimiter">&quot;&quot;&quot;</span><span class="content">Service to send a message.</span><span class="delimiter">&quot;&quot;&quot;</span></span>
mqtt.publish(hass, topic, call.data.get(<span class="string"><span class="delimiter">'</span><span class="content">new_state</span><span class="delimiter">'</span></span>))
<span class="comment"># Register our service with Home Assistant.</span>
hass.services.register(DOMAIN, <span class="string"><span class="delimiter">'</span><span class="content">set_state</span><span class="delimiter">'</span></span>, set_state_service)
<span class="comment"># Return boolean to indicate that initialization was successfully.</span>
<span class="keyword">return</span> <span class="predefined-constant">True</span>
</pre></div>
</div>
</div>
<p>Load the component by adding the following to your <code>configuration.yaml</code>. When your component is loaded, a new entity should popup and there should be a new service available to call.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="comment"># configuration.yaml entry</span>
<span class="key">hello_mqtt</span>:
<span class="key">topic</span>: <span class="string"><span class="content">some_mqtt/topic/here</span></span>
</pre></div>
</div>
</div>
<p>You can call the service with example payload:</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre>{
<span class="key"><span class="delimiter">&quot;</span><span class="content">new_state</span><span class="delimiter">&quot;</span></span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">some new state</span><span class="delimiter">&quot;</span></span>
}
</pre></div>
</div>
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/python_component_mqtt_basic.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Custom Python Component Examples</h1>
<ul class='divided'>
<li>
Basic MQTT Example
</li>
<li>
<a href='/cookbook/python_component_basic_service/'>Basic Service Example</a>
</li>
<li>
<a href='/cookbook/python_component_basic_state/'>Basic State Setting Example</a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,269 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Flash lights when intruder detected - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Detect intruders by checking if the light is turning on while no one is home.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/python_component_simple_alarm/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Flash lights when intruder detected">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/python_component_simple_alarm/">
<meta property="og:type" content="article">
<meta property="og:description" content="Detect intruders by checking if the light is turning on while no one is home.">
<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="Flash lights when intruder detected">
<meta name="twitter:description" content="Detect intruders by checking if the light is turning on while no one is home.">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Flash Lights When Intruder Detected
</h1>
</header>
<hr class="divider">
<p>This example component will detect intruders. It does so by checking if lights are being turned on while there is no one at home. When this happens it will turn the lights red, flash them for 30 seconds and send a message via <a href="/components/notify/">the notifiy component</a>. It will also flash a specific light when a known person comes home.</p>
<p>This component depends on the components <a href="/components/device_tracker/">device_tracker</a> and <a href="/components/light/">light</a> being setup.</p>
<p>To set it up, add the following lines to your <code>configuration.yaml</code> file:</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span>
<span class="key">simple_alarm</span>:
<span class="key">known_light</span>: <span class="string"><span class="content">light.Bowl</span></span>
<span class="key">unknown_light</span>: <span class="string"><span class="content">group.living_room</span></span>
</pre></div>
</div>
</div>
<p>Configuration variables:</p>
<ul>
<li><strong>known_light</strong> (<em>Optional</em>): Which light/light group has to flash when a known device comes home.</li>
<li><strong>unknown_light</strong> (<em>Optional</em>): Which light/light group has to flash red when light turns on while no one home.</li>
</ul>
<p>Create the file <code>&lt;config dir&gt;/custom_components/simple_alarm.py</code> and copy paste the content below:</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="docstring"><span class="delimiter">&quot;&quot;&quot;</span><span class="content">Simple alarm component.</span><span class="delimiter">&quot;&quot;&quot;</span></span>
<span class="keyword">import</span> <span class="include">logging</span>
<span class="keyword">import</span> <span class="include">homeassistant.loader</span> <span class="keyword">as</span> loader
<span class="keyword">from</span> <span class="include">homeassistant.components</span> <span class="keyword">import</span> <span class="include">device_tracker</span>, <span class="include">light</span>, <span class="include">notify</span>
<span class="keyword">from</span> <span class="include">homeassistant.helpers.event</span> <span class="keyword">import</span> <span class="include">track_state_change</span>
<span class="keyword">from</span> <span class="include">homeassistant.const</span> <span class="keyword">import</span> <span class="include">STATE_ON</span>, <span class="include">STATE_OFF</span>, <span class="include">STATE_HOME</span>, <span class="include">STATE_NOT_HOME</span>
DOMAIN = <span class="string"><span class="delimiter">&quot;</span><span class="content">simple_alarm</span><span class="delimiter">&quot;</span></span>
DEPENDENCIES = [<span class="string"><span class="delimiter">'</span><span class="content">group</span><span class="delimiter">'</span></span>, <span class="string"><span class="delimiter">'</span><span class="content">device_tracker</span><span class="delimiter">'</span></span>, <span class="string"><span class="delimiter">'</span><span class="content">light</span><span class="delimiter">'</span></span>]
<span class="comment"># Attribute to tell which light has to flash whem a known person comes home</span>
<span class="comment"># If omitted will flash all.</span>
CONF_KNOWN_LIGHT = <span class="string"><span class="delimiter">&quot;</span><span class="content">known_light</span><span class="delimiter">&quot;</span></span>
<span class="comment"># Attribute to tell which light has to flash whem an unknown person comes home</span>
<span class="comment"># If omitted will flash all.</span>
CONF_UNKNOWN_LIGHT = <span class="string"><span class="delimiter">&quot;</span><span class="content">unknown_light</span><span class="delimiter">&quot;</span></span>
<span class="comment"># Services to test the alarms</span>
SERVICE_TEST_KNOWN_ALARM = <span class="string"><span class="delimiter">&quot;</span><span class="content">test_known</span><span class="delimiter">&quot;</span></span>
SERVICE_TEST_UNKNOWN_ALARM = <span class="string"><span class="delimiter">&quot;</span><span class="content">test_unknown</span><span class="delimiter">&quot;</span></span>
<span class="keyword">def</span> <span class="function">setup</span>(hass, config):
<span class="docstring"><span class="delimiter">&quot;&quot;&quot;</span><span class="content"> Sets up the simple alarms. </span><span class="delimiter">&quot;&quot;&quot;</span></span>
logger = logging.getLogger(__name__)
light_ids = []
<span class="keyword">for</span> conf_key <span class="keyword">in</span> (CONF_KNOWN_LIGHT, CONF_UNKNOWN_LIGHT):
light_id = config[DOMAIN].get(conf_key, light.ENTITY_ID_ALL_LIGHTS)
<span class="keyword">if</span> hass.states.get(light_id) <span class="keyword">is</span> <span class="predefined-constant">None</span>:
logger.error(
<span class="string"><span class="delimiter">'</span><span class="content">Light id %s could not be found in state machine</span><span class="delimiter">'</span></span>, light_id)
<span class="keyword">return</span> <span class="predefined-constant">False</span>
light_ids.append(light_id)
<span class="comment"># pylint: disable=unbalanced-tuple-unpacking</span>
known_light_id, unknown_light_id = light_ids
<span class="keyword">if</span> hass.states.get(device_tracker.ENTITY_ID_ALL_DEVICES) <span class="keyword">is</span> <span class="predefined-constant">None</span>:
logger.error(<span class="string"><span class="delimiter">'</span><span class="content">No devices are being tracked, cannot setup alarm</span><span class="delimiter">'</span></span>)
<span class="keyword">return</span> <span class="predefined-constant">False</span>
<span class="keyword">def</span> <span class="function">known_alarm</span>():
<span class="docstring"><span class="delimiter">&quot;&quot;&quot;</span><span class="content"> Fire an alarm if a known person arrives home. </span><span class="delimiter">&quot;&quot;&quot;</span></span>
light.turn_on(hass, known_light_id, flash=light.FLASH_SHORT)
<span class="keyword">def</span> <span class="function">unknown_alarm</span>():
<span class="docstring"><span class="delimiter">&quot;&quot;&quot;</span><span class="content"> Fire an alarm if the light turns on while no one is home. </span><span class="delimiter">&quot;&quot;&quot;</span></span>
light.turn_on(
hass, unknown_light_id,
flash=light.FLASH_LONG, rgb_color=[<span class="integer">255</span>, <span class="integer">0</span>, <span class="integer">0</span>])
<span class="comment"># Send a message to the user</span>
notify.send_message(
hass, <span class="string"><span class="delimiter">&quot;</span><span class="content">The lights just got turned on while no one was home.</span><span class="delimiter">&quot;</span></span>)
<span class="comment"># Setup services to test the effect</span>
hass.services.register(
DOMAIN, SERVICE_TEST_KNOWN_ALARM, <span class="keyword">lambda</span> call: known_alarm())
hass.services.register(
DOMAIN, SERVICE_TEST_UNKNOWN_ALARM, <span class="keyword">lambda</span> call: unknown_alarm())
<span class="keyword">def</span> <span class="function">unknown_alarm_if_lights_on</span>(entity_id, old_state, new_state):
<span class="docstring"><span class="delimiter">&quot;&quot;&quot;</span><span class="content"> Called when a light has been turned on. </span><span class="delimiter">&quot;&quot;&quot;</span></span>
<span class="keyword">if</span> <span class="keyword">not</span> device_tracker.is_on(hass):
unknown_alarm()
track_state_change(
hass, light.ENTITY_ID_ALL_LIGHTS,
unknown_alarm_if_lights_on, STATE_OFF, STATE_ON)
<span class="keyword">def</span> <span class="function">ring_known_alarm</span>(entity_id, old_state, new_state):
<span class="docstring"><span class="delimiter">&quot;&quot;&quot;</span><span class="content"> Called when a known person comes home. </span><span class="delimiter">&quot;&quot;&quot;</span></span>
<span class="keyword">if</span> light.is_on(hass, known_light_id):
known_alarm()
<span class="comment"># Track home coming of each device</span>
track_state_change(
hass, hass.states.entity_ids(device_tracker.DOMAIN),
ring_known_alarm, STATE_NOT_HOME, STATE_HOME)
<span class="keyword">return</span> <span class="predefined-constant">True</span>
</pre></div>
</div>
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/python_component_simple_alarm.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Automation in Python Examples</h1>
<ul class='divided'>
<li>
Flash lights when intruder detected
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,278 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Restart Home Assistant if Wemo Switch is not detected - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Restart Home Assistant if Wemo Switch is not detected.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/restart_ha_if_wemo_switch_is_not_detected/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Restart Home Assistant if Wemo Switch is not detected">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/restart_ha_if_wemo_switch_is_not_detected/">
<meta property="og:type" content="article">
<meta property="og:description" content="Restart Home Assistant if Wemo Switch is not detected.">
<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="Restart Home Assistant if Wemo Switch is not detected">
<meta name="twitter:description" content="Restart Home Assistant if Wemo Switch is not detected.">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Restart Home Assistant if Wemo Switch Is Not Detected
</h1>
</header>
<hr class="divider">
<h3><a class="title-link" name="restart-home-assistant" href="#restart-home-assistant"></a> Restart Home Assistant</h3>
<p>This configuration example is restarting Home Assistant if a <a href="/components/switch.wemo/">WeMo</a> switch is not detected. An additional MQTT switch is present for stopping Home Assistant and can be triggered by <a href="/components/ifttt/">IFTTT</a>. The running batch script will automatically restart Home Assistant if the process isnt found anymore.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="key">mqtt</span>:
<span class="key">broker</span>: <span class="string"><span class="content">127.0.0.1</span></span>
<span class="key">port</span>: <span class="string"><span class="content">1883</span></span>
<span class="key">client_id</span>: <span class="string"><span class="content">home-assistant-1</span></span>
<span class="key">keepalive</span>: <span class="string"><span class="content">60</span></span>
<span class="key">device_tracker</span>:
- <span class="string"><span class="content">platform: nmap_tracker</span></span>
<span class="key">hosts</span>: <span class="string"><span class="content">192.168.0.1-255</span></span>
<span class="key">home_interval</span>: <span class="string"><span class="content">1</span></span>
<span class="key">interval_seconds</span>: <span class="string"><span class="content">30</span></span>
<span class="key">consider_home</span>: <span class="string"><span class="content">900</span></span>
<span class="key">ifttt</span>:
<span class="key">key</span>: <span class="error">***</span>
<span class="key">notify</span>:
- <span class="string"><span class="content">platform: pushbullet</span></span>
<span class="key">api_key</span>: <span class="error">***</span>
<span class="key">name</span>: <span class="string"><span class="content">pushbullet</span></span>
<span class="key">switch</span>:
- <span class="string"><span class="content">platform: wemo</span></span>
- <span class="string"><span class="content">platform: mqtt</span></span>
<span class="key">state_topic</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">home/killhass</span><span class="delimiter">&quot;</span></span>
<span class="key">command_topic</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">home/killhass</span><span class="delimiter">&quot;</span></span>
<span class="key">name</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">KillHass</span><span class="delimiter">&quot;</span></span>
<span class="key">qos</span>: <span class="string"><span class="content">0</span></span>
<span class="key">payload_on</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">ON</span><span class="delimiter">&quot;</span></span>
<span class="key">payload_of</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">OFF</span><span class="delimiter">&quot;</span></span>
<span class="key">optimistic</span>: <span class="string"><span class="content">false</span></span>
<span class="key">script</span>:
<span class="key">restarthawemo</span>:
<span class="key">alias</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Restart HA if WeMo isn't found after 15 minutes</span><span class="delimiter">&quot;</span></span>
<span class="key">sequence</span>:
- <span class="string"><span class="content">delay:</span><span class="content">
minutes: 15</span></span>
- <span class="string"><span class="content">service: notify.pushbullet</span></span>
<span class="key">data</span>:
<span class="key">message</span>: <span class="string"><span class="content">'WeMo not found, restarting HA'</span></span>
- <span class="string"><span class="content">service: switch.turn_on</span></span>
<span class="key">data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">switch.killhass</span></span>
<span class="key">automation</span>:
- <span class="string"><span class="content">alias: &quot;Restart HA if WeMo switch isn't found after 15 minutes&quot;</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">device_tracker.wemo</span></span>
<span class="key">from</span>: <span class="string"><span class="content">'not_home'</span></span>
<span class="key">to</span>: <span class="string"><span class="content">'home'</span></span>
<span class="key">condition</span>:
- <span class="string"><span class="content">condition: template</span></span>
<span class="key">value_template</span>: <span class="string"><span class="content">'{% if states.switch.wemo %}false{% else %}true{% endif %}'</span></span>
- <span class="string"><span class="content">condition: state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">script.restarthawemo</span></span>
<span class="key">state</span>: <span class="string"><span class="content">'off'</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">homeassistant.turn_on</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">script.restarthawemo</span></span>
- <span class="string"><span class="content">alias: 'Stop HA'</span></span>
<span class="key">trigger</span>:
- <span class="string"><span class="content">platform: state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">switch.KillHass</span></span>
<span class="key">state</span>: <span class="string"><span class="content">'on'</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">homeassistant.stop</span></span>
- <span class="string"><span class="content">alias: 'Stop restarting HA is WeMo is found'</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">template</span></span>
<span class="key">value_template</span>: <span class="string"><span class="content">'{% if states.switch.wemo %}true{% else %}false{% endif %}'</span></span>
<span class="key">condition</span>:
<span class="key">condition</span>: <span class="string"><span class="content">state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">script.restarthawemo</span></span>
<span class="key">state</span>: <span class="string"><span class="content">'on'</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">homeassistant.turn_off</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">script.restarthawemo</span></span>
</pre></div>
</div>
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/restart_ha_if_wemo_switch_is_not_detected.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Automation Examples</h1>
<ul class='divided'>
<li>
<a href='/cookbook/automation_for_rainy_days/'>Automation for rainy days</a>
</li>
<li>
<a href='/cookbook/dim_lights_when_playing_media/'>Dim lights when playing media</a>
</li>
<li>
<a href='/cookbook/basic_example_use_trigger_values/'>Example using use_trigger_values</a>
</li>
<li>
<a href='/cookbook/automation_flashing_lights/'>Examples for flashing lights</a>
</li>
<li>
<a href='/cookbook/automation_sun/'>Examples using the sun</a>
</li>
<li>
<a href='/cookbook/foscam_away_mode_PTZ/'>Foscam Recording during Away Mode Only using Pan/Tilt/Zoom Control and Motion Detection</a>
</li>
<li>
<a href='/cookbook/perform_actions_based_on_input_select/'>Perform actions based on input select</a>
</li>
<li>
Restart Home Assistant if Wemo Switch is not detected
</li>
<li>
<a href='/cookbook/send_a_reminder/'>Send a reminder</a>
</li>
<li>
<a href='/cookbook/notify_if_over_threshold/'>Send notification based on sensor</a>
</li>
<li>
<a href='/cookbook/notify_if__new_ha_release/'>Send notification if new Home Assistant release</a>
</li>
<li>
<a href='/cookbook/track_battery_level/'>Track your battery level</a>
</li>
<li>
<a href='/cookbook/turn_on_light_for_10_minutes_when_motion_detected/'>Turn on lights for 10 minutes after motion detected</a>
</li>
<li>
<a href='/cookbook/automation_using_timeinterval_inputboolean/'>Using time interval and input boolean</a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,223 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Send a reminder - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Send a reminder">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/send_a_reminder/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Send a reminder">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/send_a_reminder/">
<meta property="og:type" content="article">
<meta property="og:description" content="Send a reminder">
<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="Send a reminder">
<meta name="twitter:description" content="Send a reminder">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Send a Reminder
</h1>
</header>
<hr class="divider">
<p>Always forget to eat lunch? Let Home Assistant send you a reminder.</p>
<p>Add a <a href="/components/notify/">notify platform</a> of your choice.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="key">notify</span>:
- <span class="string"><span class="content">platform: xmpp</span></span>
<span class="key">name</span>: <span class="string"><span class="content">jabber</span></span>
<span class="key">sender</span>: <span class="string"><span class="content">YOUR_JID</span></span>
<span class="key">password</span>: <span class="string"><span class="content">YOUR_JABBER_ACCOUNT_PASSWORD</span></span>
<span class="key">recipient</span>: <span class="string"><span class="content">YOUR_RECIPIENT</span></span>
</pre></div>
</div>
</div>
<p>and automation part to your <code>configuration.yaml</code> file.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="key">automation</span>:
- <span class="string"><span class="content">alias: Send message at a given time</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">time</span></span>
<span class="key">hours</span>: <span class="string"><span class="content">12</span></span>
<span class="key">minutes</span>: <span class="string"><span class="content">15</span></span>
<span class="key">seconds</span>: <span class="string"><span class="content">0</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">notify.jabber</span></span>
<span class="key">data</span>:
<span class="key">message</span>: <span class="string"><span class="content">'Time for lunch'</span></span>
</pre></div>
</div>
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/send_a_reminder.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Automation Examples</h1>
<ul class='divided'>
<li>
<a href='/cookbook/automation_for_rainy_days/'>Automation for rainy days</a>
</li>
<li>
<a href='/cookbook/dim_lights_when_playing_media/'>Dim lights when playing media</a>
</li>
<li>
<a href='/cookbook/basic_example_use_trigger_values/'>Example using use_trigger_values</a>
</li>
<li>
<a href='/cookbook/automation_flashing_lights/'>Examples for flashing lights</a>
</li>
<li>
<a href='/cookbook/automation_sun/'>Examples using the sun</a>
</li>
<li>
<a href='/cookbook/foscam_away_mode_PTZ/'>Foscam Recording during Away Mode Only using Pan/Tilt/Zoom Control and Motion Detection</a>
</li>
<li>
<a href='/cookbook/perform_actions_based_on_input_select/'>Perform actions based on input select</a>
</li>
<li>
<a href='/cookbook/restart_ha_if_wemo_switch_is_not_detected/'>Restart Home Assistant if Wemo Switch is not detected</a>
</li>
<li>
Send a reminder
</li>
<li>
<a href='/cookbook/notify_if_over_threshold/'>Send notification based on sensor</a>
</li>
<li>
<a href='/cookbook/notify_if__new_ha_release/'>Send notification if new Home Assistant release</a>
</li>
<li>
<a href='/cookbook/track_battery_level/'>Track your battery level</a>
</li>
<li>
<a href='/cookbook/turn_on_light_for_10_minutes_when_motion_detected/'>Turn on lights for 10 minutes after motion detected</a>
</li>
<li>
<a href='/cookbook/automation_using_timeinterval_inputboolean/'>Using time interval and input boolean</a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,266 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Tor Onion Service Configuration - Home Assistant</title>
<meta name="author" content="Nathan Freitas">
<meta name="description" content="Configure Tor to work with Home Assistant to provide secure remote access without opening your firewall">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/tor_configuration/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Tor Onion Service Configuration">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/tor_configuration/">
<meta property="og:type" content="article">
<meta property="og:description" content="Configure Tor to work with Home Assistant to provide secure remote access without opening your firewall">
<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:creator" content="@n8fr8">
<meta name="twitter:title" content="Tor Onion Service Configuration">
<meta name="twitter:description" content="Configure Tor to work with Home Assistant to provide secure remote access without opening your firewall">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Tor Onion Service Configuration
</h1>
</header>
<hr class="divider">
<p>This is an example about how you can configure Tor to provide secure remote access to your Home Assistant instance as an Onion site, through Tors Hidden Service feature. With this enabled, you do not need to open your firewall ports or setup HTTPS to enable secure remote access.</p>
<p>This is useful if you want to have:</p>
<ul>
<li>Access your Home Assistant instance remotely without opening a firewall port or setting up a VPN</li>
<li>Dont want to or know how to get an SSL/TLS certificate and HTTPS configuration setup</li>
<li>Want to block attackers from even being able to access/scan your port and server at all</li>
<li>Want to block anyone from knowing your home IP address and seeing your traffic to your Home Assistant</li>
</ul>
<h4><a class="title-link" name="background-and-contact" href="#background-and-contact"></a> Background and Contact</h4>
<p>This configuration is part of an effort to apply strong cryptography technologies (like Onion Routing and End-to-End Encryption) to technology we increasingly depend on in our day to day lives. Just like when WhatsApp enabled end-to-end encryption messaging for everyone, every home automation and IoT platform should do the same, because A) the technology is all there, freely licensed and open-source and B) up to this point, all the commercial manufacturers have been doing a horrific job with security.</p>
<p>You can learn more about how Tor can be used to secure home automation and IoT platforms through this short set of slides on the <a href="https://github.com/n8fr8/talks/blob/master/onion_things/Internet%20of%20Onion%20Things.pdf">Internet of Onion Things</a></p>
<p>This configuration was provided by @n8fr8 (<a href="https://github.com/n8fr8">github</a>, <a href="https://twitter.com/n8fr8">twitter</a>) of the <a href="https://guardianproject.info">Guardian Project</a> and <a href="https://torproject.org">Tor Project</a>. You can send questions, feedback and ideas to <a href="&#109;&#097;&#105;&#108;&#116;&#111;:&#115;&#117;&#112;&#112;&#111;&#114;&#116;&#064;&#103;&#117;&#097;&#114;&#100;&#105;&#097;&#110;&#112;&#114;&#111;&#106;&#101;&#099;&#116;&#046;&#105;&#110;&#102;&#111;">&#115;&#117;&#112;&#112;&#111;&#114;&#116;&#064;&#103;&#117;&#097;&#114;&#100;&#105;&#097;&#110;&#112;&#114;&#111;&#106;&#101;&#099;&#116;&#046;&#105;&#110;&#102;&#111;</a>.</p>
<h4><a class="title-link" name="hidden-services-and-onion-sites" href="#hidden-services-and-onion-sites"></a> Hidden Services and Onion Sites</h4>
<p>Tor allows clients and relays to offer hidden services. That is, you can offer a web server, SSH server, etc., without revealing your IP address to its users. In fact, because you dont use any public address, you can run a hidden service from behind your firewall. Learn more about Hidden Services on the <a href="https://www.torproject.org/docs/tor-hidden-service.html.en">Tor Project website</a>.</p>
<p>Onion sites are websites that run on a Tor Hidden Service node. “dot onion” sites are an <a href="https://datatracker.ietf.org/doc/rfc7686/">IETF recognized special use domain name</a>.</p>
<h4><a class="title-link" name="setting-up-tor-on-your-home-assistant" href="#setting-up-tor-on-your-home-assistant"></a> Setting up Tor on your Home Assistant</h4>
<p>First, install Tor. On a Debain-based system, you can install the package easily:</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre>$ sudo apt-get install tor
</pre></div>
</div>
</div>
<p>You can find more instructions for downloading and installing Tor on other platforms on the <a href="https://www.torproject.org/download/download.html">Tor Project Download Page</a>.</p>
<p>Next, modify Tors main configuration file <code>/etc/tor/torrc</code> to include the following lines:</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre>############### This section is just for location-hidden services ###
## Once you have configured a hidden service, you can look at the
## contents of the file &quot;.../hidden_service/hostname&quot; for the address
## to tell people.
...
HiddenServiceDir /var/lib/tor/homeassistant/
HiddenServicePort 80 127.0.0.1:8123
HiddenServiceAuthorizeClient stealth haremote1
...
</pre></div>
</div>
</div>
<p>The “stealth” entry above ensures traffic to and from your Home Assistant instance over Tor, is hidden even from other nodes on the Tor network. The <code>haremote1</code> value is a generic client name entry that you can modify as you please.</p>
<p>Then, restart Tor:</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre>$ sudo /etc/init.d/tor restart
</pre></div>
</div>
</div>
<p>Then read the new generated authentication cookie from the Tor-generated hostname file:</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre>$ sudo more /var/lib/tor/homeassistant/hostname
</pre></div>
</div>
</div>
<p>The output of that command should look something like this, but with your own unique “dot onion” domain and authentication cookie:</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre>abcdef1234567890.onion ABCDEF1122334455667789 # client: haremote1
</pre></div>
</div>
</div>
<p>You are now done with the Home Assistant Tor server configuration. Make sure your Home Assistant instance is running, and now you can move to client configuration.</p>
<h4><a class="title-link" name="tor-client-access-setup" href="#tor-client-access-setup"></a> Tor Client Access Setup</h4>
<p>Using this setup, you can access your Home Assistant instance over Tor from your laptop or mobile device, using Tor Browser and other software.</p>
<p>Add the authentication cookie to your <code>torrc</code> client configuration on your laptop or mobile device. Using the sample values from above, it would look like this:</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre>HidServAuth abcdef1234567890.onion ABCDEF1122334455667789
</pre></div>
</div>
</div>
<p>For Tor Browser on Windows, Mac or Linux, you can find the torrc file here: <code>&lt;tor browser install directory&gt;/Browser/TorBrowser/Data/Tor/torrc-defaults</code></p>
<p>Once you have added the entry, restart the browser, and then browse to the “dot onion” site address to connect to your Home Assistant instance.</p>
<p>For <a href="https://guardianproject.info/apps/orbot">Orbot: Tor on Android</a>, add it in <strong>Orbot</strong> -&gt; <strong>Menu</strong> -&gt; <strong>Settings</strong> to the “Torrc Custom Config” entry. Restart Orbot, and then use the <a href="https://guardianproject.info/apps/orfox/">Orfox browser app</a>, and browse to the “dot onion” site name to access your Home Assistant instance. You can also use Orbots VPN mode, to enable Tor access from any application on your device, such as Tasker or Owntracks.</p>
<p>On iOS, we have not fully tested this yet, but you should be able to add custom torrc entries on <a href="https://mike.tig.as/onionbrowser/">Onion Browser</a>, Red Onion or TOBY browsers, all available in the iTunes App Store.</p>
<h4><a class="title-link" name="some-more-advanced-ideas" href="#some-more-advanced-ideas"></a> Some More Advanced Ideas</h4>
<p>With this configuration, only you can access your Home Assistant instance Onion site through Tor, and no one else. You can share the authentication cookie with multiple devices and users, or you can generate a unique one for each - up to you! If you have multiple, say for an industrial, business or corporate configuration, this would provide an easy way to revoke access to a specific user or device.</p>
<p>If you always access your Home Assistant instance via Tor, you can easily run this on an isolated “IoT” network segment at your install site, keeping your internal home network traffic seperate from any potentially compromised devices (like cheap “smart” lightbulbs with backdoors!).</p>
<p>You could also use Tor as a means to connect your Home Assistant instance to a remote device, sensor or other service that you do not want to or connect provide a direct, open IP connection to. Again, Tor provides authenticated and confidential routing (aka “privacy and encryption”) by default, without having to setup TLS/SSL or VPN. It is just important to secure IoT nodes within your network, as it is to secure remote access!</p>
<p>As mentioned, with Orbot on Android, you can enable a “full device” VPN mode, that allows any app you have to tunnel through Tor, even if it is not Tor or proxy aware. This means you should be able to enter your “dot onion” Onion site address into any app you want to access to your Home Assistant instance, and it should 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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/tor_configuration.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Infrastructure</h1>
<ul class='divided'>
<li>
<a href='/cookbook/apache_configuration/'>Apache Configuration</a>
</li>
<li>
Tor Onion Service Configuration
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,222 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Track your battery level - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Basic example how to track the battery level of your mobile devices.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/track_battery_level/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Track your battery level">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/track_battery_level/">
<meta property="og:type" content="article">
<meta property="og:description" content="Basic example how to track the battery level of your mobile devices.">
<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="Track your battery level">
<meta name="twitter:description" content="Basic example how to track the battery level of your mobile devices.">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Track Your Battery Level
</h1>
</header>
<hr class="divider">
<p>The <a href="/components/device_tracker.icloud/">iCloud</a> is gathering various details about your device including the battery level. To display it in the Frontend use a <a href="/components/sensor.template/">template sensor</a>.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre> - <span class="string"><span class="content">platform: template</span></span>
<span class="key">sensors</span>:
<span class="key">battery_iphone</span>:
<span class="key">unit_of_measurement</span>: <span class="string"><span class="content">'%'</span></span>
<span class="key">value_template</span>: <span class="string"><span class="delimiter">&gt;-</span><span class="content">
{%- if states.device_tracker.iphone.attributes.battery %}
{{ states.device_tracker.iphone.attributes.battery }}
{% else %}
{{ states.sensor.battery_iphone.state }}
{%- endif %}</span></span>
</pre></div>
</div>
</div>
<p>The <code>else</code> part is used to have the sensor keep its last state if the newest <a href="/components/device_tracker.icloud/">iCloud</a> update doesnt have any battery state in it (which happens sometimes). Otherwise the sensor will be blank.</p>
<p>While running the <a href="/components/device_tracker.owntracks/">Owntracks</a> device tracker you can retrieve the battery level with a MQTT sensor.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="key">sensor</span>:
- <span class="string"><span class="content">platform: mqtt</span></span>
<span class="key">state_topic</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">owntracks/tablet/tablet</span><span class="delimiter">&quot;</span></span>
<span class="key">name</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Battery Tablet</span><span class="delimiter">&quot;</span></span>
<span class="key">unit_of_measurement</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">%</span><span class="delimiter">&quot;</span></span>
<span class="key">value_template</span>: <span class="string"><span class="content">'{{ value_json.batt }}'</span></span>
</pre></div>
</div>
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/track_battery_level.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Automation Examples</h1>
<ul class='divided'>
<li>
<a href='/cookbook/automation_for_rainy_days/'>Automation for rainy days</a>
</li>
<li>
<a href='/cookbook/dim_lights_when_playing_media/'>Dim lights when playing media</a>
</li>
<li>
<a href='/cookbook/basic_example_use_trigger_values/'>Example using use_trigger_values</a>
</li>
<li>
<a href='/cookbook/automation_flashing_lights/'>Examples for flashing lights</a>
</li>
<li>
<a href='/cookbook/automation_sun/'>Examples using the sun</a>
</li>
<li>
<a href='/cookbook/foscam_away_mode_PTZ/'>Foscam Recording during Away Mode Only using Pan/Tilt/Zoom Control and Motion Detection</a>
</li>
<li>
<a href='/cookbook/perform_actions_based_on_input_select/'>Perform actions based on input select</a>
</li>
<li>
<a href='/cookbook/restart_ha_if_wemo_switch_is_not_detected/'>Restart Home Assistant if Wemo Switch is not detected</a>
</li>
<li>
<a href='/cookbook/send_a_reminder/'>Send a reminder</a>
</li>
<li>
<a href='/cookbook/notify_if_over_threshold/'>Send notification based on sensor</a>
</li>
<li>
<a href='/cookbook/notify_if__new_ha_release/'>Send notification if new Home Assistant release</a>
</li>
<li>
Track your battery level
</li>
<li>
<a href='/cookbook/turn_on_light_for_10_minutes_when_motion_detected/'>Turn on lights for 10 minutes after motion detected</a>
</li>
<li>
<a href='/cookbook/automation_using_timeinterval_inputboolean/'>Using time interval and input boolean</a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

View file

@ -0,0 +1,232 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[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>Turn on lights for 10 minutes after motion detected - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Turn on lights for 10 minutes when motion detected.">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/cookbook/turn_on_light_for_10_minutes_when_motion_detected/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Turn on lights for 10 minutes after motion detected">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/cookbook/turn_on_light_for_10_minutes_when_motion_detected/">
<meta property="og:type" content="article">
<meta property="og:description" content="Turn on lights for 10 minutes when motion detected.">
<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="Turn on lights for 10 minutes after motion detected">
<meta name="twitter:description" content="Turn on lights for 10 minutes when motion detected.">
<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='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</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">
<header>
<h1 class="title indent">
Turn on Lights for 10 Minutes After Motion Detected
</h1>
</header>
<hr class="divider">
<h4><a class="title-link" name="turn-on-lights-with-a-resettable-off-timer" href="#turn-on-lights-with-a-resettable-off-timer"></a> Turn on lights with a resettable off timer</h4>
<p>This recipe will turn on a light when there is motion and turn off the light when ten minutes has passed without any motion events.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="key">automation</span>:
<span class="key">alias</span>: <span class="string"><span class="content">Turn on kitchen lights when there is movement</span></span>
<span class="key">trigger</span>:
- <span class="string"><span class="content">platform: state</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">sensor.motion_sensor</span></span>
<span class="key">to</span>: <span class="string"><span class="content">'on'</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">homeassistant.turn_on</span></span>
<span class="key">entity_id</span>: <span class="string"><span class="content">script.timed_lamp</span></span>
<span class="key">script</span>:
<span class="key">timed_lamp</span>:
<span class="key">alias</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Turn on lamp and set timer</span><span class="delimiter">&quot;</span></span>
<span class="key">sequence</span>:
<span class="comment"># Cancel ev. old timers</span>
- <span class="string"><span class="content">service: script.turn_off</span></span>
<span class="key">data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">script.timer_off</span></span>
- <span class="string"><span class="content">service: light.turn_on</span></span>
<span class="key">data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">light.kitchen</span></span>
<span class="comment"># Set new timer</span>
- <span class="string"><span class="content">service: script.turn_on</span></span>
<span class="key">data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">script.timer_off</span></span>
<span class="key">timer_off</span>:
<span class="key">alias</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Turn off lamp after 10 minutes</span><span class="delimiter">&quot;</span></span>
<span class="key">sequence</span>:
- <span class="string"><span class="content">delay:</span><span class="content">
minutes: 10</span></span>
- <span class="string"><span class="content">service: light.turn_off</span></span>
<span class="key">data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">light.kitchen</span></span>
</pre></div>
</div>
</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='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/_cookbook/turn_on_light_for_10_minutes_when_motion_detected.markdown'>Edit this page on GitHub</a></div>
<div class='section'>
<a href='/cookbook'>Back to the cookbook</a>
</div>
<div class='section'>
<h1 class="title delta">Automation Examples</h1>
<ul class='divided'>
<li>
<a href='/cookbook/automation_for_rainy_days/'>Automation for rainy days</a>
</li>
<li>
<a href='/cookbook/dim_lights_when_playing_media/'>Dim lights when playing media</a>
</li>
<li>
<a href='/cookbook/basic_example_use_trigger_values/'>Example using use_trigger_values</a>
</li>
<li>
<a href='/cookbook/automation_flashing_lights/'>Examples for flashing lights</a>
</li>
<li>
<a href='/cookbook/automation_sun/'>Examples using the sun</a>
</li>
<li>
<a href='/cookbook/foscam_away_mode_PTZ/'>Foscam Recording during Away Mode Only using Pan/Tilt/Zoom Control and Motion Detection</a>
</li>
<li>
<a href='/cookbook/perform_actions_based_on_input_select/'>Perform actions based on input select</a>
</li>
<li>
<a href='/cookbook/restart_ha_if_wemo_switch_is_not_detected/'>Restart Home Assistant if Wemo Switch is not detected</a>
</li>
<li>
<a href='/cookbook/send_a_reminder/'>Send a reminder</a>
</li>
<li>
<a href='/cookbook/notify_if_over_threshold/'>Send notification based on sensor</a>
</li>
<li>
<a href='/cookbook/notify_if__new_ha_release/'>Send notification if new Home Assistant release</a>
</li>
<li>
<a href='/cookbook/track_battery_level/'>Track your battery level</a>
</li>
<li>
Turn on lights for 10 minutes after motion detected
</li>
<li>
<a href='/cookbook/automation_using_timeinterval_inputboolean/'>Using time interval and input boolean</a>
</li>
</ul>
</div>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></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 />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>