Site updated at 2016-08-22 08:21:42 UTC

This commit is contained in:
Travis CI 2016-08-22 08:21:43 +00:00
parent f9d65cbe57
commit 4acb07bf8e
559 changed files with 18878 additions and 21688 deletions

875
atom.xml

File diff suppressed because it is too large Load diff

View file

@ -87,13 +87,13 @@
<div class="meta clearfix"> <div class="meta clearfix">
<time datetime="2014-12-18T23:24:45+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> December 18, 2014</time> <time datetime="2014-12-18T23:24:45+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> December 18, 2014</time>
<span class="byline author vcard"><i class='icon-user'></i> Paulus Schoutsen</span> <span class="byline author vcard"><i class='icon-user'></i> Paulus Schoutsen</span>
<span><i class='icon-time'></i> less than one minute reading time</span> <span><i class='icon-time'></i> Less than one minute reading time</span>
<span> <span>
<i class="icon-tags"></i> <i class="icon-tags"></i>
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/website/'>Website</a></li> <li>Website</li>
</ul> </ul>
@ -182,7 +182,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/internet-of-things/'>Internet-of-Things</a></li> <li>Internet-of-Things</li>
</ul> </ul>
@ -108,7 +108,7 @@
</header> </header>
<p>The internet has been buzzing over the last year about home automation. A lot of different terms fly around like the internet of things, home automation and the smart home.<br /> <p>The internet has been buzzing over the last year about home automation. A lot of different terms fly around like the internet of things, home automation and the smart home.
This article will try to explain how they all relate.</p> This article will try to explain how they all relate.</p>
<p>The first thing to introduce is the <strong>Internet of Things</strong> (IoT). This refers to a new generation of devices that cannot only be controlled by humans via buttons or remotes but also provide an interface to communicate with other devices and applications. For example, an IoT-capable coffee machine could receive commands to create different types of coffee and be able to broadcast the amount of water left in its resevoir.</p> <p>The first thing to introduce is the <strong>Internet of Things</strong> (IoT). This refers to a new generation of devices that cannot only be controlled by humans via buttons or remotes but also provide an interface to communicate with other devices and applications. For example, an IoT-capable coffee machine could receive commands to create different types of coffee and be able to broadcast the amount of water left in its resevoir.</p>
@ -237,7 +237,7 @@ This article will try to explain how they all relate.</p>
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -123,14 +123,12 @@
<h3>Enabling the notify component</h3> <h3>Enabling the notify component</h3>
<p>To enable the new notify component, add the following to your <code>home-assistant.conf</code>:</p> <p>To enable the new notify component, add the following to your <code class="highlighter-rouge">home-assistant.conf</code>:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-conf highlighter-rouge"><pre class="highlight"><code>[<span class="n">notify</span>]
<div class="code"><pre>[notify] <span class="n">platform</span>=<span class="n">pushbullet</span>
platform=pushbullet <span class="n">api_key</span>=<span class="n">ABCDEFGHJKLMNOPQRSTUVXYZ</span>
api_key=ABCDEFGHJKLMNOPQRSTUVXYZ </code></pre>
</pre></div>
</div>
</div> </div>
<p>You can get your api key from <a href="https://www.pushbullet.com/account">your account page on PushBullet.com</a>.</p> <p>You can get your api key from <a href="https://www.pushbullet.com/account">your account page on PushBullet.com</a>.</p>
@ -139,14 +137,12 @@ api_key=ABCDEFGHJKLMNOPQRSTUVXYZ
<p>To be able to send messages, the notify component has to be loaded and initialized successfully.</p> <p>To be able to send messages, the notify component has to be loaded and initialized successfully.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-python highlighter-rouge"><pre class="highlight"><code><span class="kn">import</span> <span class="nn">homeassistant.loader</span> <span class="kn">as</span> <span class="nn">loader</span>
<div class="code"><pre><span class="keyword">import</span> <span class="include">homeassistant.loader</span> <span class="keyword">as</span> loader
<span class="keyword">def</span> <span class="function">setup</span>(hass, config): <span class="k">def</span> <span class="nf">setup</span><span class="p">(</span><span class="n">hass</span><span class="p">,</span> <span class="n">config</span><span class="p">):</span>
notify = loader.get_component(<span class="string"><span class="delimiter">'</span><span class="content">notify</span><span class="delimiter">'</span></span>) <span class="n">notify</span> <span class="o">=</span> <span class="n">loader</span><span class="o">.</span><span class="n">get_component</span><span class="p">(</span><span class="s">'notify'</span><span class="p">)</span>
notify.send_message(hass, <span class="string"><span class="delimiter">&quot;</span><span class="content">Hello from my component!</span><span class="delimiter">&quot;</span></span>) <span class="n">notify</span><span class="o">.</span><span class="n">send_message</span><span class="p">(</span><span class="n">hass</span><span class="p">,</span> <span class="s">"Hello from my component!"</span><span class="p">)</span>
</pre></div> </code></pre>
</div>
</div> </div>
</article> </article>
@ -221,7 +217,7 @@ api_key=ABCDEFGHJKLMNOPQRSTUVXYZ
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -87,13 +87,13 @@
<div class="meta clearfix"> <div class="meta clearfix">
<time datetime="2015-01-11T21:49:08+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> January 11, 2015</time> <time datetime="2015-01-11T21:49:08+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> January 11, 2015</time>
<span class="byline author vcard"><i class='icon-user'></i> Paulus Schoutsen</span> <span class="byline author vcard"><i class='icon-user'></i> Paulus Schoutsen</span>
<span><i class='icon-time'></i> less than one minute reading time</span> <span><i class='icon-time'></i> Less than one minute reading time</span>
<span> <span>
<i class="icon-tags"></i> <i class="icon-tags"></i>
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -114,12 +114,10 @@
<p>Most devices still require some sort of interaction from the user after being discovered - be it a button being pressed or some sort of authentication. This is a challenge that will be solved in the future.</p> <p>Most devices still require some sort of interaction from the user after being discovered - be it a button being pressed or some sort of authentication. This is a challenge that will be solved in the future.</p>
<p>To enable the discovery component, add the following to your <code>home-assistant.conf</code>:</p> <p>To enable the discovery component, add the following to your <code class="highlighter-rouge">home-assistant.conf</code>:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-conf highlighter-rouge"><pre class="highlight"><code>[<span class="n">discovery</span>]
<div class="code"><pre>[discovery] </code></pre>
</pre></div>
</div>
</div> </div>
<p>A new <a href="/developers/add_new_platform/#discovery">discovery section</a> has been added to the Adding a new platform page with instructions how to make your platform discoverable.</p> <p>A new <a href="/developers/add_new_platform/#discovery">discovery section</a> has been added to the Adding a new platform page with instructions how to make your platform discoverable.</p>
@ -196,7 +194,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -87,13 +87,13 @@
<div class="meta clearfix"> <div class="meta clearfix">
<time datetime="2015-01-13T16:29:04+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> January 13, 2015</time> <time datetime="2015-01-13T16:29:04+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> January 13, 2015</time>
<span class="byline author vcard"><i class='icon-user'></i> Paulus Schoutsen</span> <span class="byline author vcard"><i class='icon-user'></i> Paulus Schoutsen</span>
<span><i class='icon-time'></i> less than one minute reading time</span> <span><i class='icon-time'></i> Less than one minute reading time</span>
<span> <span>
<i class="icon-tags"></i> <i class="icon-tags"></i>
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -116,15 +116,13 @@
<p>The new integration exists out of two parts: a generic thermostat component and a Nest platform implementation. The initial version implements provides a read-only card and services to control it. The plan is in the future to add temperature and away mode controls from the thermostat card and more info dialog. Internally, we are using the Python package <a href="https://github.com/jkoelker/python-nest">python-nest by jkoelker</a> to talk to the Nest.</p> <p>The new integration exists out of two parts: a generic thermostat component and a Nest platform implementation. The initial version implements provides a read-only card and services to control it. The plan is in the future to add temperature and away mode controls from the thermostat card and more info dialog. Internally, we are using the Python package <a href="https://github.com/jkoelker/python-nest">python-nest by jkoelker</a> to talk to the Nest.</p>
<p>If you own a Nest thermostat, add the following lines to your <code>home-assistant.conf</code>:</p> <p>If you own a Nest thermostat, add the following lines to your <code class="highlighter-rouge">home-assistant.conf</code>:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-conf highlighter-rouge"><pre class="highlight"><code>[<span class="n">thermostat</span>]
<div class="code"><pre>[thermostat] <span class="n">platform</span>=<span class="n">nest</span>
platform=nest <span class="n">username</span>=<span class="n">YOUR_USERNAME</span>
username=YOUR_USERNAME <span class="n">password</span>=<span class="n">YOUR_PASSWORD</span>
password=YOUR_PASSWORD </code></pre>
</pre></div>
</div>
</div> </div>
</article> </article>
@ -199,7 +197,7 @@ password=YOUR_PASSWORD
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -110,13 +110,13 @@
<p>I have just merged the latest version of the development branch into master. Here are some of the highlights of this release:</p> <p>I have just merged the latest version of the development branch into master. Here are some of the highlights of this release:</p>
<p><strong>Configuration via the frontend</strong><br /><br /> <p><strong>Configuration via the frontend</strong><br />
Phliips Hue will now be auto discovered and uses the new <code>configurator</code> component to interact with the user to finish the setup process.</p> Phliips Hue will now be auto discovered and uses the new <code class="highlighter-rouge">configurator</code> component to interact with the user to finish the setup process.</p>
<p><strong>Wink Hub support</strong><br /><br /> <p><strong>Wink Hub support</strong><br />
Thanks to the work done by John McLaughlin and Geoff Norton we now support the lights, switches and sensors that are connected to the Wink hub.</p> Thanks to the work done by John McLaughlin and Geoff Norton we now support the lights, switches and sensors that are connected to the Wink hub.</p>
<p><strong>The getting started guide and component page have been reorganized</strong><br /><br /> <p><strong>The getting started guide and component page have been reorganized</strong><br />
The getting started instructions have been split into separate pages per component and a general overview page. The goal is to have a page per component that describes:</p> The getting started instructions have been split into separate pages per component and a general overview page. The goal is to have a page per component that describes:</p>
<ul> <ul>
@ -127,11 +127,11 @@ The getting started instructions have been split into separate pages per compone
<li>Additional development tips</li> <li>Additional development tips</li>
</ul> </ul>
<p><strong>More reasonable errors</strong><br /><br /> <p><strong>More reasonable errors</strong><br />
Home Assistant should now throw better errors and offer solutions if you do not have the right version of Python 3, forgot to clone the git submodules or install the dependencies.</p> Home Assistant should now throw better errors and offer solutions if you do not have the right version of Python 3, forgot to clone the git submodules or install the dependencies.</p>
<p><strong>Streamlined first launch</strong><br /><br /> <p><strong>Streamlined first launch</strong><br />
Home Assistant now supports <code>--open-ui</code> and <code>--demo-mode</code> command line properties to open the browser automatically and have something to show. Home Assistant now supports to be run without a password, allowing the interface to login automatically on launch.</p> Home Assistant now supports <code class="highlighter-rouge">--open-ui</code> and <code class="highlighter-rouge">--demo-mode</code> command line properties to open the browser automatically and have something to show. Home Assistant now supports to be run without a password, allowing the interface to login automatically on launch.</p>
</article> </article>
@ -205,7 +205,7 @@ Home Assistant now supports <code>--open-ui</code> and <code>--demo-mode</code>
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -119,7 +119,7 @@
<p>Adding history to the UI was a challenge on itself because the old UI did not support easy navigation. So to add to the awesomeness of this release, Home Assistant also got a face lift.</p> <p>Adding history to the UI was a challenge on itself because the old UI did not support easy navigation. So to add to the awesomeness of this release, Home Assistant also got a face lift.</p>
<p>The history component will be enabled for new users by default. For current users, run <code>scripts/update</code> to upgrade to the latest version and add <code>[history]</code> to your <code>home-assistant.conf</code> file.</p> <p>The history component will be enabled for new users by default. For current users, run <code class="highlighter-rouge">scripts/update</code> to upgrade to the latest version and add <code class="highlighter-rouge">[history]</code> to your <code class="highlighter-rouge">home-assistant.conf</code> file.</p>
<p class="img"> <p class="img">
<a href="/images/screenshots/component_history_24h.png"> <a href="/images/screenshots/component_history_24h.png">
@ -213,7 +213,7 @@ Events are saved in a local database. Google Graphs is used to draw the graph. D
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -116,7 +116,7 @@
<a name="read-more"></a> <a name="read-more"></a>
<p>Streaming updates has been implemented using the HTML5 <code>EventSource</code> tag. Implementation is pretty straight forward as all the reconnection logic will be handled by the event source tag. The <a href="https://github.com/home-assistant/home-assistant/blob/master/homeassistant/components/api.py#L90">server-side code</a> is 50 lines and the <a href="https://github.com/home-assistant/home-assistant-js/blob/master/src/actions/stream.js">client-side code</a> is 80 lines of code.</p> <p>Streaming updates has been implemented using the HTML5 <code class="highlighter-rouge">EventSource</code> tag. Implementation is pretty straight forward as all the reconnection logic will be handled by the event source tag. The <a href="https://github.com/home-assistant/home-assistant/blob/master/homeassistant/components/api.py#L90">server-side code</a> is 50 lines and the <a href="https://github.com/home-assistant/home-assistant-js/blob/master/src/actions/stream.js">client-side code</a> is 80 lines of code.</p>
<p>All events that happen on the server will now also be sent to the browser. This turns any browser running the UI into a fully functioning <a href="https://home-assistant.io/developers/architecture/#multiple-connected-instances">slave instance</a> of Home Assistant. This opens up new possibilities for Home Assistant components that live completely client-side.</p> <p>All events that happen on the server will now also be sent to the browser. This turns any browser running the UI into a fully functioning <a href="https://home-assistant.io/developers/architecture/#multiple-connected-instances">slave instance</a> of Home Assistant. This opens up new possibilities for Home Assistant components that live completely client-side.</p>
@ -124,7 +124,7 @@
<p>A connection can go stale in Chrome without any event handler being called. This happens when a device goes into standby. For computers this is rare but for phones this occurs quite often. This has been solved by sending a regular ping from the server. The frontend will assume the connection has gone stale when it hasnt heard any communication for a while. Sending a ping will also help the server detect broken connections and clean them up.</p> <p>A connection can go stale in Chrome without any event handler being called. This happens when a device goes into standby. For computers this is rare but for phones this occurs quite often. This has been solved by sending a regular ping from the server. The frontend will assume the connection has gone stale when it hasnt heard any communication for a while. Sending a ping will also help the server detect broken connections and clean them up.</p>
<p>Another issue that I encountered is that Safari and Firefox would not fire the <code>open</code> event when the connection has been opened but when the first message has been received. To work around this the server will now fire a ping when the connection gets opened.</p> <p>Another issue that I encountered is that Safari and Firefox would not fire the <code class="highlighter-rouge">open</code> event when the connection has been opened but when the first message has been received. To work around this the server will now fire a ping when the connection gets opened.</p>
</article> </article>
@ -198,7 +198,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -87,13 +87,13 @@
<div class="meta clearfix"> <div class="meta clearfix">
<time datetime="2015-03-01T19:38:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> March 1, 2015</time> <time datetime="2015-03-01T19:38:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> March 1, 2015</time>
<span class="byline author vcard"><i class='icon-user'></i> Theodor Lindquist</span> <span class="byline author vcard"><i class='icon-user'></i> Theodor Lindquist</span>
<span><i class='icon-time'></i> less than one minute reading time</span> <span><i class='icon-time'></i> Less than one minute reading time</span>
<span> <span>
<i class="icon-tags"></i> <i class="icon-tags"></i>
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -188,7 +188,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -87,13 +87,13 @@
<div class="meta clearfix"> <div class="meta clearfix">
<time datetime="2015-03-08T22:16:10+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> March 8, 2015</time> <time datetime="2015-03-08T22:16:10+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> March 8, 2015</time>
<span class="byline author vcard"><i class='icon-user'></i> Paulus Schoutsen</span> <span class="byline author vcard"><i class='icon-user'></i> Paulus Schoutsen</span>
<span><i class='icon-time'></i> less than one minute reading time</span> <span><i class='icon-time'></i> Less than one minute reading time</span>
<span> <span>
<i class="icon-tags"></i> <i class="icon-tags"></i>
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/organisation/'>Organisation</a></li> <li>Organisation</li>
</ul> </ul>
@ -189,7 +189,7 @@ The old logo, the new detailed logo and the new simple logo.
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -110,50 +110,44 @@
<p>It has only been a little over a week since Theodor introduced YAML support for Home Assistant but so much has already happened that it is time for a summary of recent changes. Before mentioning the highlights I want to thank <a href="https://github.com/andythigpen">andythigpen</a>, <a href="https://github.com/jamespcole">jamespcole</a> and <a href="https://github.com/theolind">theolind</a> for numerous bug fixes, enhancements and new contributions. Thanks!</p> <p>It has only been a little over a week since Theodor introduced YAML support for Home Assistant but so much has already happened that it is time for a summary of recent changes. Before mentioning the highlights I want to thank <a href="https://github.com/andythigpen">andythigpen</a>, <a href="https://github.com/jamespcole">jamespcole</a> and <a href="https://github.com/theolind">theolind</a> for numerous bug fixes, enhancements and new contributions. Thanks!</p>
<p><strong>Monitor local resources.</strong><br /><br /> <p><strong>Monitor local resources.</strong><br />
Theodor has contributed a new sensor platform to allow you to monitor disk usage, memory usage, CPU usage and running processes. This platform has superseded the process component which is now considered deprecated.</p> Theodor has contributed a new sensor platform to allow you to monitor disk usage, memory usage, CPU usage and running processes. This platform has superseded the process component which is now considered deprecated.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">sensor</span><span class="pi">:</span>
<span class="key">sensor</span>: <span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">systemmonitor</span>
- <span class="string"><span class="content">platform: systemmonitor</span></span> <span class="s">resources</span><span class="pi">:</span>
<span class="key">resources</span>: <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s">disk_use_percent</span>
- <span class="string"><span class="content">type: disk_use_percent</span></span> <span class="s">arg</span><span class="pi">:</span> <span class="s">/home</span>
<span class="key">arg</span>: <span class="string"><span class="content">/home</span></span> <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s">memory_free</span>
- <span class="string"><span class="content">type: memory_free</span></span> <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s">process</span>
- <span class="string"><span class="content">type: process</span></span> <span class="s">arg</span><span class="pi">:</span> <span class="s">kodi</span>
<span class="key">arg</span>: <span class="string"><span class="content">kodi</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>Experimental Z-Wave support</strong><br /><br /> <p><strong>Experimental Z-Wave support</strong><br />
There is now experimental support for connecting Z-Wave networks using a Z-Wave USB stick. Right now it only integrates Z-Wave sensors into Home Assistant. Our goal is to get this tested by more people before adding support for other Z-Wave devices.</p> There is now experimental support for connecting Z-Wave networks using a Z-Wave USB stick. Right now it only integrates Z-Wave sensors into Home Assistant. Our goal is to get this tested by more people before adding support for other Z-Wave devices.</p>
<p>The new component is built on top of <a href="https://code.google.com/p/python-openzwave/">python-openzwave</a>. This package is currently not distributed on PyPi so weve added a script <code>scripts/build_python_openzwave</code> to install it on your machine. Alternatively you can use the Docker image which is ready to go.</p> <p>The new component is built on top of <a href="https://code.google.com/p/python-openzwave/">python-openzwave</a>. This package is currently not distributed on PyPi so weve added a script <code class="highlighter-rouge">scripts/build_python_openzwave</code> to install it on your machine. Alternatively you can use the Docker image which is ready to go.</p>
<p>The development was done using an AEON Z-Wave USB stick and an AEON Z-Wave MultiSensor.</p> <p>The development was done using an AEON Z-Wave USB stick and an AEON Z-Wave MultiSensor.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">zwave</span><span class="pi">:</span>
<span class="key">zwave</span>: <span class="s">usb_path</span><span class="pi">:</span> <span class="s">/dev/ttyUSB0</span>
<span class="key">usb_path</span>: <span class="string"><span class="content">/dev/ttyUSB0</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>Voice control</strong><br /><br /> <p><strong>Voice control</strong><br />
An initial version of voice control for Home Assistant has landed. The current implementation consists of two parts.</p> An initial version of voice control for Home Assistant has landed. The current implementation consists of two parts.</p>
<p>The first part is a component called <code>conversation</code> that exposes the service <code>conversation/process</code>. This service is capable of processing text and translating them into commands for devices. For now it will only support commands in the format of <code>Turn &lt;Friendly Name&gt; &lt;on/off&gt;</code>.</p> <p>The first part is a component called <code class="highlighter-rouge">conversation</code> that exposes the service <code class="highlighter-rouge">conversation/process</code>. This service is capable of processing text and translating them into commands for devices. For now it will only support commands in the format of <code class="highlighter-rouge">Turn &lt;Friendly Name&gt; &lt;on/off&gt;</code>.</p>
<p>The second part is an upgrade to the frontend to use the speech-to-text in Chrome to allow users to speak commands. If youre using Chrome, you can test this out in <a href="/demo/">the demo</a>.</p> <p>The second part is an upgrade to the frontend to use the speech-to-text in Chrome to allow users to speak commands. If youre using Chrome, you can test this out in <a href="/demo/">the demo</a>.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">conversation</span><span class="pi">:</span>
<span class="key">conversation</span>: </code></pre>
</pre></div>
</div>
</div> </div>
</article> </article>
@ -228,7 +222,7 @@ An initial version of voice control for Home Assistant has landed. The current i
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -110,87 +110,79 @@
<p>A new version of Home Assistant has just been pushed out. It contains bugfixes contributed by <a href="https://github.com/jamespcole">jamespcole</a>, <a href="https://github.com/andythigpen">andythigpen</a>, <a href="https://github.com/trainman419">trainman419</a> and <a href="https://github.com/balloob">me</a>. It also adds a bunch of great new features:</p> <p>A new version of Home Assistant has just been pushed out. It contains bugfixes contributed by <a href="https://github.com/jamespcole">jamespcole</a>, <a href="https://github.com/andythigpen">andythigpen</a>, <a href="https://github.com/trainman419">trainman419</a> and <a href="https://github.com/balloob">me</a>. It also adds a bunch of great new features:</p>
<p><strong>Script</strong><br /> <p><strong>Script</strong>
Andythigpen has contributed a script component. This allows users to create a sequence of service calls and delays. Scripts can be started using the service <code>script/turn_on</code> and interrupted using the service <code>script/turn_off</code>. A separate page has been added to the frontend to see the status of your scripts.</p> Andythigpen has contributed a script component. This allows users to create a sequence of service calls and delays. Scripts can be started using the service <code class="highlighter-rouge">script/turn_on</code> and interrupted using the service <code class="highlighter-rouge">script/turn_off</code>. A separate page has been added to the frontend to see the status of your scripts.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">script</span><span class="pi">:</span>
<span class="key">script</span>: <span class="c1"># Turns on the bedroom lights and then the living room lights 1 minute later</span>
<span class="comment"># Turns on the bedroom lights and then the living room lights 1 minute later</span> <span class="s">wakeup</span><span class="pi">:</span>
<span class="key">wakeup</span>: <span class="s">alias</span><span class="pi">:</span> <span class="s">Wake Up</span>
<span class="key">alias</span>: <span class="string"><span class="content">Wake Up</span></span> <span class="s">sequence</span><span class="pi">:</span>
<span class="key">sequence</span>: <span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Bedroom lights on</span>
- <span class="string"><span class="content">alias: Bedroom lights on</span></span> <span class="s">execute_service</span><span class="pi">:</span> <span class="s">light.turn_on</span>
<span class="key">execute_service</span>: <span class="string"><span class="content">light.turn_on</span></span> <span class="s">service_data</span><span class="pi">:</span>
<span class="key">service_data</span>: <span class="s">entity_id</span><span class="pi">:</span> <span class="s">group.bedroom</span>
<span class="key">entity_id</span>: <span class="string"><span class="content">group.bedroom</span></span> <span class="pi">-</span> <span class="s">delay</span><span class="pi">:</span>
- <span class="string"><span class="content">delay:</span><span class="content"> <span class="c1"># supports seconds, milliseconds, minutes, hours, etc.</span>
# supports seconds, milliseconds, minutes, hours, etc. <span class="s">minutes</span><span class="pi">:</span> <span class="s">1</span>
minutes: 1</span></span> <span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Living room lights on</span>
- <span class="string"><span class="content">alias: Living room lights on</span></span> <span class="s">execute_service</span><span class="pi">:</span> <span class="s">light.turn_on</span>
<span class="key">execute_service</span>: <span class="string"><span class="content">light.turn_on</span></span> <span class="s">service_data</span><span class="pi">:</span>
<span class="key">service_data</span>: <span class="s">entity_id</span><span class="pi">:</span> <span class="s">group.living_room</span>
<span class="key">entity_id</span>: <span class="string"><span class="content">group.living_room</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<a name="read-more"></a> <a name="read-more"></a>
<p><strong>Scene</strong><br /> <p><strong>Scene</strong>
I (Paulus) have contributed a scene component. A user can create scenes that capture the states you want certain entities to be. For example a scene can contain that light A should be turned on and light B should be bright red. Deactivating a scene will restore the previous state from before the scene was activated. Just like scripts, scenes have their own separate page to see which scenes are on.</p> I (Paulus) have contributed a scene component. A user can create scenes that capture the states you want certain entities to be. For example a scene can contain that light A should be turned on and light B should be bright red. Deactivating a scene will restore the previous state from before the scene was activated. Just like scripts, scenes have their own separate page to see which scenes are on.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">scene</span><span class="pi">:</span>
<span class="key">scene</span>: <span class="pi">-</span> <span class="s">name</span><span class="pi">:</span> <span class="s">Romantic</span>
- <span class="string"><span class="content">name: Romantic</span></span> <span class="s">entities</span><span class="pi">:</span>
<span class="key">entities</span>: <span class="s">light.tv_back_light</span><span class="pi">:</span> <span class="s">on</span>
<span class="key">light.tv_back_light</span>: <span class="string"><span class="content">on</span></span> <span class="s">light.ceiling</span><span class="pi">:</span>
<span class="key">light.ceiling</span>: <span class="s">state</span><span class="pi">:</span> <span class="s">on</span>
<span class="key">state</span>: <span class="string"><span class="content">on</span></span> <span class="s">color</span><span class="pi">:</span> <span class="pi">[</span><span class="nv">0.33</span><span class="pi">,</span> <span class="nv">0.66</span><span class="pi">]</span>
<span class="key">color</span>: <span class="string"><span class="content">[0.33, 0.66]</span></span> <span class="s">brightness</span><span class="pi">:</span> <span class="s">200</span>
<span class="key">brightness</span>: <span class="string"><span class="content">200</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><a name="sabnzbd"></a><br /> <p><a name="sabnzbd"></a>
<strong>SABnzbd</strong><br /> <strong>SABnzbd</strong>
<img src="/images/supported_brands/sabnzbd.png" style="border:none; box-shadow: none; float: right;" height="50" /> James Cole has contributed support to integrate SABnzbd. This will allow you to monitor your downloads from within Home Assistant and setup automation based on the information.</p> <img src="/images/supported_brands/sabnzbd.png" style="border:none; box-shadow: none; float: right;" height="50" /> James Cole has contributed support to integrate SABnzbd. This will allow you to monitor your downloads from within Home Assistant and setup automation based on the information.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">sensor</span><span class="pi">:</span>
<span class="key">sensor</span>: <span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">sabnzbd</span>
- <span class="string"><span class="content">platform: sabnzbd</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s">SAB</span>
<span class="key">name</span>: <span class="string"><span class="content">SAB</span></span> <span class="s">api_key</span><span class="pi">:</span> <span class="s">YOUR_API_KEY</span>
<span class="key">api_key</span>: <span class="string"><span class="content">YOUR_API_KEY</span></span> <span class="c1"># Example: http://192.168.1.32:8124/</span>
<span class="comment"># Example: http://192.168.1.32:8124/</span> <span class="s">base_url</span><span class="pi">:</span> <span class="s">YOUR_SABNZBD_BASE_URL</span>
<span class="key">base_url</span>: <span class="string"><span class="content">YOUR_SABNZBD_BASE_URL</span></span> <span class="s">monitored_variables</span><span class="pi">:</span>
<span class="key">monitored_variables</span>: <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s1">'</span><span class="s">current_status'</span>
- <span class="string"><span class="content">type: 'current_status'</span></span> <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s1">'</span><span class="s">speed'</span>
- <span class="string"><span class="content">type: 'speed'</span></span> <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s1">'</span><span class="s">queue_size'</span>
- <span class="string"><span class="content">type: 'queue_size'</span></span> <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s1">'</span><span class="s">queue_remaining'</span>
- <span class="string"><span class="content">type: 'queue_remaining'</span></span> <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s1">'</span><span class="s">disk_size'</span>
- <span class="string"><span class="content">type: 'disk_size'</span></span> <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s1">'</span><span class="s">disk_free'</span>
- <span class="string"><span class="content">type: 'disk_free'</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><a name="pushover"></a><br /> <p><a name="pushover"></a>
<strong>PushOver</strong><br /> <strong>PushOver</strong>
<img src="/images/supported_brands/pushover.png" style="border:none; box-shadow: none; float: right;" height="50" /> James Cole has also contributed support for <a href="https://pushover.net/">the PushOver service</a> as a platform for the notify component. This allows components to send messages to the user using PushOver.</p> <img src="/images/supported_brands/pushover.png" style="border:none; box-shadow: none; float: right;" height="50" /> James Cole has also contributed support for <a href="https://pushover.net/">the PushOver service</a> as a platform for the notify component. This allows components to send messages to the user using PushOver.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">notify</span><span class="pi">:</span>
<span class="key">notify</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">pushover</span>
<span class="key">platform</span>: <span class="string"><span class="content">pushover</span></span> <span class="c1"># Get this by registering a new application on https://pushover.net</span>
<span class="comment"># Get this by registering a new application on https://pushover.net</span> <span class="s">api_key</span><span class="pi">:</span> <span class="s">ABCDEFGHJKLMNOPQRSTUVXYZ</span>
<span class="key">api_key</span>: <span class="string"><span class="content">ABCDEFGHJKLMNOPQRSTUVXYZ</span></span> <span class="c1"># Get this by logging into your account on https://pushover.net</span>
<span class="comment"># Get this by logging into your account on https://pushover.net</span> <span class="s">user_key</span><span class="pi">:</span> <span class="s">ABCDEFGHJKLMNOPQRSTUVXYZ</span>
<span class="key">user_key</span>: <span class="string"><span class="content">ABCDEFGHJKLMNOPQRSTUVXYZ</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
</article> </article>
@ -265,7 +257,7 @@ I (Paulus) have contributed a scene component. A user can create scenes that cap
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -110,98 +110,90 @@
<p>Its been a month since the latest update and a lot has happened again. Here a quick overview of the new things.</p> <p>Its been a month since the latest update and a lot has happened again. Here a quick overview of the new things.</p>
<p><strong>Line Charts</strong><br /> <p><strong>Line Charts</strong>
<a href="https://github.com/jamespcole">James</a> has upgraded the history in the frontend to support line graphs. Line graphs will be shown for any entity that has a unit of measurement. The line graphs will also be shown in the more info card of an entity. <a href="/demo/">See the demo for a live example.</a></p> <a href="https://github.com/jamespcole">James</a> has upgraded the history in the frontend to support line graphs. Line graphs will be shown for any entity that has a unit of measurement. The line graphs will also be shown in the more info card of an entity. <a href="/demo/">See the demo for a live example.</a></p>
<p class="img"> <p class="img">
<img src="/images/screenshots/history-line-graphs.png" /> <img src="/images/screenshots/history-line-graphs.png" />
</p> </p>
<p><strong>ISY994 hub support</strong><br /> <p><strong>ISY994 hub support</strong>
<img src="/images/supported_brands/universal_devices.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/rmkraus">Ryan</a> has contributed support to integrate the ISY994 hub by Universal Devices. This allows you to integrate your X10/Insteon sensors, switches and lights.</p> <img src="/images/supported_brands/universal_devices.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/rmkraus">Ryan</a> has contributed support to integrate the ISY994 hub by Universal Devices. This allows you to integrate your X10/Insteon sensors, switches and lights.</p>
<p>He has created an extensive getting started guide which can be found on <a href="/components/isy994/">the ISY994 component page</a>.</p> <p>He has created an extensive getting started guide which can be found on <a href="/components/isy994/">the ISY994 component page</a>.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">isy994</span><span class="pi">:</span>
<span class="key">isy994</span>: </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>Logbook</strong><br /> <p><strong>Logbook</strong>
<img src="/images/screenshots/logbook.png" style="margin-left:10px; float: right;" height="100" /> I (Paulus) have added a logbook component. The logbook component provides a different perspective on the history of your house by showing all the changes that happened to your house in chronological order. <a href="/demo/">See the demo for a live example.</a><br /> <img src="/images/screenshots/logbook.png" style="margin-left:10px; float: right;" height="100" /> I (Paulus) have added a logbook component. The logbook component provides a different perspective on the history of your house by showing all the changes that happened to your house in chronological order. <a href="/demo/">See the demo for a live example.</a>
<span class="clearfix"></span></p> <span class="clearfix"></span></p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">logbook</span><span class="pi">:</span>
<span class="key">logbook</span>: </code></pre>
</pre></div>
</div>
</div> </div>
<a name="read-more"></a> <a name="read-more"></a>
<p><strong>Transmission support</strong><br /> <p><strong>Transmission support</strong>
<img src="/images/supported_brands/transmission.png" style="border:none; box-shadow: none; float: right;" height="50" /> James has also contributed support for integrating Transmission into Home Assistant.</p> <img src="/images/supported_brands/transmission.png" style="border:none; box-shadow: none; float: right;" height="50" /> James has also contributed support for integrating Transmission into Home Assistant.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">sensor</span><span class="pi">:</span>
<span class="key">sensor</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">transmission</span>
<span class="key">platform</span>: <span class="string"><span class="content">transmission</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s">Transmission</span>
<span class="key">name</span>: <span class="string"><span class="content">Transmission</span></span> <span class="s">host</span><span class="pi">:</span> <span class="s">192.168.1.26</span>
<span class="key">host</span>: <span class="string"><span class="content">192.168.1.26</span></span> <span class="s">port</span><span class="pi">:</span> <span class="s">9091</span>
<span class="key">port</span>: <span class="string"><span class="content">9091</span></span> <span class="s">username</span><span class="pi">:</span> <span class="s">YOUR_USERNAME</span>
<span class="key">username</span>: <span class="string"><span class="content">YOUR_USERNAME</span></span> <span class="s">password</span><span class="pi">:</span> <span class="s">YOUR_PASSWORD</span>
<span class="key">password</span>: <span class="string"><span class="content">YOUR_PASSWORD</span></span> <span class="s">monitored_variables</span><span class="pi">:</span>
<span class="key">monitored_variables</span>: <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s1">'</span><span class="s">current_status'</span>
- <span class="string"><span class="content">type: 'current_status'</span></span> <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s1">'</span><span class="s">download_speed'</span>
- <span class="string"><span class="content">type: 'download_speed'</span></span> <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s1">'</span><span class="s">upload_speed'</span>
- <span class="string"><span class="content">type: 'upload_speed'</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>Modbus support</strong><br /> <p><strong>Modbus support</strong>
<a href="https://github.com/kixam">Kixam</a> has contributed support for modbus, a serial communication protocol to control PLCs. It currently supports sensors and switches which can be controlled over serial, TCP and UDP connections.</p> <a href="https://github.com/kixam">Kixam</a> has contributed support for modbus, a serial communication protocol to control PLCs. It currently supports sensors and switches which can be controlled over serial, TCP and UDP connections.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">modbus</span><span class="pi">:</span>
<span class="key">modbus</span>: <span class="s">type</span><span class="pi">:</span> <span class="s">serial</span>
<span class="key">type</span>: <span class="string"><span class="content">serial</span></span> <span class="s">method</span><span class="pi">:</span> <span class="s">rtu</span>
<span class="key">method</span>: <span class="string"><span class="content">rtu</span></span> <span class="s">port</span><span class="pi">:</span> <span class="s">/dev/ttyUSB0</span>
<span class="key">port</span>: <span class="string"><span class="content">/dev/ttyUSB0</span></span> <span class="s">baudrate</span><span class="pi">:</span> <span class="s">9600</span>
<span class="key">baudrate</span>: <span class="string"><span class="content">9600</span></span> <span class="s">stopbits</span><span class="pi">:</span> <span class="s">1</span>
<span class="key">stopbits</span>: <span class="string"><span class="content">1</span></span> <span class="s">bytesize</span><span class="pi">:</span> <span class="s">8</span>
<span class="key">bytesize</span>: <span class="string"><span class="content">8</span></span> <span class="s">parity</span><span class="pi">:</span> <span class="s">N</span>
<span class="key">parity</span>: <span class="string"><span class="content">N</span></span>
<span class="key">sensor</span>: <span class="s">sensor</span><span class="pi">:</span>
<span class="key">platform</span>: <span class="string"><span class="content">modbus</span></span> <span class="s">platform</span><span class="pi">:</span> <span class="s">modbus</span>
<span class="key">slave</span>: <span class="string"><span class="content">1</span></span> <span class="s">slave</span><span class="pi">:</span> <span class="s">1</span>
<span class="key">registers</span>: <span class="s">registers</span><span class="pi">:</span>
<span class="key">16</span>: <span class="s">16</span><span class="pi">:</span>
<span class="key">name</span>: <span class="string"><span class="content">My integer sensor</span><span class="content"> <span class="s">name</span><span class="pi">:</span> <span class="s">My integer sensor</span>
unit: C</span></span> <span class="s">unit</span><span class="pi">:</span> <span class="s">C</span>
<span class="key">24</span>: <span class="s">24</span><span class="pi">:</span>
<span class="key">bits</span>: <span class="s">bits</span><span class="pi">:</span>
<span class="key">0</span>: <span class="s">0</span><span class="pi">:</span>
<span class="key">name</span>: <span class="string"><span class="content">My boolean sensor</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s">My boolean sensor</span>
<span class="key">2</span>: <span class="s">2</span><span class="pi">:</span>
<span class="key">name</span>: <span class="string"><span class="content">My other boolean sensor</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s">My other boolean sensor</span>
<span class="key">switch</span>: <span class="s">switch</span><span class="pi">:</span>
<span class="key">platform</span>: <span class="string"><span class="content">modbus</span></span> <span class="s">platform</span><span class="pi">:</span> <span class="s">modbus</span>
<span class="key">slave</span>: <span class="string"><span class="content">1</span></span> <span class="s">slave</span><span class="pi">:</span> <span class="s">1</span>
<span class="key">registers</span>: <span class="s">registers</span><span class="pi">:</span>
<span class="key">24</span>: <span class="s">24</span><span class="pi">:</span>
<span class="key">bits</span>: <span class="s">bits</span><span class="pi">:</span>
<span class="key">0</span>: <span class="s">0</span><span class="pi">:</span>
<span class="key">name</span>: <span class="string"><span class="content">My switch</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s">My switch</span>
<span class="key">2</span>: <span class="s">2</span><span class="pi">:</span>
<span class="key">name</span>: <span class="string"><span class="content">My other switch</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s">My other switch</span>
</pre></div> </code></pre>
</div>
</div> </div>
</article> </article>
@ -276,7 +268,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -110,32 +110,30 @@
<p>I have recently merged code to refactor Home Assistant to use only UTC times internally. A much needed refactor. Ive added some extra test coverage to time sensitive parts to ensure stability. The code has been live in the dev branch for the last 9 days and will be soon released to the master branch.</p> <p>I have recently merged code to refactor Home Assistant to use only UTC times internally. A much needed refactor. Ive added some extra test coverage to time sensitive parts to ensure stability. The code has been live in the dev branch for the last 9 days and will be soon released to the master branch.</p>
<p>From now on all internal communication will be done in UTC: time changed events, datetime attributes of states, etc. To get the current time in UTC you can call <code>homeassistant.util.dt.utcnow()</code>. This is a timezone aware UTC datetime object. <a href="https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/util/dt.py"><code>homeassistant.util.dt</code></a> is a new util package with date helpers.</p> <p>From now on all internal communication will be done in UTC: time changed events, datetime attributes of states, etc. To get the current time in UTC you can call <code class="highlighter-rouge">homeassistant.util.dt.utcnow()</code>. This is a timezone aware UTC datetime object. <a href="https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/util/dt.py"><code class="highlighter-rouge">homeassistant.util.dt</code></a> is a new util package with date helpers.</p>
<p>There is also such a thing as local time. Local time is based on the time zone that you have setup in your <code>configuration.yaml</code>. Local times should only be used for user facing information: logs, frontend and automation settings in <code>configuration.yaml</code>.</p> <p>There is also such a thing as local time. Local time is based on the time zone that you have setup in your <code class="highlighter-rouge">configuration.yaml</code>. Local times should only be used for user facing information: logs, frontend and automation settings in <code class="highlighter-rouge">configuration.yaml</code>.</p>
<h3>Setting up your time zone</h3> <h3>Setting up your time zone</h3>
<p>Setting up a time zone happens in <code>configuration.yaml</code>. If you have no time zone setup, it will be auto detected using the existing detection code using <a href="https://freegeoip.net">freegeoip.net</a>. You can find a list of compatible time zones on <a href="http://en.wikipedia.org/wiki/List_of_tz_database_time_zones">Wikipedia</a>.</p> <p>Setting up a time zone happens in <code class="highlighter-rouge">configuration.yaml</code>. If you have no time zone setup, it will be auto detected using the existing detection code using <a href="https://freegeoip.net">freegeoip.net</a>. You can find a list of compatible time zones on <a href="http://en.wikipedia.org/wiki/List_of_tz_database_time_zones">Wikipedia</a>.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">homeassistant</span><span class="pi">:</span>
<div class="code"><pre><span class="key">homeassistant</span>: <span class="s">time_zone</span><span class="pi">:</span> <span class="s">America/Los_Angeles</span>
<span class="key">time_zone</span>: <span class="string"><span class="content">America/Los_Angeles</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<h3>Compatibility</h3> <h3>Compatibility</h3>
<p>The changes to the code are mostly backwards compatible. The old <code>hass.track_time_change</code> and <code>hass.track_point_in_time</code> use now internally two new methods: <code>hass.track_utc_time_change</code> and <code>hass.track_point_in_utc_time</code>. The usage of the old methods have not changed and should be backwards compatible.</p> <p>The changes to the code are mostly backwards compatible. The old <code class="highlighter-rouge">hass.track_time_change</code> and <code class="highlighter-rouge">hass.track_point_in_time</code> use now internally two new methods: <code class="highlighter-rouge">hass.track_utc_time_change</code> and <code class="highlighter-rouge">hass.track_point_in_utc_time</code>. The usage of the old methods have not changed and should be backwards compatible.</p>
<p>This refactor adds a new migration for the database adding a <code>utc_offset</code> column to events and states. This information is currently not used but can prove useful in the future when we start analyzing the historical data.</p> <p>This refactor adds a new migration for the database adding a <code class="highlighter-rouge">utc_offset</code> column to events and states. This information is currently not used but can prove useful in the future when we start analyzing the historical data.</p>
<h3><a class="title-link" name="backwards-incompatible-stuff" href="#backwards-incompatible-stuff"></a> Backwards incompatible stuff</h3> <h3><a class="title-link" name="backwards-incompatible-stuff" href="#backwards-incompatible-stuff"></a> Backwards incompatible stuff</h3>
<p>All built-in components have been upgraded. The following list is only for people that run custom components:</p> <p>All built-in components have been upgraded. The following list is only for people that run custom components:</p>
<ul> <ul>
<li><code>hass.track_time_change</code> and <code>hass.track_point_in_time</code> will now return a time zone aware datetime object. Python does not allow comparing a naive with an aware datetime object.</li> <li><code class="highlighter-rouge">hass.track_time_change</code> and <code class="highlighter-rouge">hass.track_point_in_time</code> will now return a time zone aware datetime object. Python does not allow comparing a naive with an aware datetime object.</li>
<li>the sun attributes for rising and setting are now in UTC. The methods <code>sun.next_rising(hass)</code> and <code>sun.next_setting(hass)</code> are backwards compatible, just be careful if you used to read the raw attributes.</li> <li>the sun attributes for rising and setting are now in UTC. The methods <code class="highlighter-rouge">sun.next_rising(hass)</code> and <code class="highlighter-rouge">sun.next_setting(hass)</code> are backwards compatible, just be careful if you used to read the raw attributes.</li>
<li>the API sends all times in UTC. If you use anything else besides the frontend to talk to HA, make sure it handles it differently.</li> <li>the API sends all times in UTC. If you use anything else besides the frontend to talk to HA, make sure it handles it differently.</li>
</ul> </ul>
</article> </article>
@ -211,7 +209,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -120,115 +120,101 @@ To update to the latest version, run <code>scripts/update</code>. Please report
<a name="read-more"></a> <a name="read-more"></a>
<p><strong>Overwriting Entity Attributes</strong><br /> <p><strong>Overwriting Entity Attributes</strong>
Before diving into the newly supported devices and services, I want to highlight an awesome configuration enhancement by <a href="https://github.com/rmkraus">rmkraus</a>: overwriting entity attributes.</p> Before diving into the newly supported devices and services, I want to highlight an awesome configuration enhancement by <a href="https://github.com/rmkraus">rmkraus</a>: overwriting entity attributes.</p>
<p>These new configuration settings allow you to overwrite entity state attributes. The main usage for this is being able to overwrite attributes that influence how an entity is shown in the interface.</p> <p>These new configuration settings allow you to overwrite entity state attributes. The main usage for this is being able to overwrite attributes that influence how an entity is shown in the interface.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">homeassistant</span><span class="pi">:</span>
<span class="key">homeassistant</span>: <span class="s">customize</span><span class="pi">:</span>
<span class="key">customize</span>: <span class="s">light.bowl</span><span class="pi">:</span>
<span class="key">light.bowl</span>: <span class="c1"># hides this entity from the interface</span>
<span class="comment"># hides this entity from the interface</span> <span class="s">hidden</span><span class="pi">:</span> <span class="s">true</span>
<span class="key">hidden</span>: <span class="string"><span class="content">true</span></span> <span class="s">light.ceiling</span><span class="pi">:</span>
<span class="key">light.ceiling</span>: <span class="c1"># Replaces the state badge with given picture</span>
<span class="comment"># Replaces the state badge with given picture</span> <span class="s">entity_picture</span><span class="pi">:</span> <span class="s">http://graph.facebook.com/schoutsen/picture</span>
<span class="key">entity_picture</span>: <span class="string"><span class="content">http://graph.facebook.com/schoutsen/picture</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>MySensors</strong><br /> <p><strong>MySensors</strong>
<img src="/images/supported_brands/mysensors.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/andythigpen">Andythigpen</a> and <a href="https://github.com/theolind">Theolind</a> have added support for the <a href="http://www.mysensors.org">MySensors platform</a> to Home Assistant.</p> <img src="/images/supported_brands/mysensors.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/andythigpen">Andythigpen</a> and <a href="https://github.com/theolind">Theolind</a> have added support for the <a href="http://www.mysensors.org">MySensors platform</a> to Home Assistant.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">sensor</span><span class="pi">:</span>
<span class="key">sensor</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">mysensors</span>
<span class="key">platform</span>: <span class="string"><span class="content">mysensors</span></span> <span class="s">port</span><span class="pi">:</span> <span class="s">/dev/ttyACM0</span>
<span class="key">port</span>: <span class="string"><span class="content">/dev/ttyACM0</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>OpenWeatherMap</strong><br /> <p><strong>OpenWeatherMap</strong>
<img src="/images/supported_brands/openweathermap.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/fabaff">Fabaff</a> has contributed support for <a href="http://openweathermap.org">OpenWeatherMap</a>. This will allow you to integrate local meteorological data into Home Assistant.</p> <img src="/images/supported_brands/openweathermap.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/fabaff">Fabaff</a> has contributed support for <a href="http://openweathermap.org">OpenWeatherMap</a>. This will allow you to integrate local meteorological data into Home Assistant.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">sensor</span><span class="pi">:</span>
<span class="key">sensor</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">openweathermap</span>
<span class="key">platform</span>: <span class="string"><span class="content">openweathermap</span></span> <span class="s">api_key</span><span class="pi">:</span> <span class="s">YOUR_API_KEY</span>
<span class="key">api_key</span>: <span class="string"><span class="content">YOUR_API_KEY</span></span> <span class="s">monitored_variables</span><span class="pi">:</span>
<span class="key">monitored_variables</span>: <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s1">'</span><span class="s">weather'</span>
- <span class="string"><span class="content">type: 'weather'</span></span> <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s1">'</span><span class="s">temperature'</span>
- <span class="string"><span class="content">type: 'temperature'</span></span> <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s1">'</span><span class="s">wind_speed'</span>
- <span class="string"><span class="content">type: 'wind_speed'</span></span> <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s1">'</span><span class="s">humidity'</span>
- <span class="string"><span class="content">type: 'humidity'</span></span> <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s1">'</span><span class="s">pressure'</span>
- <span class="string"><span class="content">type: 'pressure'</span></span> <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s1">'</span><span class="s">clouds'</span>
- <span class="string"><span class="content">type: 'clouds'</span></span> <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s1">'</span><span class="s">rain'</span>
- <span class="string"><span class="content">type: 'rain'</span></span> <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s1">'</span><span class="s">snow'</span>
- <span class="string"><span class="content">type: 'snow'</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>InstaPush</strong><br /> <p><strong>InstaPush</strong>
<img src="/images/supported_brands/instapush.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/fabaff">Fabaff</a> has contributed support for <a href="https://instapush.im">InstaPush</a>. This will allow you send messages from Home Assistant to your iOS and Android devices.</p> <img src="/images/supported_brands/instapush.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/fabaff">Fabaff</a> has contributed support for <a href="https://instapush.im">InstaPush</a>. This will allow you send messages from Home Assistant to your iOS and Android devices.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">notify</span><span class="pi">:</span>
<span class="key">notify</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">instapush</span>
<span class="key">platform</span>: <span class="string"><span class="content">instapush</span></span> <span class="c1"># Get those by creating a new application, event, and tracker on https://instapush.im</span>
<span class="comment"># Get those by creating a new application, event, and tracker on https://instapush.im</span> <span class="s">api_key</span><span class="pi">:</span> <span class="s">ABCDEFGHJKLMNOPQRSTUVXYZ</span>
<span class="key">api_key</span>: <span class="string"><span class="content">ABCDEFGHJKLMNOPQRSTUVXYZ</span></span> <span class="s">app_secret</span><span class="pi">:</span> <span class="s">ABCDEFGHJKLMNOPQRSTUVXYZ</span>
<span class="key">app_secret</span>: <span class="string"><span class="content">ABCDEFGHJKLMNOPQRSTUVXYZ</span></span> <span class="s">event</span><span class="pi">:</span> <span class="s">ABCDEFGHJKLMNOPQRSTUVXYZ</span>
<span class="key">event</span>: <span class="string"><span class="content">ABCDEFGHJKLMNOPQRSTUVXYZ</span></span> <span class="s">tracker</span><span class="pi">:</span> <span class="s">ABCDEFGHJKLMNOPQRSTUVXYZ</span>
<span class="key">tracker</span>: <span class="string"><span class="content">ABCDEFGHJKLMNOPQRSTUVXYZ</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>XMPP</strong><br /> <p><strong>XMPP</strong>
<img src="/images/supported_brands/xmpp.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/fabaff">Fabaff</a> has contributed support for Jabber/XMPP. This will allow you send messages from Home Assistant to anyone on Jabber/XMPP.</p> <img src="/images/supported_brands/xmpp.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/fabaff">Fabaff</a> has contributed support for Jabber/XMPP. This will allow you send messages from Home Assistant to anyone on Jabber/XMPP.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">notify</span><span class="pi">:</span>
<span class="key">notify</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">xmpp</span>
<span class="key">platform</span>: <span class="string"><span class="content">xmpp</span></span> <span class="s">sender</span><span class="pi">:</span> <span class="s">YOUR_JID</span>
<span class="key">sender</span>: <span class="string"><span class="content">YOUR_JID</span></span> <span class="s">password</span><span class="pi">:</span> <span class="s">YOUR_JABBER_ACCOUNT_PASSWORD</span>
<span class="key">password</span>: <span class="string"><span class="content">YOUR_JABBER_ACCOUNT_PASSWORD</span></span> <span class="s">recipient</span><span class="pi">:</span> <span class="s">YOUR_RECIPIENT</span>
<span class="key">recipient</span>: <span class="string"><span class="content">YOUR_RECIPIENT</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>Notify My Android</strong><br /> <p><strong>Notify My Android</strong>
<img src="/images/supported_brands/nma.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/fabaff">Fabaff</a> has contributed support for <a href="http://www.notifymyandroid.com/">Notify My Android</a>. This will allow you to send messages from Home Assistant to your Android device.</p> <img src="/images/supported_brands/nma.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/fabaff">Fabaff</a> has contributed support for <a href="http://www.notifymyandroid.com/">Notify My Android</a>. This will allow you to send messages from Home Assistant to your Android device.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">notify</span><span class="pi">:</span>
<span class="key">notify</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">nma</span>
<span class="key">platform</span>: <span class="string"><span class="content">nma</span></span> <span class="c1"># Get this by registering a new application on http://www.notifymyandroid.com/</span>
<span class="comment"># Get this by registering a new application on http://www.notifymyandroid.com/</span> <span class="s">api_key</span><span class="pi">:</span> <span class="s">ABCDEFGHJKLMNOPQRSTUVXYZ</span>
<span class="key">api_key</span>: <span class="string"><span class="content">ABCDEFGHJKLMNOPQRSTUVXYZ</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>Time &amp; Date sensor</strong><br /> <p><strong>Time &amp; Date sensor</strong>
<a href="https://github.com/fabaff">Fabaff</a> has contributed a time &amp; date sensor. This will allow you to show the current time/date on the dashboard.</p> <a href="https://github.com/fabaff">Fabaff</a> has contributed a time &amp; date sensor. This will allow you to show the current time/date on the dashboard.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">sensor</span><span class="pi">:</span>
<span class="key">sensor</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">time_date</span>
<span class="key">platform</span>: <span class="string"><span class="content">time_date</span></span> <span class="s">monitored_variables</span><span class="pi">:</span>
<span class="key">monitored_variables</span>: <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s1">'</span><span class="s">time'</span>
- <span class="string"><span class="content">type: 'time'</span></span> <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s1">'</span><span class="s">date'</span>
- <span class="string"><span class="content">type: 'date'</span></span> <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s1">'</span><span class="s">date_time'</span>
- <span class="string"><span class="content">type: 'date_time'</span></span> <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s1">'</span><span class="s">time_date'</span>
- <span class="string"><span class="content">type: 'time_date'</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
</article> </article>
@ -303,7 +289,7 @@ Before diving into the newly supported devices and services, I want to highlight
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -128,7 +128,7 @@ To update to the latest version, run <code>scripts/update</code>. Please report
<ul> <ul>
<li>Fronted upgraded to Polymer 1.0 by @balloob</li> <li>Fronted upgraded to Polymer 1.0 by @balloob</li>
<li>Include other YAML files using the <code>!include</code> keyword by @andythigpen</li> <li>Include other YAML files using the <code class="highlighter-rouge">!include</code> keyword by @andythigpen</li>
<li>Switch support and bug fixes for Vera platform by @jamespcole</li> <li>Switch support and bug fixes for Vera platform by @jamespcole</li>
<li>HTTP session support for the HTTP component by @jamespcole</li> <li>HTTP session support for the HTTP component by @jamespcole</li>
<li>Device tracker bugfixes by @Dutchy-</li> <li>Device tracker bugfixes by @Dutchy-</li>
@ -140,148 +140,132 @@ To update to the latest version, run <code>scripts/update</code>. Please report
<li>Update documentation by @fabaff</li> <li>Update documentation by @fabaff</li>
</ul> </ul>
<p><strong>Music Player Daemon</strong><br /> <p><strong>Music Player Daemon</strong>
<img src="/images/supported_brands/mpd.png" style="border:none; box-shadow: none; float: right;" height="50" /> Fabaff has contributed MusicPlayerDaemon support. The mpd platform allows you to control a <a href="http://www.musicpd.org/">Music Player Daemon</a> from Home Assistant. Right now, only playback is supported and not playlist manipulation.</p> <img src="/images/supported_brands/mpd.png" style="border:none; box-shadow: none; float: right;" height="50" /> Fabaff has contributed MusicPlayerDaemon support. The mpd platform allows you to control a <a href="http://www.musicpd.org/">Music Player Daemon</a> from Home Assistant. Right now, only playback is supported and not playlist manipulation.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">media_player</span><span class="pi">:</span>
<span class="key">media_player</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">mpd</span>
<span class="key">platform</span>: <span class="string"><span class="content">mpd</span></span> <span class="s">server</span><span class="pi">:</span> <span class="s">127.0.0.1</span>
<span class="key">server</span>: <span class="string"><span class="content">127.0.0.1</span></span> <span class="s">port</span><span class="pi">:</span> <span class="s">6600</span>
<span class="key">port</span>: <span class="string"><span class="content">6600</span></span> <span class="s">location</span><span class="pi">:</span> <span class="s">bedroom</span>
<span class="key">location</span>: <span class="string"><span class="content">bedroom</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>Command line switch</strong><br /> <p><strong>Command line switch</strong>
A switch platform that issues specific commands when it is turned on and off. This might very well become our most popular platform as it allows anyone to integrate any type of switch into Home Assistant that can be controlled from the command line, including calling other scripts!</p> A switch platform that issues specific commands when it is turned on and off. This might very well become our most popular platform as it allows anyone to integrate any type of switch into Home Assistant that can be controlled from the command line, including calling other scripts!</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">switch</span><span class="pi">:</span>
<span class="key">switch</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">command_switch</span>
<span class="key">platform</span>: <span class="string"><span class="content">command_switch</span></span> <span class="s">switches</span><span class="pi">:</span>
<span class="key">switches</span>: <span class="pi">-</span> <span class="s">kitchen_light</span><span class="pi">:</span>
- <span class="string"><span class="content">kitchen_light:</span><span class="content"> <span class="s">oncmd</span><span class="pi">:</span> <span class="s">switch_command on kitchen</span>
oncmd: switch_command on kitchen <span class="s">offcmd</span><span class="pi">:</span> <span class="s">switch_command off kitchen</span>
offcmd: switch_command off kitchen</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>LimitlessLED</strong><br /> <p><strong>LimitlessLED</strong>
This new platform can control your LimitlessLED lights from within Home Assistant. The lights are also known as EasyBulb, AppLight, AppLamp, MiLight, LEDme, dekolight or iLight.</p> This new platform can control your LimitlessLED lights from within Home Assistant. The lights are also known as EasyBulb, AppLight, AppLamp, MiLight, LEDme, dekolight or iLight.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">light</span><span class="pi">:</span>
<span class="key">light</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">limitlessled</span>
<span class="key">platform</span>: <span class="string"><span class="content">limitlessled</span></span> <span class="s">host</span><span class="pi">:</span> <span class="s">192.168.1.10</span>
<span class="key">host</span>: <span class="string"><span class="content">192.168.1.10</span></span> <span class="s">group_1_name</span><span class="pi">:</span> <span class="s">Living Room</span>
<span class="key">group_1_name</span>: <span class="string"><span class="content">Living Room</span></span> <span class="s">group_2_name</span><span class="pi">:</span> <span class="s">Bedroom</span>
<span class="key">group_2_name</span>: <span class="string"><span class="content">Bedroom</span></span> <span class="s">group_3_name</span><span class="pi">:</span> <span class="s">Office</span>
<span class="key">group_3_name</span>: <span class="string"><span class="content">Office</span></span> <span class="s">group_4_name</span><span class="pi">:</span> <span class="s">Kitchen</span>
<span class="key">group_4_name</span>: <span class="string"><span class="content">Kitchen</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>Bitcoin sensor</strong><br /> <p><strong>Bitcoin sensor</strong>
<img src="/images/supported_brands/bitcoin.png" style="border:none; box-shadow: none; float: right;" height="50" /> The bitcoin platform displays various details about the <a href="https://bitcoin.org">Bitcoin</a> network. If you have an online wallet from <a href="https://blockchain.info/">Blockchain.info</a> the sensor is capable to show your current balance.</p> <img src="/images/supported_brands/bitcoin.png" style="border:none; box-shadow: none; float: right;" height="50" /> The bitcoin platform displays various details about the <a href="https://bitcoin.org">Bitcoin</a> network. If you have an online wallet from <a href="https://blockchain.info/">Blockchain.info</a> the sensor is capable to show your current balance.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">sensor</span><span class="pi">:</span>
<span class="key">sensor</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">bitcoin</span>
<span class="key">platform</span>: <span class="string"><span class="content">bitcoin</span></span> <span class="s">wallet</span><span class="pi">:</span> <span class="s1">'</span><span class="s">YOUR</span><span class="nv"> </span><span class="s">WALLET_ID'</span>
<span class="key">wallet</span>: <span class="string"><span class="content">'YOUR WALLET_ID'</span></span> <span class="s">password</span><span class="pi">:</span> <span class="s">YOUR_ACCOUNT_PASSWORD</span>
<span class="key">password</span>: <span class="string"><span class="content">YOUR_ACCOUNT_PASSWORD</span></span> <span class="s">currency</span><span class="pi">:</span> <span class="s">YOUR CURRENCY</span>
<span class="key">currency</span>: <span class="string"><span class="content">YOUR CURRENCY</span></span> <span class="s">display_options</span><span class="pi">:</span>
<span class="key">display_options</span>: <span class="pi">-</span> <span class="s">exchangerate</span>
- <span class="string"><span class="content">exchangerate</span></span> <span class="pi">-</span> <span class="s">trade_volume_btc</span>
- <span class="string"><span class="content">trade_volume_btc</span></span> <span class="pi">-</span> <span class="s">miners_revenue_usd</span>
- <span class="string"><span class="content">miners_revenue_usd</span></span> <span class="pi">-</span> <span class="s">btc_mined</span>
- <span class="string"><span class="content">btc_mined</span></span> <span class="pi">-</span> <span class="s">trade_volume_usd</span>
- <span class="string"><span class="content">trade_volume_usd</span></span> <span class="pi">-</span> <span class="s">difficulty</span>
- <span class="string"><span class="content">difficulty</span></span> <span class="pi">-</span> <span class="s">minutes_between_blocks</span>
- <span class="string"><span class="content">minutes_between_blocks</span></span> <span class="pi">-</span> <span class="s">number_of_transactions</span>
- <span class="string"><span class="content">number_of_transactions</span></span> <span class="pi">-</span> <span class="s">hash_rate</span>
- <span class="string"><span class="content">hash_rate</span></span> <span class="pi">-</span> <span class="s">timestamp</span>
- <span class="string"><span class="content">timestamp</span></span> <span class="pi">-</span> <span class="s">mined_blocks</span>
- <span class="string"><span class="content">mined_blocks</span></span> <span class="pi">-</span> <span class="s">blocks_size</span>
- <span class="string"><span class="content">blocks_size</span></span> <span class="pi">-</span> <span class="s">total_fees_btc</span>
- <span class="string"><span class="content">total_fees_btc</span></span> <span class="pi">-</span> <span class="s">total_btc_sent</span>
- <span class="string"><span class="content">total_btc_sent</span></span> <span class="pi">-</span> <span class="s">estimated_btc_sent</span>
- <span class="string"><span class="content">estimated_btc_sent</span></span> <span class="pi">-</span> <span class="s">total_btc</span>
- <span class="string"><span class="content">total_btc</span></span> <span class="pi">-</span> <span class="s">total_blocks</span>
- <span class="string"><span class="content">total_blocks</span></span> <span class="pi">-</span> <span class="s">next_retarget</span>
- <span class="string"><span class="content">next_retarget</span></span> <span class="pi">-</span> <span class="s">estimated_transaction_volume_usd</span>
- <span class="string"><span class="content">estimated_transaction_volume_usd</span></span> <span class="pi">-</span> <span class="s">miners_revenue_btc</span>
- <span class="string"><span class="content">miners_revenue_btc</span></span> <span class="pi">-</span> <span class="s">market_price_usd</span>
- <span class="string"><span class="content">market_price_usd</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>SMTP notificatoin platform</strong><br /> <p><strong>SMTP notificatoin platform</strong>
<img src="/images/supported_brands/smtp.png" style="border:none; box-shadow: none; float: right;" height="50" /> The smtp platform allows you to deliver notifications from Home Assistant to an e-mail recipient.</p> <img src="/images/supported_brands/smtp.png" style="border:none; box-shadow: none; float: right;" height="50" /> The smtp platform allows you to deliver notifications from Home Assistant to an e-mail recipient.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">notify</span><span class="pi">:</span>
<span class="key">notify</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">mail</span>
<span class="key">platform</span>: <span class="string"><span class="content">mail</span></span> <span class="s">server</span><span class="pi">:</span> <span class="s">MAIL_SERVER</span>
<span class="key">server</span>: <span class="string"><span class="content">MAIL_SERVER</span></span> <span class="s">port</span><span class="pi">:</span> <span class="s">YOUR_SMTP_PORT</span>
<span class="key">port</span>: <span class="string"><span class="content">YOUR_SMTP_PORT</span></span> <span class="s">sender</span><span class="pi">:</span> <span class="s">SENDER_EMAIL_ADDRESS</span>
<span class="key">sender</span>: <span class="string"><span class="content">SENDER_EMAIL_ADDRESS</span></span> <span class="s">starttls</span><span class="pi">:</span> <span class="s">1 or 0</span>
<span class="key">starttls</span>: <span class="string"><span class="content">1 or 0</span></span> <span class="s">username</span><span class="pi">:</span> <span class="s">YOUR_SMTP_USERNAME</span>
<span class="key">username</span>: <span class="string"><span class="content">YOUR_SMTP_USERNAME</span></span> <span class="s">password</span><span class="pi">:</span> <span class="s">YOUR_SMTP_PASSWORD</span>
<span class="key">password</span>: <span class="string"><span class="content">YOUR_SMTP_PASSWORD</span></span> <span class="s">recipient</span><span class="pi">:</span> <span class="s">YOUR_RECIPIENT</span>
<span class="key">recipient</span>: <span class="string"><span class="content">YOUR_RECIPIENT</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>Syslog notification platform</strong><br /> <p><strong>Syslog notification platform</strong>
The syslog platform allows you to deliver notifications from Home Assistant to the local syslog.</p> The syslog platform allows you to deliver notifications from Home Assistant to the local syslog.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">notify</span><span class="pi">:</span>
<span class="key">notify</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">syslog</span>
<span class="key">platform</span>: <span class="string"><span class="content">syslog</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>Swiss Public transport sensor</strong><br /> <p><strong>Swiss Public transport sensor</strong>
The swiss public transport sensor will give you the next two departure times from a given location to another one in Switzerland. See the <a href="/components/sensor.swiss_public_transport/">component page</a> for more information how to set it up.</p> The swiss public transport sensor will give you the next two departure times from a given location to another one in Switzerland. See the <a href="/components/sensor.swiss_public_transport/">component page</a> for more information how to set it up.</p>
<p><strong>Transmission turtle mode switch</strong><br /> <p><strong>Transmission turtle mode switch</strong>
<img src="/images/supported_brands/transmission.png" style="border:none; box-shadow: none; float: right;" height="50" /> The transmission platform allows you to control your <a href="http://www.transmissionbt.com/">Transmission</a> client from within Home Assistant. The platform enables you switch to your Alternative Speed Limits (aka Turtle mode) setting.</p> <img src="/images/supported_brands/transmission.png" style="border:none; box-shadow: none; float: right;" height="50" /> The transmission platform allows you to control your <a href="http://www.transmissionbt.com/">Transmission</a> client from within Home Assistant. The platform enables you switch to your Alternative Speed Limits (aka Turtle mode) setting.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">switch</span><span class="pi">:</span>
<span class="key">switch</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">transmission</span>
<span class="key">platform</span>: <span class="string"><span class="content">transmission</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s">Transmission</span>
<span class="key">name</span>: <span class="string"><span class="content">Transmission</span></span> <span class="s">host</span><span class="pi">:</span> <span class="s">192.168.1.26</span>
<span class="key">host</span>: <span class="string"><span class="content">192.168.1.26</span></span> <span class="s">port</span><span class="pi">:</span> <span class="s">9091</span>
<span class="key">port</span>: <span class="string"><span class="content">9091</span></span> <span class="s">username</span><span class="pi">:</span> <span class="s">YOUR_USERNAME</span>
<span class="key">username</span>: <span class="string"><span class="content">YOUR_USERNAME</span></span> <span class="s">password</span><span class="pi">:</span> <span class="s">YOUR_PASSWORD</span>
<span class="key">password</span>: <span class="string"><span class="content">YOUR_PASSWORD</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>Hikvision camera motion detection support</strong><br /> <p><strong>Hikvision camera motion detection support</strong>
This switch platform allows you to control your motion detection setting on your Hikvision camera.</p> This switch platform allows you to control your motion detection setting on your Hikvision camera.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">switch</span><span class="pi">:</span>
<span class="key">switch</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">hikvisioncam</span>
<span class="key">platform</span>: <span class="string"><span class="content">hikvisioncam</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s">Hikvision Cam 1 Motion Detection</span>
<span class="key">name</span>: <span class="string"><span class="content">Hikvision Cam 1 Motion Detection</span></span> <span class="s">host</span><span class="pi">:</span> <span class="s">192.168.1.26</span>
<span class="key">host</span>: <span class="string"><span class="content">192.168.1.26</span></span> <span class="s">username</span><span class="pi">:</span> <span class="s">YOUR_USERNAME</span>
<span class="key">username</span>: <span class="string"><span class="content">YOUR_USERNAME</span></span> <span class="s">password</span><span class="pi">:</span> <span class="s">YOUR_PASSWORD</span>
<span class="key">password</span>: <span class="string"><span class="content">YOUR_PASSWORD</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
</article> </article>
@ -356,7 +340,7 @@ This switch platform allows you to control your motion detection setting on your
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -112,21 +112,19 @@
<p>This release includes some architectural changes by me. The first is that the frontend is now based on a <a href="http://optimizely.github.io/nuclear-js/">NuclearJS</a> JavaScript backend. This has greatly helped to organize and optimize the frontend code. Another change is that Home Assistant will now install dependencies on-demand instead of installing dependencies for all supported devices.</p> <p>This release includes some architectural changes by me. The first is that the frontend is now based on a <a href="http://optimizely.github.io/nuclear-js/">NuclearJS</a> JavaScript backend. This has greatly helped to organize and optimize the frontend code. Another change is that Home Assistant will now install dependencies on-demand instead of installing dependencies for all supported devices.</p>
<p><strong>IP Camera Support</strong><br /> <p><strong>IP Camera Support</strong>
James has worked very hard to add support for IP cameras to Home Assistant which is included in this release. The initial release focusses on providing generic IP camera support. This means that any webcam that can exposes a JPEG image via a url can be integrated.</p> James has worked very hard to add support for IP cameras to Home Assistant which is included in this release. The initial release focusses on providing generic IP camera support. This means that any webcam that can exposes a JPEG image via a url can be integrated.</p>
<p>Home Assistant will route the requests to your camera via the server allowing you to expose IP cameras inside your network via the Home Assistant app.</p> <p>Home Assistant will route the requests to your camera via the server allowing you to expose IP cameras inside your network via the Home Assistant app.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">camera</span><span class="pi">:</span>
<span class="key">camera</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">generic</span>
<span class="key">platform</span>: <span class="string"><span class="content">generic</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s">my sample camera</span>
<span class="key">name</span>: <span class="string"><span class="content">my sample camera</span></span> <span class="s">username</span><span class="pi">:</span> <span class="s">MY_USERNAME</span>
<span class="key">username</span>: <span class="string"><span class="content">MY_USERNAME</span></span> <span class="s">password</span><span class="pi">:</span> <span class="s">MY_PASSWORD</span>
<span class="key">password</span>: <span class="string"><span class="content">MY_PASSWORD</span></span> <span class="s">still_image_url</span><span class="pi">:</span> <span class="s">http://194.218.96.92/jpg/image.jpg</span>
<span class="key">still_image_url</span>: <span class="string"><span class="content">http://194.218.96.92/jpg/image.jpg</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p class="note"> <p class="note">
@ -135,105 +133,95 @@ To update to the latest version, run <code>scripts/update</code>. Please report
<a name="read-more"></a> <a name="read-more"></a>
<p><strong>Arduino</strong><br /> <p><strong>Arduino</strong>
<img src="/images/supported_brands/arduino.png" style="border:none; box-shadow: none; float: right;" height="50" /> Fabian has contributed support for interfacing with Arduinos. This makes it possible to connect your Arduino via USB and expose pins as sensor data and write to pins via switches. Have a look at <a href="/components/arduino/">the docs</a> for an extensive guide to get started.</p> <img src="/images/supported_brands/arduino.png" style="border:none; box-shadow: none; float: right;" height="50" /> Fabian has contributed support for interfacing with Arduinos. This makes it possible to connect your Arduino via USB and expose pins as sensor data and write to pins via switches. Have a look at <a href="/components/arduino/">the docs</a> for an extensive guide to get started.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">switch</span><span class="pi">:</span>
<span class="key">switch</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">arduino</span>
<span class="key">platform</span>: <span class="string"><span class="content">arduino</span></span> <span class="s">pins</span><span class="pi">:</span>
<span class="key">pins</span>: <span class="s">11</span><span class="pi">:</span>
<span class="key">11</span>: <span class="s">name</span><span class="pi">:</span> <span class="s">Fan Office</span>
<span class="key">name</span>: <span class="string"><span class="content">Fan Office</span></span> <span class="s">type</span><span class="pi">:</span> <span class="s">digital</span>
<span class="key">type</span>: <span class="string"><span class="content">digital</span></span> <span class="s">12</span><span class="pi">:</span>
<span class="key">12</span>: <span class="s">name</span><span class="pi">:</span> <span class="s">Light Desk</span>
<span class="key">name</span>: <span class="string"><span class="content">Light Desk</span></span> <span class="s">type</span><span class="pi">:</span> <span class="s">digital</span>
<span class="key">type</span>: <span class="string"><span class="content">digital</span></span>
<span class="key">sensor</span>: <span class="s">sensor</span><span class="pi">:</span>
<span class="key">platform</span>: <span class="string"><span class="content">arduino</span></span> <span class="s">platform</span><span class="pi">:</span> <span class="s">arduino</span>
<span class="key">pins</span>: <span class="s">pins</span><span class="pi">:</span>
<span class="key">1</span>: <span class="s">1</span><span class="pi">:</span>
<span class="key">name</span>: <span class="string"><span class="content">Door switch</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s">Door switch</span>
<span class="key">type</span>: <span class="string"><span class="content">analog</span></span> <span class="s">type</span><span class="pi">:</span> <span class="s">analog</span>
<span class="key">0</span>: <span class="s">0</span><span class="pi">:</span>
<span class="key">name</span>: <span class="string"><span class="content">Brightness</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s">Brightness</span>
<span class="key">type</span>: <span class="string"><span class="content">analog</span></span> <span class="s">type</span><span class="pi">:</span> <span class="s">analog</span>
</pre></div> </code></pre>
</div>
</div> </div>
<p><strong>Kodi (XBMC)</strong><br /> <p><strong>Kodi (XBMC)</strong>
<img src="/images/supported_brands/kodi.png" style="border:none; box-shadow: none; float: right;" height="50" /> Ettisan has contributed a Kodi (XBMC) platform for the media player component. This allows you to track all the media that you are playing and allow you to control it.</p> <img src="/images/supported_brands/kodi.png" style="border:none; box-shadow: none; float: right;" height="50" /> Ettisan has contributed a Kodi (XBMC) platform for the media player component. This allows you to track all the media that you are playing and allow you to control it.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">media_player</span><span class="pi">:</span>
<span class="key">media_player</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">kodi</span>
<span class="key">platform</span>: <span class="string"><span class="content">kodi</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s">Kodi</span>
<span class="key">name</span>: <span class="string"><span class="content">Kodi</span></span> <span class="s">url</span><span class="pi">:</span> <span class="s">http://192.168.0.123/jsonrpc</span>
<span class="key">url</span>: <span class="string"><span class="content">http://192.168.0.123/jsonrpc</span></span> <span class="s">user</span><span class="pi">:</span> <span class="s">kodi</span>
<span class="key">user</span>: <span class="string"><span class="content">kodi</span></span> <span class="s">password</span><span class="pi">:</span> <span class="s">my_secure_password</span>
<span class="key">password</span>: <span class="string"><span class="content">my_secure_password</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>TP-Link</strong><br /> <p><strong>TP-Link</strong>
<img src="/images/supported_brands/tp-link.png" style="border:none; box-shadow: none; float: right;" width="150" /> Michael has added TP-Link support to the device tracker. This allows you to now detect presence if you have a TP-Link router.</p> <img src="/images/supported_brands/tp-link.png" style="border:none; box-shadow: none; float: right;" width="150" /> Michael has added TP-Link support to the device tracker. This allows you to now detect presence if you have a TP-Link router.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">device_tracker</span><span class="pi">:</span>
<span class="key">device_tracker</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">tplink</span>
<span class="key">platform</span>: <span class="string"><span class="content">tplink</span></span> <span class="s">host</span><span class="pi">:</span> <span class="s">YOUR_ROUTER_IP</span>
<span class="key">host</span>: <span class="string"><span class="content">YOUR_ROUTER_IP</span></span> <span class="s">username</span><span class="pi">:</span> <span class="s">YOUR_ADMIN_USERNAME</span>
<span class="key">username</span>: <span class="string"><span class="content">YOUR_ADMIN_USERNAME</span></span> <span class="s">password</span><span class="pi">:</span> <span class="s">YOUR_ADMIN_PASSWORD</span>
<span class="key">password</span>: <span class="string"><span class="content">YOUR_ADMIN_PASSWORD</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>Efergy energy monitor</strong><br /> <p><strong>Efergy energy monitor</strong>
<img src="/images/supported_brands/efergy.png" style="border:none; box-shadow: none; float: right;" height="50" /> Miniconfig has contributed support for the <a href="https://efergy.com">Efergy energy meters</a>. To get an app token, log in to your efergy account, go to the Settings page, click on App tokens, and click “Add token”.</p> <img src="/images/supported_brands/efergy.png" style="border:none; box-shadow: none; float: right;" height="50" /> Miniconfig has contributed support for the <a href="https://efergy.com">Efergy energy meters</a>. To get an app token, log in to your efergy account, go to the Settings page, click on App tokens, and click “Add token”.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">sensor</span><span class="pi">:</span>
<span class="key">sensor</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">efergy</span>
<span class="key">platform</span>: <span class="string"><span class="content">efergy</span></span> <span class="s">app_token</span><span class="pi">:</span> <span class="s">APP_TOKEN</span>
<span class="key">app_token</span>: <span class="string"><span class="content">APP_TOKEN</span></span> <span class="s">utc_offset</span><span class="pi">:</span> <span class="s">UTC_OFFSET</span>
<span class="key">utc_offset</span>: <span class="string"><span class="content">UTC_OFFSET</span></span> <span class="s">monitored_variables</span><span class="pi">:</span>
<span class="key">monitored_variables</span>: <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s">instant_readings</span>
- <span class="string"><span class="content">type: instant_readings</span></span> <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s">budget</span>
- <span class="string"><span class="content">type: budget</span></span> <span class="pi">-</span> <span class="s">type</span><span class="pi">:</span> <span class="s">cost</span>
- <span class="string"><span class="content">type: cost</span></span> <span class="s">period</span><span class="pi">:</span> <span class="s">day</span>
<span class="key">period</span>: <span class="string"><span class="content">day</span></span> <span class="s">currency</span><span class="pi">:</span> <span class="s">$</span>
<span class="key">currency</span>: <span class="string"><span class="content">$</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>Forecast.io</strong><br /> <p><strong>Forecast.io</strong>
Fabian has added support for <a href="https://forecast.io/">Forecast.io</a> to get weather forecasts for Home Assistant. You need an API key which is free but requires a <a href="https://developer.forecast.io/register">registration</a>. To add Forecast.io to your installation, add the following to your <code>configuration.yaml</code> file:</p> Fabian has added support for <a href="https://forecast.io/">Forecast.io</a> to get weather forecasts for Home Assistant. You need an API key which is free but requires a <a href="https://developer.forecast.io/register">registration</a>. To add Forecast.io to your installation, add the following to your <code class="highlighter-rouge">configuration.yaml</code> file:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">sensor</span><span class="pi">:</span>
<span class="key">sensor</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">forecast</span>
<span class="key">platform</span>: <span class="string"><span class="content">forecast</span></span> <span class="s">api_key</span><span class="pi">:</span> <span class="s">YOUR_APP_KEY</span>
<span class="key">api_key</span>: <span class="string"><span class="content">YOUR_APP_KEY</span></span> <span class="s">monitored_conditions</span><span class="pi">:</span>
<span class="key">monitored_conditions</span>: <span class="pi">-</span> <span class="s">summary</span>
- <span class="string"><span class="content">summary</span></span> <span class="pi">-</span> <span class="s">precip_type</span>
- <span class="string"><span class="content">precip_type</span></span> <span class="pi">-</span> <span class="s">precip_intensity</span>
- <span class="string"><span class="content">precip_intensity</span></span> <span class="pi">-</span> <span class="s">temperature</span>
- <span class="string"><span class="content">temperature</span></span> <span class="pi">-</span> <span class="s">dew_point</span>
- <span class="string"><span class="content">dew_point</span></span> <span class="pi">-</span> <span class="s">wind_speed</span>
- <span class="string"><span class="content">wind_speed</span></span> <span class="pi">-</span> <span class="s">wind_bearing</span>
- <span class="string"><span class="content">wind_bearing</span></span> <span class="pi">-</span> <span class="s">cloud_cover</span>
- <span class="string"><span class="content">cloud_cover</span></span> <span class="pi">-</span> <span class="s">humidity</span>
- <span class="string"><span class="content">humidity</span></span> <span class="pi">-</span> <span class="s">pressure</span>
- <span class="string"><span class="content">pressure</span></span> <span class="pi">-</span> <span class="s">visibility</span>
- <span class="string"><span class="content">visibility</span></span> <span class="pi">-</span> <span class="s">ozone</span>
- <span class="string"><span class="content">ozone</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
</article> </article>
@ -308,7 +296,7 @@ Fabian has added support for <a href="https://forecast.io/">Forecast.io</a> to g
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -110,119 +110,103 @@
<p>Its time for the August release and there is some serious good stuff this time. The core of Home Assistant has gone some serious clean up and a bump in test coverage thanks to <a href="https://github.com/balloob">@balloob</a>. If youre a developer, make sure you read up on <a href="https://github.com/home-assistant/home-assistant/pull/251">the deprecation notices</a>. <a href="https://github.com/fabaff">@fabaff</a> did another great round of documentating all the various components.</p> <p>Its time for the August release and there is some serious good stuff this time. The core of Home Assistant has gone some serious clean up and a bump in test coverage thanks to <a href="https://github.com/balloob">@balloob</a>. If youre a developer, make sure you read up on <a href="https://github.com/home-assistant/home-assistant/pull/251">the deprecation notices</a>. <a href="https://github.com/fabaff">@fabaff</a> did another great round of documentating all the various components.</p>
<p><strong>MQTT Support</strong><br /> <p><strong>MQTT Support</strong>
<img src="/images/supported_brands/mqtt.png" style="border:none; box-shadow: none; float: right;" height="50" /> The big new addition in this release is the support for the MQTT protocol by <a href="https://github.com/fabaff">@fabaff</a> with some help from <a href="https://github.com/balloob">@balloob</a>. It will now be possible to integrate any IoT device that talks via MQTT. For the initial release we support connecting Home Assistant to a broker (no TLS yet). Components can now subscribe and publish to MQTT topics (<a href="https://github.com/home-assistant/home-assistant/blob/dev/config/custom_components/mqtt_example.py">see the example</a>) and also support for the automation component <a href="/getting-started/automation-trigger/#mqtt-trigger">has been added</a>. For more information, see <a href="/components/mqtt/">the MQTT component page</a>.</p> <img src="/images/supported_brands/mqtt.png" style="border:none; box-shadow: none; float: right;" height="50" /> The big new addition in this release is the support for the MQTT protocol by <a href="https://github.com/fabaff">@fabaff</a> with some help from <a href="https://github.com/balloob">@balloob</a>. It will now be possible to integrate any IoT device that talks via MQTT. For the initial release we support connecting Home Assistant to a broker (no TLS yet). Components can now subscribe and publish to MQTT topics (<a href="https://github.com/home-assistant/home-assistant/blob/dev/config/custom_components/mqtt_example.py">see the example</a>) and also support for the automation component <a href="/getting-started/automation-trigger/#mqtt-trigger">has been added</a>. For more information, see <a href="/components/mqtt/">the MQTT component page</a>.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">mqtt</span><span class="pi">:</span>
<span class="key">mqtt</span>: <span class="s">broker</span><span class="pi">:</span> <span class="s">IP_ADDRESS_BROKER</span>
<span class="key">broker</span>: <span class="string"><span class="content">IP_ADDRESS_BROKER</span></span> <span class="c1"># All the other options are optional:</span>
<span class="comment"># All the other options are optional:</span> <span class="s">port</span><span class="pi">:</span> <span class="s">1883</span>
<span class="key">port</span>: <span class="string"><span class="content">1883</span></span> <span class="s">keepalive</span><span class="pi">:</span> <span class="s">60</span>
<span class="key">keepalive</span>: <span class="string"><span class="content">60</span></span> <span class="s">qos</span><span class="pi">:</span> <span class="s">0</span>
<span class="key">qos</span>: <span class="string"><span class="content">0</span></span> <span class="s">username</span><span class="pi">:</span> <span class="s">your_username</span>
<span class="key">username</span>: <span class="string"><span class="content">your_username</span></span> <span class="s">password</span><span class="pi">:</span> <span class="s">your_secret_password</span>
<span class="key">password</span>: <span class="string"><span class="content">your_secret_password</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<a name="read-more"></a> <a name="read-more"></a>
<p><strong>Raspberry PI GPIO Support</strong><br /> <p><strong>Raspberry PI GPIO Support</strong>
<img src="/images/supported_brands/raspberry-pi.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/gbarba">@gbarba</a> has contributed support to use the general purpose input and output pins on a Raspberry PI as switches inside Home Assistant.</p> <img src="/images/supported_brands/raspberry-pi.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/gbarba">@gbarba</a> has contributed support to use the general purpose input and output pins on a Raspberry PI as switches inside Home Assistant.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">switch</span><span class="pi">:</span>
<span class="key">switch</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">rpi_gpio</span>
<span class="key">platform</span>: <span class="string"><span class="content">rpi_gpio</span></span> <span class="s">ports</span><span class="pi">:</span>
<span class="key">ports</span>: <span class="s">11</span><span class="pi">:</span> <span class="s">Fan Office</span>
<span class="key">11</span>: <span class="string"><span class="content">Fan Office</span></span> <span class="s">12</span><span class="pi">:</span> <span class="s">Light Desk</span>
<span class="key">12</span>: <span class="string"><span class="content">Light Desk</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>ASUSWRT based routers</strong><br /> <p><strong>ASUSWRT based routers</strong>
<img src="/images/supported_brands/asus.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/persandstrom">@persandstrom</a> has contributed support to do prescence detection using ASUSWRT based routers.</p> <img src="/images/supported_brands/asus.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/persandstrom">@persandstrom</a> has contributed support to do prescence detection using ASUSWRT based routers.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">device_tracker</span><span class="pi">:</span>
<span class="key">device_tracker</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">asuswrt</span>
<span class="key">platform</span>: <span class="string"><span class="content">asuswrt</span></span> <span class="s">host</span><span class="pi">:</span> <span class="s">YOUR_ROUTER_IP</span>
<span class="key">host</span>: <span class="string"><span class="content">YOUR_ROUTER_IP</span></span> <span class="s">username</span><span class="pi">:</span> <span class="s">YOUR_ADMIN_USERNAME</span>
<span class="key">username</span>: <span class="string"><span class="content">YOUR_ADMIN_USERNAME</span></span> <span class="s">password</span><span class="pi">:</span> <span class="s">YOUR_ADMIN_PASSWORD</span>
<span class="key">password</span>: <span class="string"><span class="content">YOUR_ADMIN_PASSWORD</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>Logitech Squeezebox media player support</strong><br /> <p><strong>Logitech Squeezebox media player support</strong>
<img src="/images/supported_brands/logitech.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/persandstrom">@persandstrom</a> also contributed support for the Logitech Squeezebox media player. This allows you to control your Logitech Squeezebox from Home Assistant.</p> <img src="/images/supported_brands/logitech.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/persandstrom">@persandstrom</a> also contributed support for the Logitech Squeezebox media player. This allows you to control your Logitech Squeezebox from Home Assistant.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">media_player</span><span class="pi">:</span>
<span class="key">media_player</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">squeezebox</span>
<span class="key">platform</span>: <span class="string"><span class="content">squeezebox</span></span> <span class="s">host</span><span class="pi">:</span> <span class="s">192.168.1.21</span>
<span class="key">host</span>: <span class="string"><span class="content">192.168.1.21</span></span> <span class="s">port</span><span class="pi">:</span> <span class="s">9090</span>
<span class="key">port</span>: <span class="string"><span class="content">9090</span></span> <span class="s">username</span><span class="pi">:</span> <span class="s">user</span>
<span class="key">username</span>: <span class="string"><span class="content">user</span></span> <span class="s">password</span><span class="pi">:</span> <span class="s">password</span>
<span class="key">password</span>: <span class="string"><span class="content">password</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>Slack notification support</strong><br /> <p><strong>Slack notification support</strong>
<img src="/images/supported_brands/slack.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/jamespcole">@jamespcole</a> has contributed a Slack platform for the notification platform. This allows you to deliver messages to any channel.</p> <img src="/images/supported_brands/slack.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/jamespcole">@jamespcole</a> has contributed a Slack platform for the notification platform. This allows you to deliver messages to any channel.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">notify</span><span class="pi">:</span>
<span class="key">notify</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">slack</span>
<span class="key">platform</span>: <span class="string"><span class="content">slack</span></span> <span class="s">api_key</span><span class="pi">:</span> <span class="s">ABCDEFGHJKLMNOPQRSTUVXYZ</span>
<span class="key">api_key</span>: <span class="string"><span class="content">ABCDEFGHJKLMNOPQRSTUVXYZ</span></span> <span class="s">default_channel</span><span class="pi">:</span> <span class="s1">'</span><span class="s">#general'</span>
<span class="key">default_channel</span>: <span class="string"><span class="content">'#general'</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>Edimax Smart Switches support</strong><br /> <p><strong>Edimax Smart Switches support</strong>
<img src="/images/supported_brands/edimax.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/rkabadi">@rkabadi</a> has contributed support for integrating Edimax Smart Switches into Home Assistant.</p> <img src="/images/supported_brands/edimax.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/rkabadi">@rkabadi</a> has contributed support for integrating Edimax Smart Switches into Home Assistant.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">switch</span><span class="pi">:</span>
<span class="key">switch</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">edimax</span>
<span class="key">platform</span>: <span class="string"><span class="content">edimax</span></span> <span class="s">host</span><span class="pi">:</span> <span class="s">192.168.1.32</span>
<span class="key">host</span>: <span class="string"><span class="content">192.168.1.32</span></span> <span class="s">username</span><span class="pi">:</span> <span class="s">YOUR_USERNAME</span>
<span class="key">username</span>: <span class="string"><span class="content">YOUR_USERNAME</span></span> <span class="s">password</span><span class="pi">:</span> <span class="s">YOUR_PASSWORD</span>
<span class="key">password</span>: <span class="string"><span class="content">YOUR_PASSWORD</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s">Edimax Smart Plug</span>
<span class="key">name</span>: <span class="string"><span class="content">Edimax Smart Plug</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>RFXtrx sensor support</strong><br /> <p><strong>RFXtrx sensor support</strong>
<a href="https://github.com/danielhiversen">@danielhiversen</a> has contributed support for RFXtrx sensors. It supports sensors that communicate in the frequency range of 433.92 MHz.</p> <a href="https://github.com/danielhiversen">@danielhiversen</a> has contributed support for RFXtrx sensors. It supports sensors that communicate in the frequency range of 433.92 MHz.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">sensor</span><span class="pi">:</span>
<span class="key">sensor</span>: <span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">rfxtrx</span>
- <span class="string"><span class="content">platform: rfxtrx</span></span> <span class="s">device</span><span class="pi">:</span> <span class="s">PATH_TO_DEVICE</span>
<span class="key">device</span>: <span class="string"><span class="content">PATH_TO_DEVICE</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p>The path to your device, e.g. <code>/dev/serial/by-id/usb-RFXCOM_RFXtrx433_A1Y0NJGR-if00-port0</code></p> <p>The path to your device, e.g. <code class="highlighter-rouge">/dev/serial/by-id/usb-RFXCOM_RFXtrx433_A1Y0NJGR-if00-port0</code></p>
<p><strong>TEMPer temperature sensor support</strong><br /> <p><strong>TEMPer temperature sensor support</strong>
Support for Temper temperature sensors has been contributed by <a href="https://github.com/rkabadi">@rkabadi</a>.</p> Support for Temper temperature sensors has been contributed by <a href="https://github.com/rkabadi">@rkabadi</a>.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">sensor</span><span class="pi">:</span>
<span class="key">sensor</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">temper</span>
<span class="key">platform</span>: <span class="string"><span class="content">temper</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
</article> </article>
@ -297,7 +281,7 @@ Support for Temper temperature sensors has been contributed by <a href="https://
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -108,7 +108,7 @@
</header> </header>
<p>A minor bug fix release to fix some issues that have come up since the last release. Please upgrade as soon as possible by running <code>git pull</code> from the Home Assistant directory.</p> <p>A minor bug fix release to fix some issues that have come up since the last release. Please upgrade as soon as possible by running <code class="highlighter-rouge">git pull</code> from the Home Assistant directory.</p>
<p>This release is a major milestone in our test coverage as weve crossed into the 80s! It has to be noted that this covers mainly the core and automation components. Platforms that communicate with IoT devices have been excluded.</p> <p>This release is a major milestone in our test coverage as weve crossed into the 80s! It has to be noted that this covers mainly the core and automation components. Platforms that communicate with IoT devices have been excluded.</p>
@ -119,20 +119,18 @@
<li>Improved support for MQTT topic subscriptions has been contributed by <a href="https://github.com/qrtn">@qrtn</a></li> <li>Improved support for MQTT topic subscriptions has been contributed by <a href="https://github.com/qrtn">@qrtn</a></li>
</ul> </ul>
<p><strong>Verisure Support</strong><br /> <p><strong>Verisure Support</strong>
<img src="/images/supported_brands/verisure.png" style="border:none; box-shadow: none; float: right;" height="50" /> Home Assistant support to integrate your <a href="https://www.verisure.com/">Verisure</a> alarms, hygrometers, sensors and thermometers has been contributed by <a href="https://github.com/persandstrom">@persandstrom</a>.</p> <img src="/images/supported_brands/verisure.png" style="border:none; box-shadow: none; float: right;" height="50" /> Home Assistant support to integrate your <a href="https://www.verisure.com/">Verisure</a> alarms, hygrometers, sensors and thermometers has been contributed by <a href="https://github.com/persandstrom">@persandstrom</a>.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">verisure</span><span class="pi">:</span>
<span class="key">verisure</span>: <span class="s">username</span><span class="pi">:</span> <span class="s">user@example.com</span>
<span class="key">username</span>: <span class="string"><span class="content">user@example.com</span></span> <span class="s">password</span><span class="pi">:</span> <span class="s">password</span>
<span class="key">password</span>: <span class="string"><span class="content">password</span></span> <span class="s">alarm</span><span class="pi">:</span> <span class="s">1</span>
<span class="key">alarm</span>: <span class="string"><span class="content">1</span></span> <span class="s">hygrometers</span><span class="pi">:</span> <span class="s">0</span>
<span class="key">hygrometers</span>: <span class="string"><span class="content">0</span></span> <span class="s">smartplugs</span><span class="pi">:</span> <span class="s">1</span>
<span class="key">smartplugs</span>: <span class="string"><span class="content">1</span></span> <span class="s">thermometers</span><span class="pi">:</span> <span class="s">0</span>
<span class="key">thermometers</span>: <span class="string"><span class="content">0</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
</article> </article>
@ -207,7 +205,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -87,13 +87,13 @@
<div class="meta clearfix"> <div class="meta clearfix">
<time datetime="2015-08-26T15:12:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> August 26, 2015</time> <time datetime="2015-08-26T15:12:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> August 26, 2015</time>
<span class="byline author vcard"><i class='icon-user'></i> Nolan Gilley</span> <span class="byline author vcard"><i class='icon-user'></i> Nolan Gilley</span>
<span><i class='icon-time'></i> four minutes reading time</span> <span><i class='icon-time'></i> five minutes reading time</span>
<span> <span>
<i class="icon-tags"></i> <i class="icon-tags"></i>
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/user-stories/'>User-Stories</a></li> <li>User-Stories</li>
</ul> </ul>
@ -158,87 +158,85 @@
The automation and script syntax here is using a deprecated and no longer supported format. The automation and script syntax here is using a deprecated and no longer supported format.
</p> </p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">mqtt</span><span class="pi">:</span>
<div class="code"><pre><span class="key">mqtt</span>: <span class="s">broker</span><span class="pi">:</span> <span class="s">192.168.1.100</span>
<span class="key">broker</span>: <span class="string"><span class="content">192.168.1.100</span></span> <span class="s">port</span><span class="pi">:</span> <span class="s">1883</span>
<span class="key">port</span>: <span class="string"><span class="content">1883</span></span> <span class="s">keepalive</span><span class="pi">:</span> <span class="s">60</span>
<span class="key">keepalive</span>: <span class="string"><span class="content">60</span></span> <span class="s">qos</span><span class="pi">:</span> <span class="s">0</span>
<span class="key">qos</span>: <span class="string"><span class="content">0</span></span>
<span class="key">sensor</span>: <span class="s">sensor</span><span class="pi">:</span>
<span class="key">platform</span>: <span class="string"><span class="content">mqtt</span></span> <span class="s">platform</span><span class="pi">:</span> <span class="s">mqtt</span>
<span class="key">name</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Dryer Status</span><span class="delimiter">&quot;</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s2">"</span><span class="s">Dryer</span><span class="nv"> </span><span class="s">Status"</span>
<span class="key">state_topic</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">sensor/dryer</span><span class="delimiter">&quot;</span></span> <span class="s">state_topic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">sensor/dryer"</span>
<span class="key">unit_of_measurement</span>: <span class="string"><span class="delimiter">&quot;</span><span class="delimiter">&quot;</span></span> <span class="s">unit_of_measurement</span><span class="pi">:</span> <span class="s2">"</span><span class="s">"</span>
<span class="key">sensor 2</span>: <span class="s">sensor 2</span><span class="pi">:</span>
<span class="key">platform</span>: <span class="string"><span class="content">mqtt</span></span> <span class="s">platform</span><span class="pi">:</span> <span class="s">mqtt</span>
<span class="key">name</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Washer Status</span><span class="delimiter">&quot;</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s2">"</span><span class="s">Washer</span><span class="nv"> </span><span class="s">Status"</span>
<span class="key">state_topic</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">sensor/washer</span><span class="delimiter">&quot;</span></span> <span class="s">state_topic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">sensor/washer"</span>
<span class="key">unit_of_measurement</span>: <span class="string"><span class="delimiter">&quot;</span><span class="delimiter">&quot;</span></span> <span class="s">unit_of_measurement</span><span class="pi">:</span> <span class="s2">"</span><span class="s">"</span>
<span class="key">automation</span>: <span class="s">automation</span><span class="pi">:</span>
<span class="key">alias</span>: <span class="string"><span class="content">Dryer complete</span></span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Dryer complete</span>
<span class="key">platform</span>: <span class="string"><span class="content">state</span></span> <span class="s">platform</span><span class="pi">:</span> <span class="s">state</span>
<span class="key">state_entity_id</span>: <span class="string"><span class="content">sensor.dryer_status</span></span> <span class="s">state_entity_id</span><span class="pi">:</span> <span class="s">sensor.dryer_status</span>
<span class="key">state_from</span>: <span class="string"><span class="content">'Running'</span></span> <span class="s">state_from</span><span class="pi">:</span> <span class="s1">'</span><span class="s">Running'</span>
<span class="key">state_to</span>: <span class="string"><span class="content">'Complete'</span></span> <span class="s">state_to</span><span class="pi">:</span> <span class="s1">'</span><span class="s">Complete'</span>
<span class="key">execute_service</span>: <span class="string"><span class="content">script.turn_on</span></span> <span class="s">execute_service</span><span class="pi">:</span> <span class="s">script.turn_on</span>
<span class="key">service_entity_id</span>: <span class="string"><span class="content">script.dryer_complete</span></span> <span class="s">service_entity_id</span><span class="pi">:</span> <span class="s">script.dryer_complete</span>
<span class="key">automation 2</span>: <span class="s">automation 2</span><span class="pi">:</span>
<span class="key">alias</span>: <span class="string"><span class="content">Dryer emptied</span></span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Dryer emptied</span>
<span class="key">platform</span>: <span class="string"><span class="content">state</span></span> <span class="s">platform</span><span class="pi">:</span> <span class="s">state</span>
<span class="key">state_entity_id</span>: <span class="string"><span class="content">sensor.dryer_status</span></span> <span class="s">state_entity_id</span><span class="pi">:</span> <span class="s">sensor.dryer_status</span>
<span class="key">state_from</span>: <span class="string"><span class="content">'Complete'</span></span> <span class="s">state_from</span><span class="pi">:</span> <span class="s1">'</span><span class="s">Complete'</span>
<span class="key">state_to</span>: <span class="string"><span class="content">'Empty'</span></span> <span class="s">state_to</span><span class="pi">:</span> <span class="s1">'</span><span class="s">Empty'</span>
<span class="key">execute_service</span>: <span class="string"><span class="content">script.turn_on</span></span> <span class="s">execute_service</span><span class="pi">:</span> <span class="s">script.turn_on</span>
<span class="key">service_entity_id</span>: <span class="string"><span class="content">script.dryer_cleared</span></span> <span class="s">service_entity_id</span><span class="pi">:</span> <span class="s">script.dryer_cleared</span>
<span class="key">script</span>: <span class="s">script</span><span class="pi">:</span>
<span class="key">dryer_complete</span>: <span class="s">dryer_complete</span><span class="pi">:</span>
<span class="key">alias</span>: <span class="string"><span class="content">Dryer Complete Script</span></span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Dryer Complete Script</span>
<span class="key">sequence</span>: <span class="s">sequence</span><span class="pi">:</span>
- <span class="string"><span class="content">alias: Pushbullet Notification</span></span> <span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Pushbullet Notification</span>
<span class="key">execute_service</span>: <span class="string"><span class="content">notify.notify</span></span> <span class="s">execute_service</span><span class="pi">:</span> <span class="s">notify.notify</span>
<span class="key">service_data</span>: <span class="s">service_data</span><span class="pi">:</span>
<span class="key">message</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">The dryer has finished its cycle, please empty it!</span><span class="delimiter">&quot;</span></span> <span class="s">message</span><span class="pi">:</span> <span class="s2">"</span><span class="s">The</span><span class="nv"> </span><span class="s">dryer</span><span class="nv"> </span><span class="s">has</span><span class="nv"> </span><span class="s">finished</span><span class="nv"> </span><span class="s">its</span><span class="nv"> </span><span class="s">cycle,</span><span class="nv"> </span><span class="s">please</span><span class="nv"> </span><span class="s">empty</span><span class="nv"> </span><span class="s">it!"</span>
- <span class="string"><span class="content">alias: Living Room Lights Red</span></span> <span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Living Room Lights Red</span>
<span class="key">execute_service</span>: <span class="string"><span class="content">scene.turn_on</span></span> <span class="s">execute_service</span><span class="pi">:</span> <span class="s">scene.turn_on</span>
<span class="key">service_data</span>: <span class="s">service_data</span><span class="pi">:</span>
<span class="key">entity_id</span>: <span class="string"><span class="content">scene.red</span></span> <span class="s">entity_id</span><span class="pi">:</span> <span class="s">scene.red</span>
- <span class="string"><span class="content">delay:</span><span class="content"> <span class="pi">-</span> <span class="s">delay</span><span class="pi">:</span>
seconds: 1</span></span> <span class="s">seconds</span><span class="pi">:</span> <span class="s">1</span>
- <span class="string"><span class="content">alias: Living Room Lights Off</span></span> <span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Living Room Lights Off</span>
<span class="key">execute_service</span>: <span class="string"><span class="content">light.turn_off</span></span> <span class="s">execute_service</span><span class="pi">:</span> <span class="s">light.turn_off</span>
<span class="key">service_data</span>: <span class="s">service_data</span><span class="pi">:</span>
<span class="key">entity_id</span>: <span class="string"><span class="content">group.living_room</span></span> <span class="s">entity_id</span><span class="pi">:</span> <span class="s">group.living_room</span>
- <span class="string"><span class="content">delay:</span><span class="content"> <span class="pi">-</span> <span class="s">delay</span><span class="pi">:</span>
seconds: 1</span></span> <span class="s">seconds</span><span class="pi">:</span> <span class="s">1</span>
- <span class="string"><span class="content">alias: Living Room Lights Red</span></span> <span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Living Room Lights Red</span>
<span class="key">execute_service</span>: <span class="string"><span class="content">scene.turn_on</span></span> <span class="s">execute_service</span><span class="pi">:</span> <span class="s">scene.turn_on</span>
<span class="key">service_data</span>: <span class="s">service_data</span><span class="pi">:</span>
<span class="key">entity_id</span>: <span class="string"><span class="content">scene.red</span></span> <span class="s">entity_id</span><span class="pi">:</span> <span class="s">scene.red</span>
<span class="key">dryer_cleared</span>: <span class="s">dryer_cleared</span><span class="pi">:</span>
<span class="key">alias</span>: <span class="string"><span class="content">Dryer Cleared Script</span></span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Dryer Cleared Script</span>
<span class="key">sequence</span>: <span class="s">sequence</span><span class="pi">:</span>
- <span class="string"><span class="content">alias: Living Room Lights Off</span></span> <span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Living Room Lights Off</span>
<span class="key">execute_service</span>: <span class="string"><span class="content">light.turn_off</span></span> <span class="s">execute_service</span><span class="pi">:</span> <span class="s">light.turn_off</span>
<span class="key">service_data</span>: <span class="s">service_data</span><span class="pi">:</span>
<span class="key">entity_id</span>: <span class="string"><span class="content">group.living_room</span></span> <span class="s">entity_id</span><span class="pi">:</span> <span class="s">group.living_room</span>
- <span class="string"><span class="content">delay:</span><span class="content"> <span class="pi">-</span> <span class="s">delay</span><span class="pi">:</span>
seconds: 1</span></span> <span class="s">seconds</span><span class="pi">:</span> <span class="s">1</span>
- <span class="string"><span class="content">alias: Living Room Lights Normal</span></span> <span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Living Room Lights Normal</span>
<span class="key">execute_service</span>: <span class="string"><span class="content">scene.turn_on</span></span> <span class="s">execute_service</span><span class="pi">:</span> <span class="s">scene.turn_on</span>
<span class="key">service_data</span>: <span class="s">service_data</span><span class="pi">:</span>
<span class="key">entity_id</span>: <span class="string"><span class="content">scene.normal</span></span> <span class="s">entity_id</span><span class="pi">:</span> <span class="s">scene.normal</span>
</pre></div> </code></pre>
</div>
</div> </div>
<p>Resources used:</p> <p>Resources used:</p>
@ -320,7 +318,7 @@ The automation and script syntax here is using a deprecated and no longer suppor
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -113,9 +113,9 @@
<ul> <ul>
<li>Each release will have a version number, starting with version 0.7. This was chosen because it shows that we have been around for some time but are not considering ourselves to be fully stable.</li> <li>Each release will have a version number, starting with version 0.7. This was chosen because it shows that we have been around for some time but are not considering ourselves to be fully stable.</li>
<li>Each release will be pushed to PyPi. This will be the only supported method of distribution.</li> <li>Each release will be pushed to PyPi. This will be the only supported method of distribution.</li>
<li>Home Assistant is available after installation as a command-line utility <code>hass</code>.</li> <li>Home Assistant is available after installation as a command-line utility <code class="highlighter-rouge">hass</code>.</li>
<li>The default configuration location has been moved from <code>config</code> in the current working directory to <code>~/.homeassistant</code> (<code>%APPDATA%/.homeassistant</code> on Windows).</li> <li>The default configuration location has been moved from <code class="highlighter-rouge">config</code> in the current working directory to <code class="highlighter-rouge">~/.homeassistant</code> (<code class="highlighter-rouge">%APPDATA%/.homeassistant</code> on Windows).</li>
<li>Requirements for components and platforms are no longer installed into the current Python environment (being virtual or not) but will be installed in <code>&lt;config-dir&gt;/lib</code>.</li> <li>Requirements for components and platforms are no longer installed into the current Python environment (being virtual or not) but will be installed in <code class="highlighter-rouge">&lt;config-dir&gt;/lib</code>.</li>
</ul> </ul>
<p>A huge shout out to <a href="https://github.com/rmkraus">Ryan Kraus</a> for making this all possible. Please make sure you read <a href="/blog/2015/08/31/version-7-revamped-ui-and-improved-distribution/#read-more">the full blog post</a> for details on how to migrate your existing setup.</p> <p>A huge shout out to <a href="https://github.com/rmkraus">Ryan Kraus</a> for making this all possible. Please make sure you read <a href="/blog/2015/08/31/version-7-revamped-ui-and-improved-distribution/#read-more">the full blog post</a> for details on how to migrate your existing setup.</p>
@ -133,93 +133,81 @@
<h3><a class="title-link" name="migration-to-version-07" href="#migration-to-version-07"></a> Migration to version 0.7</h3> <h3><a class="title-link" name="migration-to-version-07" href="#migration-to-version-07"></a> Migration to version 0.7</h3>
<p>For this example, lets say we have an old Home Assistant installation in <code>/home/paulus/home-assistant</code>.</p> <p>For this example, lets say we have an old Home Assistant installation in <code class="highlighter-rouge">/home/paulus/home-assistant</code>.</p>
<p>If you want to migrate your existing configuration to be used as the default configuration:</p> <p>If you want to migrate your existing configuration to be used as the default configuration:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>cp -r /home/paulus/home-assistant ~/.homeassistant
<div class="code"><pre>$ cp -r /home/paulus/home-assistant ~/.homeassistant </code></pre>
</pre></div>
</div>
</div> </div>
<p>It If you want to have the configuration in a different location, for example <code>/home/paulus/home-assistant-config</code>, you will have to point Home Assistant at this configuration folder when launching:</p> <p>It If you want to have the configuration in a different location, for example <code class="highlighter-rouge">/home/paulus/home-assistant-config</code>, you will have to point Home Assistant at this configuration folder when launching:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>hass --config /home/paulus/home-assistant-config
<div class="code"><pre>$ hass --config /home/paulus/home-assistant-config </code></pre>
</pre></div>
</div>
</div> </div>
<h3><a class="title-link" name="new-platforms" href="#new-platforms"></a> New platforms</h3> <h3><a class="title-link" name="new-platforms" href="#new-platforms"></a> New platforms</h3>
<p>And last, but not least: new platforms!</p> <p>And last, but not least: new platforms!</p>
<p><strong>MQTT Sensors and Switches</strong><br /> <p><strong>MQTT Sensors and Switches</strong>
<img src="/images/supported_brands/mqtt.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/sfam">@sfam</a> has blessed us with two more MQTT platforms to extend our integration with MQTTT: <a href="/components/sensor.mqtt/">sensor</a> and <a href="/components/switch.mqtt/">switch</a>. Both platforms require the MQTT component to be connected to a broker.</p> <img src="/images/supported_brands/mqtt.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/sfam">@sfam</a> has blessed us with two more MQTT platforms to extend our integration with MQTTT: <a href="/components/sensor.mqtt/">sensor</a> and <a href="/components/switch.mqtt/">switch</a>. Both platforms require the MQTT component to be connected to a broker.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yml entr</span>
<div class="code"><pre><span class="comment"># Example configuration.yml entr</span> <span class="s">sensor</span><span class="pi">:</span>
<span class="key">sensor</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">mqtt</span>
<span class="key">platform</span>: <span class="string"><span class="content">mqtt</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s2">"</span><span class="s">MQTT</span><span class="nv"> </span><span class="s">Sensor"</span>
<span class="key">name</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">MQTT Sensor</span><span class="delimiter">&quot;</span></span> <span class="s">state_topic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">home/bedroom/temperature"</span>
<span class="key">state_topic</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">home/bedroom/temperature</span><span class="delimiter">&quot;</span></span> <span class="s">unit_of_measurement</span><span class="pi">:</span> <span class="s2">"</span><span class="s">ºC"</span>
<span class="key">unit_of_measurement</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">ºC</span><span class="delimiter">&quot;</span></span>
<span class="key">switch</span>: <span class="s">switch</span><span class="pi">:</span>
<span class="key">platform</span>: <span class="string"><span class="content">mqtt</span></span> <span class="s">platform</span><span class="pi">:</span> <span class="s">mqtt</span>
<span class="key">name</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Bedroom Switch</span><span class="delimiter">&quot;</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s2">"</span><span class="s">Bedroom</span><span class="nv"> </span><span class="s">Switch"</span>
<span class="key">state_topic</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">home/bedroom/switch1</span><span class="delimiter">&quot;</span></span> <span class="s">state_topic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">home/bedroom/switch1"</span>
<span class="key">command_topic</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">home/bedroom/switch1/set</span><span class="delimiter">&quot;</span></span> <span class="s">command_topic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">home/bedroom/switch1/set"</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="s">payload_on</span><span class="pi">:</span> <span class="s2">"</span><span class="s">ON"</span>
<span class="key">payload_off</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">OFF</span><span class="delimiter">&quot;</span></span> <span class="s">payload_off</span><span class="pi">:</span> <span class="s2">"</span><span class="s">OFF"</span>
<span class="key">optimistic</span>: <span class="string"><span class="content">false</span></span> <span class="s">optimistic</span><span class="pi">:</span> <span class="s">false</span>
</pre></div> </code></pre>
</div>
</div> </div>
<p><strong>Actiontec MI424WR Verizon FIOS Wireless router</strong><br /> <p><strong>Actiontec MI424WR Verizon FIOS Wireless router</strong>
<img src="/images/supported_brands/actiontec.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/nkgilley">Nolan</a> has contributed support for Actiontec wireless routers.</p> <img src="/images/supported_brands/actiontec.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/nkgilley">Nolan</a> has contributed support for Actiontec wireless routers.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">device_tracker</span><span class="pi">:</span>
<span class="key">device_tracker</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">actiontec</span>
<span class="key">platform</span>: <span class="string"><span class="content">actiontec</span></span> <span class="s">host</span><span class="pi">:</span> <span class="s">YOUR_ROUTER_IP</span>
<span class="key">host</span>: <span class="string"><span class="content">YOUR_ROUTER_IP</span></span> <span class="s">username</span><span class="pi">:</span> <span class="s">YOUR_ADMIN_USERNAME</span>
<span class="key">username</span>: <span class="string"><span class="content">YOUR_ADMIN_USERNAME</span></span> <span class="s">password</span><span class="pi">:</span> <span class="s">YOUR_ADMIN_PASSWORD</span>
<span class="key">password</span>: <span class="string"><span class="content">YOUR_ADMIN_PASSWORD</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>DHT temperature and humidty sensors</strong><br /> <p><strong>DHT temperature and humidty sensors</strong>
<a href="https://github.com/makemeasandwich">@MakeMeASandwich</a> has contributed support for DHT temperature and humidity sensors. It allows you to get the current temperature and humidity from a DHT11, DHT22, or AM2302 device.</p> <a href="https://github.com/makemeasandwich">@MakeMeASandwich</a> has contributed support for DHT temperature and humidity sensors. It allows you to get the current temperature and humidity from a DHT11, DHT22, or AM2302 device.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">sensor</span><span class="pi">:</span>
<span class="key">sensor</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">dht</span>
<span class="key">platform</span>: <span class="string"><span class="content">dht</span></span> <span class="s">sensor</span><span class="pi">:</span> <span class="s">DHT22</span>
<span class="key">sensor</span>: <span class="string"><span class="content">DHT22</span></span> <span class="s">pin</span><span class="pi">:</span> <span class="s">23</span>
<span class="key">pin</span>: <span class="string"><span class="content">23</span></span> <span class="s">monitored_conditions</span><span class="pi">:</span>
<span class="key">monitored_conditions</span>: <span class="pi">-</span> <span class="s">temperature</span>
- <span class="string"><span class="content">temperature</span></span> <span class="pi">-</span> <span class="s">humidity</span>
- <span class="string"><span class="content">humidity</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>Aruba device tracker</strong><br /> <p><strong>Aruba device tracker</strong>
<a href="https://github.com/michaelarnauts">Michael Arnauts</a> has contributed support for Aruba wireless routers for presence detection.</p> <a href="https://github.com/michaelarnauts">Michael Arnauts</a> has contributed support for Aruba wireless routers for presence detection.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">device_tracker</span><span class="pi">:</span>
<span class="key">device_tracker</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">aruba</span>
<span class="key">platform</span>: <span class="string"><span class="content">aruba</span></span> <span class="s">host</span><span class="pi">:</span> <span class="s">YOUR_ACCESS_POINT_IP</span>
<span class="key">host</span>: <span class="string"><span class="content">YOUR_ACCESS_POINT_IP</span></span> <span class="s">username</span><span class="pi">:</span> <span class="s">YOUR_ADMIN_USERNAME</span>
<span class="key">username</span>: <span class="string"><span class="content">YOUR_ADMIN_USERNAME</span></span> <span class="s">password</span><span class="pi">:</span> <span class="s">YOUR_ADMIN_PASSWORD</span>
<span class="key">password</span>: <span class="string"><span class="content">YOUR_ADMIN_PASSWORD</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
</article> </article>
@ -294,7 +282,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -87,15 +87,15 @@
<div class="meta clearfix"> <div class="meta clearfix">
<time datetime="2015-09-11T09:19:38+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> September 11, 2015</time> <time datetime="2015-09-11T09:19:38+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> September 11, 2015</time>
<span class="byline author vcard"><i class='icon-user'></i> Fabian Affolter</span> <span class="byline author vcard"><i class='icon-user'></i> Fabian Affolter</span>
<span><i class='icon-time'></i> nine minutes reading time</span> <span><i class='icon-time'></i> eight minutes reading time</span>
<span> <span>
<i class="icon-tags"></i> <i class="icon-tags"></i>
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/how-to/'>How-To</a></li> <li>How-To</li>
<li><a class='category' href='/blog/categories/mqtt/'>MQTT</a></li> <li>MQTT</li>
</ul> </ul>
@ -121,38 +121,24 @@
<h3><a class="title-link" name="manual-usage" href="#manual-usage"></a> Manual usage</h3> <h3><a class="title-link" name="manual-usage" href="#manual-usage"></a> Manual usage</h3>
<p>The simplest but not the coolest way as a human to interact with a Home Assistant sensor is launching a command manually. Lets create a “Mood” sensor. For simplicity Home Assistant and the MQTT broker are both running on the same host. The needed configuration snipplets to add to the <code>configuration.yaml</code> file consists of two parts: one for the broker and one for the sensor.</p> <p>The simplest but not the coolest way as a human to interact with a Home Assistant sensor is launching a command manually. Lets create a “Mood” sensor. For simplicity Home Assistant and the MQTT broker are both running on the same host. The needed configuration snipplets to add to the <code class="highlighter-rouge">configuration.yaml</code> file consists of two parts: one for the broker and one for the sensor.</p>
<div class="highlighter-coderay"><table class="CodeRay"><tr> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">mqtt</span><span class="pi">:</span>
<td class="line-numbers"><pre><a href="#n1" name="n1">1</a> <span class="s">broker</span><span class="pi">:</span> <span class="s">127.0.0.1</span>
<a href="#n2" name="n2">2</a>
<a href="#n3" name="n3">3</a>
<a href="#n4" name="n4">4</a>
<a href="#n5" name="n5">5</a>
<a href="#n6" name="n6">6</a>
<a href="#n7" name="n7">7</a>
</pre></td>
<td 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">sensor</span>: <span class="s">sensor</span><span class="pi">:</span>
- <span class="string"><span class="content">platform: mqtt</span></span> <span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">mqtt</span>
<span class="key">name</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Fabian's Mood</span><span class="delimiter">&quot;</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s2">"</span><span class="s">Fabian's</span><span class="nv"> </span><span class="s">Mood"</span>
<span class="key">state_topic</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">home-assistant/fabian/mood</span><span class="delimiter">&quot;</span></span> <span class="s">state_topic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">home-assistant/fabian/mood"</span>
</pre></td> </code></pre>
</tr></table>
</div> </div>
<p>After a restart of Home Assistant the “Mood” sensor will show up in the frontend. For more details about the configuration of MQTT itself and the sensor, please refer to the <a href="https://home-assistant.io/components/mqtt/">MQTT component</a> or the <a href="https://home-assistant.io/components/sensor.mqtt/">MQTT sensor</a> documentation.</p> <p>After a restart of Home Assistant the “Mood” sensor will show up in the frontend. For more details about the configuration of MQTT itself and the sensor, please refer to the <a href="https://home-assistant.io/components/mqtt/">MQTT component</a> or the <a href="https://home-assistant.io/components/sensor.mqtt/">MQTT sensor</a> documentation.</p>
<p>Now we can set the mood. The commandline tool (<code>mosquitto_pub</code>) which is shipped with <code>mosquitto</code> is used to send an MQTT message.</p> <p>Now we can set the mood. The commandline tool (<code class="highlighter-rouge">mosquitto_pub</code>) which is shipped with <code class="highlighter-rouge">mosquitto</code> is used to send an MQTT message.</p>
<div class="highlighter-coderay"><table class="CodeRay"><tr> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>mosquitto_pub -h 127.0.0.1 -t <span class="s2">"home-assistant/fabian/mood"</span> -m <span class="s2">"bad"</span>
<td class="line-numbers"><pre><a href="#n1" name="n1">1</a> </code></pre>
</pre></td>
<td class="code"><pre>$ mosquitto_pub -h 127.0.0.1 -t &quot;home-assistant/fabian/mood&quot; -m &quot;bad&quot;
</pre></td>
</tr></table>
</div> </div>
<p class="img"> <p class="img">
@ -166,76 +152,44 @@
<p>The last section was pretty boring, I know. Nobody wants to send MQTT messages by hand if there is a computer on the desk. If you are playing the lottery this section is for you. If not, read it anyway because the lottery is just an example :-).</p> <p>The last section was pretty boring, I know. Nobody wants to send MQTT messages by hand if there is a computer on the desk. If you are playing the lottery this section is for you. If not, read it anyway because the lottery is just an example :-).</p>
<p>This example is using the <a href="https://eclipse.org/paho/clients/python/">Paho MQTT Python binding</a> because those binding should be available on the host where Home Assistant is running. If you want to use this example on another machine, please make sure that the bindings are installed (<code>pip3 install paho-mqtt</code>).</p> <p>This example is using the <a href="https://eclipse.org/paho/clients/python/">Paho MQTT Python binding</a> because those binding should be available on the host where Home Assistant is running. If you want to use this example on another machine, please make sure that the bindings are installed (<code class="highlighter-rouge">pip3 install paho-mqtt</code>).</p>
<p>The first step is to add an additional MQTT sensor to the <code>configuration.yaml</code> file. The sensor will be called “Lottery” and the unit of measurement will be “No.”.</p> <p>The first step is to add an additional MQTT sensor to the <code class="highlighter-rouge">configuration.yaml</code> file. The sensor will be called “Lottery” and the unit of measurement will be “No.”.</p>
<div class="highlighter-coderay"><table class="CodeRay"><tr> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code> <span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">mqtt</span>
<td class="line-numbers"><pre><a href="#n1" name="n1">1</a> <span class="s">name</span><span class="pi">:</span> <span class="s2">"</span><span class="s">Lottery"</span>
<a href="#n2" name="n2">2</a> <span class="s">state_topic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">home-assistant/lottery/number"</span>
<a href="#n3" name="n3">3</a> <span class="s">unit_of_measurement</span><span class="pi">:</span> <span class="s2">"</span><span class="s">No."</span>
<a href="#n4" name="n4">4</a> </code></pre>
</pre></td>
<td class="code"><pre> - <span class="string"><span class="content">platform: mqtt</span></span>
<span class="key">name</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Lottery</span><span class="delimiter">&quot;</span></span>
<span class="key">state_topic</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">home-assistant/lottery/number</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">No.</span><span class="delimiter">&quot;</span></span>
</pre></td>
</tr></table>
</div> </div>
<p>Dont forget to restart Home Assistant to make the configuration active.</p> <p>Dont forget to restart Home Assistant to make the configuration active.</p>
<p>To play, we need numbers from 1 to 49 which can be marked on the ticket. Those numbers should be random and displayed in the Home Assistant frontend. The Python script below is another simple example on how to send MQTT messages from the commandline; this time in a loop. For further information and examples please check the <a href="https://eclipse.org/paho/clients/python/docs/">Paho MQTT</a> documentation.</p> <p>To play, we need numbers from 1 to 49 which can be marked on the ticket. Those numbers should be random and displayed in the Home Assistant frontend. The Python script below is another simple example on how to send MQTT messages from the commandline; this time in a loop. For further information and examples please check the <a href="https://eclipse.org/paho/clients/python/docs/">Paho MQTT</a> documentation.</p>
<div class="highlighter-coderay"><table class="CodeRay"><tr> <div class="language-python highlighter-rouge"><pre class="highlight"><code><span class="c">#!/usr/bin/python3</span>
<td class="line-numbers"><pre><a href="#n1" name="n1">1</a> <span class="c">#</span>
<a href="#n2" name="n2">2</a> <span class="kn">import</span> <span class="nn">time</span>
<a href="#n3" name="n3">3</a> <span class="kn">import</span> <span class="nn">random</span>
<a href="#n4" name="n4">4</a> <span class="kn">import</span> <span class="nn">paho.mqtt.client</span> <span class="kn">as</span> <span class="nn">mqtt</span>
<a href="#n5" name="n5">5</a> <span class="kn">import</span> <span class="nn">paho.mqtt.publish</span> <span class="kn">as</span> <span class="nn">publish</span>
<a href="#n6" name="n6">6</a>
<a href="#n7" name="n7">7</a>
<a href="#n8" name="n8">8</a>
<a href="#n9" name="n9">9</a>
<strong><a href="#n10" name="n10">10</a></strong>
<a href="#n11" name="n11">11</a>
<a href="#n12" name="n12">12</a>
<a href="#n13" name="n13">13</a>
<a href="#n14" name="n14">14</a>
<a href="#n15" name="n15">15</a>
<a href="#n16" name="n16">16</a>
<a href="#n17" name="n17">17</a>
<a href="#n18" name="n18">18</a>
<a href="#n19" name="n19">19</a>
<strong><a href="#n20" name="n20">20</a></strong>
<a href="#n21" name="n21">21</a>
<a href="#n22" name="n22">22</a>
</pre></td>
<td class="code"><pre><span class="comment">#!/usr/bin/python3</span>
<span class="comment">#</span>
<span class="keyword">import</span> <span class="include">time</span>
<span class="keyword">import</span> <span class="include">random</span>
<span class="keyword">import</span> <span class="include">paho.mqtt.client</span> <span class="keyword">as</span> mqtt
<span class="keyword">import</span> <span class="include">paho.mqtt.publish</span> <span class="keyword">as</span> publish
broker = <span class="string"><span class="delimiter">'</span><span class="content">127.0.0.1</span><span class="delimiter">'</span></span> <span class="n">broker</span> <span class="o">=</span> <span class="s">'127.0.0.1'</span>
state_topic = <span class="string"><span class="delimiter">'</span><span class="content">home-assistant/lottery/number</span><span class="delimiter">'</span></span> <span class="n">state_topic</span> <span class="o">=</span> <span class="s">'home-assistant/lottery/number'</span>
delay = <span class="integer">5</span> <span class="n">delay</span> <span class="o">=</span> <span class="mi">5</span>
<span class="comment"># Send a single message to set the mood</span> <span class="c"># Send a single message to set the mood</span>
publish.single(<span class="string"><span class="delimiter">'</span><span class="content">home-assistant/fabian/mood</span><span class="delimiter">'</span></span>, <span class="string"><span class="delimiter">'</span><span class="content">good</span><span class="delimiter">'</span></span>, hostname=broker) <span class="n">publish</span><span class="o">.</span><span class="n">single</span><span class="p">(</span><span class="s">'home-assistant/fabian/mood'</span><span class="p">,</span> <span class="s">'good'</span><span class="p">,</span> <span class="n">hostname</span><span class="o">=</span><span class="n">broker</span><span class="p">)</span>
<span class="comment"># Send messages in a loop</span> <span class="c"># Send messages in a loop</span>
client = mqtt.Client(<span class="string"><span class="delimiter">&quot;</span><span class="content">ha-client</span><span class="delimiter">&quot;</span></span>) <span class="n">client</span> <span class="o">=</span> <span class="n">mqtt</span><span class="o">.</span><span class="n">Client</span><span class="p">(</span><span class="s">"ha-client"</span><span class="p">)</span>
client.connect(broker) <span class="n">client</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="n">broker</span><span class="p">)</span>
client.loop_start() <span class="n">client</span><span class="o">.</span><span class="n">loop_start</span><span class="p">()</span>
<span class="keyword">while</span> <span class="predefined-constant">True</span>: <span class="k">while</span> <span class="bp">True</span><span class="p">:</span>
client.publish(state_topic, random.randrange(<span class="integer">0</span>, <span class="integer">50</span>, <span class="integer">1</span>)) <span class="n">client</span><span class="o">.</span><span class="n">publish</span><span class="p">(</span><span class="n">state_topic</span><span class="p">,</span> <span class="n">random</span><span class="o">.</span><span class="n">randrange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">50</span><span class="p">,</span> <span class="mi">1</span><span class="p">))</span>
time.sleep(delay) <span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="n">delay</span><span class="p">)</span>
</pre></td> </code></pre>
</tr></table>
</div> </div>
<p>Every 5 seconds a message with a new number is sent to the broker and picked up by Home Assistant. By the way, my mood is much better now.</p> <p>Every 5 seconds a message with a new number is sent to the broker and picked up by Home Assistant. By the way, my mood is much better now.</p>
@ -258,162 +212,84 @@ client.loop_start()
<p>The <a href="http://knolleary.github.io/pubsubclient/">MQTT client</a> for the Arduino needs to be available in your Arduino IDE. Below you will find a sketch which could act as a starting point. Please modify the IP addresses, the MAC address, and the pin as needed and upload the sketch to your Arduino.</p> <p>The <a href="http://knolleary.github.io/pubsubclient/">MQTT client</a> for the Arduino needs to be available in your Arduino IDE. Below you will find a sketch which could act as a starting point. Please modify the IP addresses, the MAC address, and the pin as needed and upload the sketch to your Arduino.</p>
<div class="highlighter-coderay"><table class="CodeRay"><tr> <div class="language-c highlighter-rouge"><pre class="highlight"><code><span class="cm">/*
<td class="line-numbers"><pre><a href="#n1" name="n1">1</a>
<a href="#n2" name="n2">2</a>
<a href="#n3" name="n3">3</a>
<a href="#n4" name="n4">4</a>
<a href="#n5" name="n5">5</a>
<a href="#n6" name="n6">6</a>
<a href="#n7" name="n7">7</a>
<a href="#n8" name="n8">8</a>
<a href="#n9" name="n9">9</a>
<strong><a href="#n10" name="n10">10</a></strong>
<a href="#n11" name="n11">11</a>
<a href="#n12" name="n12">12</a>
<a href="#n13" name="n13">13</a>
<a href="#n14" name="n14">14</a>
<a href="#n15" name="n15">15</a>
<a href="#n16" name="n16">16</a>
<a href="#n17" name="n17">17</a>
<a href="#n18" name="n18">18</a>
<a href="#n19" name="n19">19</a>
<strong><a href="#n20" name="n20">20</a></strong>
<a href="#n21" name="n21">21</a>
<a href="#n22" name="n22">22</a>
<a href="#n23" name="n23">23</a>
<a href="#n24" name="n24">24</a>
<a href="#n25" name="n25">25</a>
<a href="#n26" name="n26">26</a>
<a href="#n27" name="n27">27</a>
<a href="#n28" name="n28">28</a>
<a href="#n29" name="n29">29</a>
<strong><a href="#n30" name="n30">30</a></strong>
<a href="#n31" name="n31">31</a>
<a href="#n32" name="n32">32</a>
<a href="#n33" name="n33">33</a>
<a href="#n34" name="n34">34</a>
<a href="#n35" name="n35">35</a>
<a href="#n36" name="n36">36</a>
<a href="#n37" name="n37">37</a>
<a href="#n38" name="n38">38</a>
<a href="#n39" name="n39">39</a>
<strong><a href="#n40" name="n40">40</a></strong>
<a href="#n41" name="n41">41</a>
<a href="#n42" name="n42">42</a>
<a href="#n43" name="n43">43</a>
<a href="#n44" name="n44">44</a>
<a href="#n45" name="n45">45</a>
<a href="#n46" name="n46">46</a>
<a href="#n47" name="n47">47</a>
<a href="#n48" name="n48">48</a>
<a href="#n49" name="n49">49</a>
<strong><a href="#n50" name="n50">50</a></strong>
<a href="#n51" name="n51">51</a>
<a href="#n52" name="n52">52</a>
<a href="#n53" name="n53">53</a>
<a href="#n54" name="n54">54</a>
<a href="#n55" name="n55">55</a>
<a href="#n56" name="n56">56</a>
<a href="#n57" name="n57">57</a>
<a href="#n58" name="n58">58</a>
<a href="#n59" name="n59">59</a>
<strong><a href="#n60" name="n60">60</a></strong>
<a href="#n61" name="n61">61</a>
<a href="#n62" name="n62">62</a>
<a href="#n63" name="n63">63</a>
<a href="#n64" name="n64">64</a>
<a href="#n65" name="n65">65</a>
<a href="#n66" name="n66">66</a>
<a href="#n67" name="n67">67</a>
<a href="#n68" name="n68">68</a>
</pre></td>
<td class="code"><pre><span class="comment">/*
This sketch is based on the basic MQTT example by This sketch is based on the basic MQTT example by
http://knolleary.github.io/pubsubclient/ http://knolleary.github.io/pubsubclient/
*/</span> */</span>
<span class="preprocessor">#include</span> <span class="include">&lt;SPI.h&gt;</span> <span class="cp">#include &lt;SPI.h&gt;
<span class="preprocessor">#include</span> <span class="include">&lt;Ethernet.h&gt;</span> #include &lt;Ethernet.h&gt;
<span class="preprocessor">#include</span> <span class="include">&lt;PubSubClient.h&gt;</span> #include &lt;PubSubClient.h&gt;
</span>
<span class="cp">#define DEBUG 1 // Debug output to serial console
</span>
<span class="c1">// Device settings
</span><span class="n">IPAddress</span> <span class="n">deviceIp</span><span class="p">(</span><span class="mi">192</span><span class="p">,</span> <span class="mi">168</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">43</span><span class="p">);</span>
<span class="n">byte</span> <span class="n">deviceMac</span><span class="p">[]</span> <span class="o">=</span> <span class="p">{</span> <span class="mh">0xAB</span><span class="p">,</span> <span class="mh">0xCD</span><span class="p">,</span> <span class="mh">0xFE</span><span class="p">,</span> <span class="mh">0xFE</span><span class="p">,</span> <span class="mh">0xFE</span><span class="p">,</span> <span class="mh">0xFE</span> <span class="p">};</span>
<span class="kt">char</span><span class="o">*</span> <span class="n">deviceId</span> <span class="o">=</span> <span class="s">"sensor01"</span><span class="p">;</span> <span class="c1">// Name of the sensor
</span><span class="kt">char</span><span class="o">*</span> <span class="n">stateTopic</span> <span class="o">=</span> <span class="s">"home-assistant/sensor01/brightness"</span><span class="p">;</span> <span class="c1">// MQTT topic where values are published
</span><span class="kt">int</span> <span class="n">sensorPin</span> <span class="o">=</span> <span class="n">A0</span><span class="p">;</span> <span class="c1">// Pin to which the sensor is connected to
</span><span class="kt">char</span> <span class="n">buf</span><span class="p">[</span><span class="mi">4</span><span class="p">];</span> <span class="c1">// Buffer to store the sensor value
</span><span class="kt">int</span> <span class="n">updateInterval</span> <span class="o">=</span> <span class="mi">1000</span><span class="p">;</span> <span class="c1">// Interval in miliseconds
</span>
<span class="c1">// MQTT server settings
</span><span class="n">IPAddress</span> <span class="n">mqttServer</span><span class="p">(</span><span class="mi">192</span><span class="p">,</span> <span class="mi">168</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">12</span><span class="p">);</span>
<span class="kt">int</span> <span class="n">mqttPort</span> <span class="o">=</span> <span class="mi">1883</span><span class="p">;</span>
<span class="preprocessor">#define</span> DEBUG <span class="integer">1</span> <span class="comment">// Debug output to serial console</span> <span class="n">EthernetClient</span> <span class="n">ethClient</span><span class="p">;</span>
<span class="n">PubSubClient</span> <span class="n">client</span><span class="p">(</span><span class="n">ethClient</span><span class="p">);</span>
<span class="comment">// Device settings</span> <span class="kt">void</span> <span class="nf">reconnect</span><span class="p">()</span> <span class="p">{</span>
IPAddress deviceIp(<span class="integer">192</span>, <span class="integer">168</span>, <span class="integer">0</span>, <span class="integer">43</span>); <span class="k">while</span> <span class="p">(</span><span class="o">!</span><span class="n">client</span><span class="p">.</span><span class="n">connected</span><span class="p">())</span> <span class="p">{</span>
byte deviceMac[] = { <span class="hex">0xAB</span>, <span class="hex">0xCD</span>, <span class="hex">0xFE</span>, <span class="hex">0xFE</span>, <span class="hex">0xFE</span>, <span class="hex">0xFE</span> }; <span class="cp">#if DEBUG
<span class="predefined-type">char</span>* deviceId = <span class="string"><span class="delimiter">&quot;</span><span class="content">sensor01</span><span class="delimiter">&quot;</span></span>; <span class="comment">// Name of the sensor</span> </span> <span class="n">Serial</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="s">"Attempting MQTT connection..."</span><span class="p">);</span>
<span class="predefined-type">char</span>* stateTopic = <span class="string"><span class="delimiter">&quot;</span><span class="content">home-assistant/sensor01/brightness</span><span class="delimiter">&quot;</span></span>; <span class="comment">// MQTT topic where values are published</span> <span class="cp">#endif
<span class="predefined-type">int</span> sensorPin = A0; <span class="comment">// Pin to which the sensor is connected to</span> </span> <span class="k">if</span> <span class="p">(</span><span class="n">client</span><span class="p">.</span><span class="n">connect</span><span class="p">(</span><span class="n">deviceId</span><span class="p">))</span> <span class="p">{</span>
<span class="predefined-type">char</span> buf[<span class="integer">4</span>]; <span class="comment">// Buffer to store the sensor value</span> <span class="cp">#if DEBUG
<span class="predefined-type">int</span> updateInterval = <span class="integer">1000</span>; <span class="comment">// Interval in miliseconds</span> </span> <span class="n">Serial</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="s">"connected"</span><span class="p">);</span>
<span class="cp">#endif
</span> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
<span class="cp">#if DEBUG
</span> <span class="n">Serial</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="s">"failed, rc="</span><span class="p">);</span>
<span class="n">Serial</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">client</span><span class="p">.</span><span class="n">state</span><span class="p">());</span>
<span class="n">Serial</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="s">" try again in 5 seconds"</span><span class="p">);</span>
<span class="cp">#endif
</span> <span class="n">delay</span><span class="p">(</span><span class="mi">5000</span><span class="p">);</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="comment">// MQTT server settings</span> <span class="kt">void</span> <span class="nf">setup</span><span class="p">()</span> <span class="p">{</span>
IPAddress mqttServer(<span class="integer">192</span>, <span class="integer">168</span>, <span class="integer">0</span>, <span class="integer">12</span>); <span class="n">Serial</span><span class="p">.</span><span class="n">begin</span><span class="p">(</span><span class="mi">57600</span><span class="p">);</span>
<span class="predefined-type">int</span> mqttPort = <span class="integer">1883</span>; <span class="n">client</span><span class="p">.</span><span class="n">setServer</span><span class="p">(</span><span class="n">mqttServer</span><span class="p">,</span> <span class="n">mqttPort</span><span class="p">);</span>
<span class="n">Ethernet</span><span class="p">.</span><span class="n">begin</span><span class="p">(</span><span class="n">deviceMac</span><span class="p">,</span> <span class="n">deviceIp</span><span class="p">);</span>
<span class="n">delay</span><span class="p">(</span><span class="mi">1500</span><span class="p">);</span>
<span class="p">}</span>
EthernetClient ethClient; <span class="kt">void</span> <span class="nf">loop</span><span class="p">()</span> <span class="p">{</span>
PubSubClient client(ethClient); <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">client</span><span class="p">.</span><span class="n">connected</span><span class="p">())</span> <span class="p">{</span>
<span class="n">reconnect</span><span class="p">();</span>
<span class="p">}</span>
<span class="n">client</span><span class="p">.</span><span class="n">loop</span><span class="p">();</span>
<span class="directive">void</span> reconnect() { <span class="kt">int</span> <span class="n">sensorValue</span> <span class="o">=</span> <span class="n">analogRead</span><span class="p">(</span><span class="n">sensorPin</span><span class="p">);</span>
<span class="keyword">while</span> (!client.connected()) { <span class="cp">#if DEBUG
<span class="preprocessor">#if</span> DEBUG </span> <span class="n">Serial</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="s">"Sensor value: "</span><span class="p">);</span>
Serial.print(<span class="string"><span class="delimiter">&quot;</span><span class="content">Attempting MQTT connection...</span><span class="delimiter">&quot;</span></span>); <span class="n">Serial</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="n">sensorValue</span><span class="p">);</span>
<span class="preprocessor">#endif</span> <span class="cp">#endif
<span class="keyword">if</span> (client.connect(deviceId)) { </span> <span class="n">client</span><span class="p">.</span><span class="n">publish</span><span class="p">(</span><span class="n">stateTopic</span><span class="p">,</span> <span class="n">itoa</span><span class="p">(</span><span class="n">sensorValue</span><span class="p">,</span> <span class="n">buf</span><span class="p">,</span> <span class="mi">10</span><span class="p">));</span>
<span class="preprocessor">#if</span> DEBUG <span class="n">delay</span><span class="p">(</span><span class="n">updateInterval</span><span class="p">);</span>
Serial.println(<span class="string"><span class="delimiter">&quot;</span><span class="content">connected</span><span class="delimiter">&quot;</span></span>); <span class="p">}</span>
<span class="preprocessor">#endif</span> </code></pre>
} <span class="keyword">else</span> {
<span class="preprocessor">#if</span> DEBUG
Serial.print(<span class="string"><span class="delimiter">&quot;</span><span class="content">failed, rc=</span><span class="delimiter">&quot;</span></span>);
Serial.print(client.state());
Serial.println(<span class="string"><span class="delimiter">&quot;</span><span class="content"> try again in 5 seconds</span><span class="delimiter">&quot;</span></span>);
<span class="preprocessor">#endif</span>
delay(<span class="integer">5000</span>);
}
}
}
<span class="directive">void</span> setup() {
Serial.begin(<span class="integer">57600</span>);
client.setServer(mqttServer, mqttPort);
Ethernet.begin(deviceMac, deviceIp);
delay(<span class="integer">1500</span>);
}
<span class="directive">void</span> loop() {
<span class="keyword">if</span> (!client.connected()) {
reconnect();
}
client.loop();
<span class="predefined-type">int</span> sensorValue = analogRead(sensorPin);
<span class="preprocessor">#if</span> DEBUG
Serial.print(<span class="string"><span class="delimiter">&quot;</span><span class="content">Sensor value: </span><span class="delimiter">&quot;</span></span>);
Serial.println(sensorValue);
<span class="preprocessor">#endif</span>
client.publish(stateTopic, itoa(sensorValue, buf, <span class="integer">10</span>));
delay(updateInterval);
}
</pre></td>
</tr></table>
</div> </div>
<p>The Arduino will send the value of the sensor every second. To use the data in Home Assistant, add an additional MQTT sensor to the <code>configuration.yaml</code> file.</p> <p>The Arduino will send the value of the sensor every second. To use the data in Home Assistant, add an additional MQTT sensor to the <code class="highlighter-rouge">configuration.yaml</code> file.</p>
<div class="highlighter-coderay"><table class="CodeRay"><tr> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code> <span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">mqtt</span>
<td class="line-numbers"><pre><a href="#n1" name="n1">1</a> <span class="s">name</span><span class="pi">:</span> <span class="s2">"</span><span class="s">Brightness"</span>
<a href="#n2" name="n2">2</a> <span class="s">state_topic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">home-assistant/sensor01/brightness"</span>
<a href="#n3" name="n3">3</a> <span class="s">unit_of_measurement</span><span class="pi">:</span> <span class="s2">"</span><span class="s">cd"</span>
<a href="#n4" name="n4">4</a> </code></pre>
</pre></td>
<td class="code"><pre> - <span class="string"><span class="content">platform: mqtt</span></span>
<span class="key">name</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Brightness</span><span class="delimiter">&quot;</span></span>
<span class="key">state_topic</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">home-assistant/sensor01/brightness</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">cd</span><span class="delimiter">&quot;</span></span>
</pre></td>
</tr></table>
</div> </div>
<p>After a restart of Home Assistant the values of your Arduino will be available.</p> <p>After a restart of Home Assistant the values of your Arduino will be available.</p>
@ -497,7 +373,7 @@ PubSubClient client(ethClient);
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,9 +93,9 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/how-to/'>How-To</a></li> <li>How-To</li>
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -165,22 +165,20 @@
<img src="/images/blog/2015-09-ifttt/recipe-twitter.png" /> <img src="/images/blog/2015-09-ifttt/recipe-twitter.png" />
</p> </p>
<p>This will tweet a message when an MQTT message is received that the smoke alarm has been triggered. Setup Maker channel with event name <code>HA_FIRE_ALARM</code> and Twitter channel to tweet the message in <code>value1</code>.</p> <p>This will tweet a message when an MQTT message is received that the smoke alarm has been triggered. Setup Maker channel with event name <code class="highlighter-rouge">HA_FIRE_ALARM</code> and Twitter channel to tweet the message in <code class="highlighter-rouge">value1</code>.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Configuration.yaml entry</span> <span class="s">automation</span><span class="pi">:</span>
<span class="key">automation</span>: <span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Post a tweet when fire alarm is triggered</span>
- <span class="string"><span class="content">alias: Post a tweet when fire alarm is triggered</span></span> <span class="s">trigger</span><span class="pi">:</span>
<span class="key">trigger</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">mqtt</span>
<span class="key">platform</span>: <span class="string"><span class="content">mqtt</span></span> <span class="s">mqtt_topic</span><span class="pi">:</span> <span class="s">home/alarm/fire</span>
<span class="key">mqtt_topic</span>: <span class="string"><span class="content">home/alarm/fire</span></span> <span class="s">mqtt_payload</span><span class="pi">:</span> <span class="s1">'</span><span class="s">on'</span>
<span class="key">mqtt_payload</span>: <span class="string"><span class="content">'on'</span></span>
<span class="key">action</span>: <span class="s">action</span><span class="pi">:</span>
<span class="key">service</span>: <span class="string"><span class="content">ifttt.trigger</span></span> <span class="s">service</span><span class="pi">:</span> <span class="s">ifttt.trigger</span>
<span class="key">data</span>: <span class="string"><span class="content">{&quot;event&quot;:&quot;HA_FIRE_ALARM&quot;, &quot;value1&quot;:&quot;The fire alarm just triggered!&quot;}</span></span> <span class="s">data</span><span class="pi">:</span> <span class="pi">{</span><span class="s2">"</span><span class="s">event"</span><span class="pi">:</span><span class="s2">"</span><span class="s">HA_FIRE_ALARM"</span><span class="pi">,</span> <span class="s2">"</span><span class="s">value1"</span><span class="pi">:</span><span class="s2">"</span><span class="s">The</span><span class="nv"> </span><span class="s">fire</span><span class="nv"> </span><span class="s">alarm</span><span class="nv"> </span><span class="s">just</span><span class="nv"> </span><span class="s">triggered!"</span><span class="pi">}</span>
</pre></div> </code></pre>
</div>
</div> </div>
<h2><a class="title-link" name="turn-on-lights-when-i-get-home" href="#turn-on-lights-when-i-get-home"></a> Turn on lights when I get home</h2> <h2><a class="title-link" name="turn-on-lights-when-i-get-home" href="#turn-on-lights-when-i-get-home"></a> Turn on lights when I get home</h2>
@ -356,7 +354,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/how-to/'>How-To</a></li> <li>How-To</li>
</ul> </ul>
@ -108,7 +108,7 @@
</header> </header>
<p><img src="/images/supported_brands/glances.png" style="border:none; box-shadow: none; float: right;" height="80" /><br /> <p><img src="/images/supported_brands/glances.png" style="border:none; box-shadow: none; float: right;" height="80" />
Inspried by a <a href="https://github.com/home-assistant/home-assistant/issues/310">feature requests</a> I started looking into the available options to do monitoring of remote hosts. The feature request is about displaying system information in a similar way than the <a href="/components/sensor.systemmonitor/">systemmonitor</a> sensor does it for the local system. After a while I started to think that it would be a nice addition for a small home network where no full-blown system monitoring setup is present.</p> Inspried by a <a href="https://github.com/home-assistant/home-assistant/issues/310">feature requests</a> I started looking into the available options to do monitoring of remote hosts. The feature request is about displaying system information in a similar way than the <a href="/components/sensor.systemmonitor/">systemmonitor</a> sensor does it for the local system. After a while I started to think that it would be a nice addition for a small home network where no full-blown system monitoring setup is present.</p>
<a name="read-more"></a> <a name="read-more"></a>
@ -121,28 +121,22 @@ Inspried by a <a href="https://github.com/home-assistant/home-assistant/issues/3
<p>First some extra packages are needed beside Glances, especially the <a href="http://bottlepy.org/docs/dev/index.html">bottle</a> webserver. I guess that Glances is available for your distribution as well. Otherwise follow those <a href="https://github.com/nicolargo/glances#installation">instructions</a>.</p> <p>First some extra packages are needed beside Glances, especially the <a href="http://bottlepy.org/docs/dev/index.html">bottle</a> webserver. I guess that Glances is available for your distribution as well. Otherwise follow those <a href="https://github.com/nicolargo/glances#installation">instructions</a>.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sudo dnf -y install glances python-bottle
<div class="code"><pre>$ sudo dnf -y install glances python-bottle </code></pre>
</pre></div>
</div>
</div> </div>
<p>On Fedora the Firewall settings are strict. Lets open port 61208 to allow other hosts to connect to that port. This is not needed if you just want to observe your local machine.</p> <p>On Fedora the Firewall settings are strict. Lets open port 61208 to allow other hosts to connect to that port. This is not needed if you just want to observe your local machine.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sudo firewall-cmd --permanent --add-port<span class="o">=</span>61208/tcp
<div class="code"><pre>$ sudo firewall-cmd --permanent --add-port=61208/tcp <span class="gp">$ </span>sudo firewall-cmd --reload
$ sudo firewall-cmd --reload </code></pre>
</pre></div>
</div>
</div> </div>
<p>Launch <code>glances</code> and keep an eye on the output.</p> <p>Launch <code class="highlighter-rouge">glances</code> and keep an eye on the output.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>glances -w
<div class="code"><pre>$ glances -w
Glances web server started on http://0.0.0.0:61208/ Glances web server started on http://0.0.0.0:61208/
</pre></div> </code></pre>
</div>
</div> </div>
<p>Now browse to http://IP_ADRRESS:61208/. You should see the webified view of Glances.</p> <p>Now browse to http://IP_ADRRESS:61208/. You should see the webified view of Glances.</p>
@ -154,26 +148,22 @@ Glances web server started on http://0.0.0.0:61208/
<p>Another check is to access the API located at http://IP_ADRRESS:61208/api/2/mem/used and to confirm that a detail about your memory usage is provided as a JSON response. If so, you are good to proceed.</p> <p>Another check is to access the API located at http://IP_ADRRESS:61208/api/2/mem/used and to confirm that a detail about your memory usage is provided as a JSON response. If so, you are good to proceed.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>curl -X GET http://IP_ADDRESS:61208/api/2/mem/used
<div class="code"><pre>$ curl -X GET http://IP_ADDRESS:61208/api/2/mem/used <span class="o">{</span><span class="s2">"used"</span>: 203943936<span class="o">}</span>
{&quot;used&quot;: 203943936} </code></pre>
</pre></div>
</div>
</div> </div>
<p>Add the <a href="/components/sensor.glances/">glances sensor</a> entry to your <code>configuration.yaml</code> file and restart Home Assistant then.</p> <p>Add the <a href="/components/sensor.glances/">glances sensor</a> entry to your <code class="highlighter-rouge">configuration.yaml</code> file and restart Home Assistant then.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">glances</span>
- <span class="string"><span class="content">platform: glances</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s">NAS</span>
<span class="key">name</span>: <span class="string"><span class="content">NAS</span></span> <span class="s">host</span><span class="pi">:</span> <span class="s">IP_ADDRESS</span>
<span class="key">host</span>: <span class="string"><span class="content">IP_ADDRESS</span></span> <span class="s">resources</span><span class="pi">:</span>
<span class="key">resources</span>: <span class="pi">-</span> <span class="s1">'</span><span class="s">disk_use_percent'</span>
- <span class="string"><span class="content">'disk_use_percent'</span></span> <span class="pi">-</span> <span class="s1">'</span><span class="s">disk_use'</span>
- <span class="string"><span class="content">'disk_use'</span></span> <span class="pi">-</span> <span class="s1">'</span><span class="s">disk_free'</span>
- <span class="string"><span class="content">'disk_free'</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p>If there are no error in the log file then you should see your new sensors.</p> <p>If there are no error in the log file then you should see your new sensors.</p>
@ -257,7 +247,7 @@ Glances web server started on http://0.0.0.0:61208/
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -112,56 +112,52 @@
<p>See <a href="https://github.com/home-assistant/home-assistant/releases/tag/0.7.3">GitHub</a> for more detailed release notes.</p> <p>See <a href="https://github.com/home-assistant/home-assistant/releases/tag/0.7.3">GitHub</a> for more detailed release notes.</p>
<p><em>Migration note: the <code>scheduler</code> component has been removed in favor of the <code>automation</code> component.</em></p> <p><em>Migration note: the <code class="highlighter-rouge">scheduler</code> component has been removed in favor of the <code class="highlighter-rouge">automation</code> component.</em></p>
<p><strong>Sonos</strong><br /> <p><strong>Sonos</strong>
<img src="/images/supported_brands/sonos.png" style="border:none; box-shadow: none; float: right;" height="50" /> Sonos support has been added by <a href="https://github.com/rhooper">@rhooper</a> and <a href="https://github.com/SEJeff">@SEJeff</a>. Home Assistant is now able to automatically detect Sonos devices in your network and set them up for you. It will allow you to control music playing on your Sonos and change the volume.</p> <img src="/images/supported_brands/sonos.png" style="border:none; box-shadow: none; float: right;" height="50" /> Sonos support has been added by <a href="https://github.com/rhooper">@rhooper</a> and <a href="https://github.com/SEJeff">@SEJeff</a>. Home Assistant is now able to automatically detect Sonos devices in your network and set them up for you. It will allow you to control music playing on your Sonos and change the volume.</p>
<p><strong>iTunes and airplay speakers</strong><br /> <p><strong>iTunes and airplay speakers</strong>
<img src="/images/supported_brands/itunes.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/maddox">@maddox</a> has contributed support for controlling iTunes and airplay speakers. For this to work you will have to run <a href="https://github.com/maddox/itunes-api">itunes-api</a> on your Mac as middleware.</p> <img src="/images/supported_brands/itunes.png" style="border:none; box-shadow: none; float: right;" height="50" /> <a href="https://github.com/maddox">@maddox</a> has contributed support for controlling iTunes and airplay speakers. For this to work you will have to run <a href="https://github.com/maddox/itunes-api">itunes-api</a> on your Mac as middleware.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span> <span class="s">media_player</span><span class="pi">:</span>
<span class="key">media_player</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">itunes</span>
<span class="key">platform</span>: <span class="string"><span class="content">itunes</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s">iTunes</span>
<span class="key">name</span>: <span class="string"><span class="content">iTunes</span></span> <span class="s">host</span><span class="pi">:</span> <span class="s">http://192.168.1.50</span>
<span class="key">host</span>: <span class="string"><span class="content">http://192.168.1.50</span></span> <span class="s">port</span><span class="pi">:</span> <span class="s">8181</span>
<span class="key">port</span>: <span class="string"><span class="content">8181</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<a name="read-more"></a> <a name="read-more"></a>
<p><strong>Automation</strong><br /> <p><strong>Automation</strong>
Automation has gotten a lot of love. It now supports conditions, multiple triggers and new types of triggers. The best to get started with it is to head over to the new <a href="/getting-started/automation/">getting started with automation</a> page.</p> Automation has gotten a lot of love. It now supports conditions, multiple triggers and new types of triggers. The best to get started with it is to head over to the new <a href="/getting-started/automation/">getting started with automation</a> page.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example of entry in configuration.yaml</span>
<div class="code"><pre><span class="comment"># Example of entry in configuration.yaml</span> <span class="s">automation</span><span class="pi">:</span>
<span class="key">automation</span>: <span class="s">alias</span><span class="pi">:</span> <span class="s">Light on in the evening</span>
<span class="key">alias</span>: <span class="string"><span class="content">Light on in the evening</span></span> <span class="s">trigger</span><span class="pi">:</span>
<span class="key">trigger</span>: <span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">sun</span>
- <span class="string"><span class="content">platform: sun</span></span> <span class="s">event</span><span class="pi">:</span> <span class="s">sunset</span>
<span class="key">event</span>: <span class="string"><span class="content">sunset</span></span> <span class="s">offset</span><span class="pi">:</span> <span class="s2">"</span><span class="s">-01:00:00"</span>
<span class="key">offset</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">-01:00:00</span><span class="delimiter">&quot;</span></span> <span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">state</span>
- <span class="string"><span class="content">platform: state</span></span> <span class="s">entity_id</span><span class="pi">:</span> <span class="s">group.all_devices</span>
<span class="key">entity_id</span>: <span class="string"><span class="content">group.all_devices</span></span> <span class="s">state</span><span class="pi">:</span> <span class="s">home</span>
<span class="key">state</span>: <span class="string"><span class="content">home</span></span> <span class="s">condition</span><span class="pi">:</span>
<span class="key">condition</span>: <span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">state</span>
- <span class="string"><span class="content">platform: state</span></span> <span class="s">entity_id</span><span class="pi">:</span> <span class="s">group.all_devices</span>
<span class="key">entity_id</span>: <span class="string"><span class="content">group.all_devices</span></span> <span class="s">state</span><span class="pi">:</span> <span class="s">home</span>
<span class="key">state</span>: <span class="string"><span class="content">home</span></span> <span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">time</span>
- <span class="string"><span class="content">platform: time</span></span> <span class="s">after</span><span class="pi">:</span> <span class="s2">"</span><span class="s">16:00:00"</span>
<span class="key">after</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">16:00:00</span><span class="delimiter">&quot;</span></span> <span class="s">before</span><span class="pi">:</span> <span class="s2">"</span><span class="s">23:00:00"</span>
<span class="key">before</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">23:00:00</span><span class="delimiter">&quot;</span></span> <span class="s">action</span><span class="pi">:</span>
<span class="key">action</span>: <span class="s">service</span><span class="pi">:</span> <span class="s">homeassistant.turn_on</span>
<span class="key">service</span>: <span class="string"><span class="content">homeassistant.turn_on</span></span> <span class="s">entity_id</span><span class="pi">:</span> <span class="s">group.living_room</span>
<span class="key">entity_id</span>: <span class="string"><span class="content">group.living_room</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><strong>Verisure Alarms</strong><br /> <p><strong>Verisure Alarms</strong>
<img src="/images/supported_brands/verisure.png" style="border:none; box-shadow: none; float: right;" height="50" /> We now support arming and disarming your verisure alarm from within Home Assistant thanks to added support by <a href="https://github.com/persandstrom">@persandstrom</a>.</p> <img src="/images/supported_brands/verisure.png" style="border:none; box-shadow: none; float: right;" height="50" /> We now support arming and disarming your verisure alarm from within Home Assistant thanks to added support by <a href="https://github.com/persandstrom">@persandstrom</a>.</p>
</article> </article>
@ -236,7 +232,7 @@ Automation has gotten a lot of love. It now supports conditions, multiple trigge
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -212,7 +212,7 @@ Map in Home Assistant showing two people and three zones (home, school, work)
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -87,17 +87,17 @@
<div class="meta clearfix"> <div class="meta clearfix">
<time datetime="2015-10-11T19:10:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> October 11, 2015</time> <time datetime="2015-10-11T19:10:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> October 11, 2015</time>
<span class="byline author vcard"><i class='icon-user'></i> Paulus Schoutsen</span> <span class="byline author vcard"><i class='icon-user'></i> Paulus Schoutsen</span>
<span><i class='icon-time'></i> eight minutes reading time</span> <span><i class='icon-time'></i> seven minutes reading time</span>
<span> <span>
<i class="icon-tags"></i> <i class="icon-tags"></i>
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/esp8266/'>ESP8266</a></li> <li>ESP8266</li>
<li><a class='category' href='/blog/categories/how-to/'>How-To</a></li> <li>How-To</li>
<li><a class='category' href='/blog/categories/mqtt/'>MQTT</a></li> <li>MQTT</li>
</ul> </ul>
@ -181,13 +181,13 @@ Home Assistant will keep track of historical values and allow you to integrate i
</tbody> </tbody>
</table> </table>
<p><em>I picked <code>#2</code> and <code>14</code> myself, you can configure them in the sketch.</em></p> <p><em>I picked <code class="highlighter-rouge">#2</code> and <code class="highlighter-rouge">14</code> myself, you can configure them in the sketch.</em></p>
<h3><a class="title-link" name="preparing-your-ide" href="#preparing-your-ide"></a> Preparing your IDE</h3> <h3><a class="title-link" name="preparing-your-ide" href="#preparing-your-ide"></a> Preparing your IDE</h3>
<p>Follow <a href="https://github.com/esp8266/Arduino#installing-with-boards-manager">these instructions</a> on how to install and prepare the Arduino IDE for ESP8266 development.</p> <p>Follow <a href="https://github.com/esp8266/Arduino#installing-with-boards-manager">these instructions</a> on how to install and prepare the Arduino IDE for ESP8266 development.</p>
<p>After youre done installing, open the Arduino IDE, in the menu click on <code>sketch</code> -&gt; <code>include library</code> -&gt; <code>manage libraries</code> and install the following libraries:</p> <p>After youre done installing, open the Arduino IDE, in the menu click on <code class="highlighter-rouge">sketch</code> -&gt; <code class="highlighter-rouge">include library</code> -&gt; <code class="highlighter-rouge">manage libraries</code> and install the following libraries:</p>
<ul> <ul>
<li>PubSubClient by Nick O Leary</li> <li>PubSubClient by Nick O Leary</li>
@ -199,289 +199,154 @@ Home Assistant will keep track of historical values and allow you to integrate i
<p>If you have followed the previous steps, youre all set.</p> <p>If you have followed the previous steps, youre all set.</p>
<ul> <ul>
<li>Open Arduino IDE and create a new sketch (<code>File</code> -&gt; <code>New</code>)</li> <li>Open Arduino IDE and create a new sketch (<code class="highlighter-rouge">File</code> -&gt; <code class="highlighter-rouge">New</code>)</li>
<li>Copy and paste the below sketch to the Arduino IDE</li> <li>Copy and paste the below sketch to the Arduino IDE</li>
<li>Adjust the values line 6 - 14 to match your setup</li> <li>Adjust the values line 6 - 14 to match your setup</li>
<li>Optional: If you want to connect to an MQTT server without a username or password, adjust line 62.</li> <li>Optional: If you want to connect to an MQTT server without a username or password, adjust line 62.</li>
<li>To have the ESP8266 accept our new sketch, we have to put it in upload mode. On the ESP8266 device keep the GPIO0 button pressed while pressing the reset button. The red led will glow half bright to indicate it is in upload mode.</li> <li>To have the ESP8266 accept our new sketch, we have to put it in upload mode. On the ESP8266 device keep the GPIO0 button pressed while pressing the reset button. The red led will glow half bright to indicate it is in upload mode.</li>
<li>Press the upload button in Arduino IDE</li> <li>Press the upload button in Arduino IDE</li>
<li>Open the serial monitor (<code>Tools</code> -&gt; <code>Serial Monitor</code>) to see the output from your device</li> <li>Open the serial monitor (<code class="highlighter-rouge">Tools</code> -&gt; <code class="highlighter-rouge">Serial Monitor</code>) to see the output from your device</li>
</ul> </ul>
<p>This sketch will connect to your WiFi network and MQTT broker. It will read the temperature and humidity from the sensor every second. It will report it to the MQTT server if the difference is &gt; 1 since last reported value. Reports to the MQTT broker are sent with retain set to <code>True</code>. This means that anyone connecting to the MQTT topic will automatically be notified of the last reported value.</p> <p>This sketch will connect to your WiFi network and MQTT broker. It will read the temperature and humidity from the sensor every second. It will report it to the MQTT server if the difference is &gt; 1 since last reported value. Reports to the MQTT broker are sent with retain set to <code class="highlighter-rouge">True</code>. This means that anyone connecting to the MQTT topic will automatically be notified of the last reported value.</p>
<div class="highlighter-coderay"><table class="CodeRay"><tr> <div class="language-cpp highlighter-rouge"><pre class="highlight"><code><span class="cp">#include &lt;ESP8266WiFi.h&gt;
<td class="line-numbers"><pre><a href="#n1" name="n1">1</a> #include &lt;Wire.h&gt;
<a href="#n2" name="n2">2</a> #include &lt;PubSubClient.h&gt;
<a href="#n3" name="n3">3</a> #include &lt;Adafruit_HDC1000.h&gt;
<a href="#n4" name="n4">4</a> </span>
<a href="#n5" name="n5">5</a> <span class="cp">#define wifi_ssid "YOUR WIFI SSID"
<a href="#n6" name="n6">6</a> #define wifi_password "WIFI PASSWORD"
<a href="#n7" name="n7">7</a> </span>
<a href="#n8" name="n8">8</a> <span class="cp">#define mqtt_server "YOUR_MQTT_SERVER_HOST"
<a href="#n9" name="n9">9</a> #define mqtt_user "your_username"
<strong><a href="#n10" name="n10">10</a></strong> #define mqtt_password "your_password"
<a href="#n11" name="n11">11</a> </span>
<a href="#n12" name="n12">12</a> <span class="cp">#define humidity_topic "sensor/humidity"
<a href="#n13" name="n13">13</a> #define temperature_topic "sensor/temperature"
<a href="#n14" name="n14">14</a> </span>
<a href="#n15" name="n15">15</a> <span class="n">WiFiClient</span> <span class="n">espClient</span><span class="p">;</span>
<a href="#n16" name="n16">16</a> <span class="n">PubSubClient</span> <span class="n">client</span><span class="p">(</span><span class="n">espClient</span><span class="p">);</span>
<a href="#n17" name="n17">17</a> <span class="n">Adafruit_HDC1000</span> <span class="n">hdc</span> <span class="o">=</span> <span class="n">Adafruit_HDC1000</span><span class="p">();</span>
<a href="#n18" name="n18">18</a>
<a href="#n19" name="n19">19</a>
<strong><a href="#n20" name="n20">20</a></strong>
<a href="#n21" name="n21">21</a>
<a href="#n22" name="n22">22</a>
<a href="#n23" name="n23">23</a>
<a href="#n24" name="n24">24</a>
<a href="#n25" name="n25">25</a>
<a href="#n26" name="n26">26</a>
<a href="#n27" name="n27">27</a>
<a href="#n28" name="n28">28</a>
<a href="#n29" name="n29">29</a>
<strong><a href="#n30" name="n30">30</a></strong>
<a href="#n31" name="n31">31</a>
<a href="#n32" name="n32">32</a>
<a href="#n33" name="n33">33</a>
<a href="#n34" name="n34">34</a>
<a href="#n35" name="n35">35</a>
<a href="#n36" name="n36">36</a>
<a href="#n37" name="n37">37</a>
<a href="#n38" name="n38">38</a>
<a href="#n39" name="n39">39</a>
<strong><a href="#n40" name="n40">40</a></strong>
<a href="#n41" name="n41">41</a>
<a href="#n42" name="n42">42</a>
<a href="#n43" name="n43">43</a>
<a href="#n44" name="n44">44</a>
<a href="#n45" name="n45">45</a>
<a href="#n46" name="n46">46</a>
<a href="#n47" name="n47">47</a>
<a href="#n48" name="n48">48</a>
<a href="#n49" name="n49">49</a>
<strong><a href="#n50" name="n50">50</a></strong>
<a href="#n51" name="n51">51</a>
<a href="#n52" name="n52">52</a>
<a href="#n53" name="n53">53</a>
<a href="#n54" name="n54">54</a>
<a href="#n55" name="n55">55</a>
<a href="#n56" name="n56">56</a>
<a href="#n57" name="n57">57</a>
<a href="#n58" name="n58">58</a>
<a href="#n59" name="n59">59</a>
<strong><a href="#n60" name="n60">60</a></strong>
<a href="#n61" name="n61">61</a>
<a href="#n62" name="n62">62</a>
<a href="#n63" name="n63">63</a>
<a href="#n64" name="n64">64</a>
<a href="#n65" name="n65">65</a>
<a href="#n66" name="n66">66</a>
<a href="#n67" name="n67">67</a>
<a href="#n68" name="n68">68</a>
<a href="#n69" name="n69">69</a>
<strong><a href="#n70" name="n70">70</a></strong>
<a href="#n71" name="n71">71</a>
<a href="#n72" name="n72">72</a>
<a href="#n73" name="n73">73</a>
<a href="#n74" name="n74">74</a>
<a href="#n75" name="n75">75</a>
<a href="#n76" name="n76">76</a>
<a href="#n77" name="n77">77</a>
<a href="#n78" name="n78">78</a>
<a href="#n79" name="n79">79</a>
<strong><a href="#n80" name="n80">80</a></strong>
<a href="#n81" name="n81">81</a>
<a href="#n82" name="n82">82</a>
<a href="#n83" name="n83">83</a>
<a href="#n84" name="n84">84</a>
<a href="#n85" name="n85">85</a>
<a href="#n86" name="n86">86</a>
<a href="#n87" name="n87">87</a>
<a href="#n88" name="n88">88</a>
<a href="#n89" name="n89">89</a>
<strong><a href="#n90" name="n90">90</a></strong>
<a href="#n91" name="n91">91</a>
<a href="#n92" name="n92">92</a>
<a href="#n93" name="n93">93</a>
<a href="#n94" name="n94">94</a>
<a href="#n95" name="n95">95</a>
<a href="#n96" name="n96">96</a>
<a href="#n97" name="n97">97</a>
<a href="#n98" name="n98">98</a>
<a href="#n99" name="n99">99</a>
<strong><a href="#n100" name="n100">100</a></strong>
<a href="#n101" name="n101">101</a>
<a href="#n102" name="n102">102</a>
<a href="#n103" name="n103">103</a>
<a href="#n104" name="n104">104</a>
<a href="#n105" name="n105">105</a>
<a href="#n106" name="n106">106</a>
<a href="#n107" name="n107">107</a>
<a href="#n108" name="n108">108</a>
<a href="#n109" name="n109">109</a>
<strong><a href="#n110" name="n110">110</a></strong>
<a href="#n111" name="n111">111</a>
</pre></td>
<td class="code"><pre><span class="preprocessor">#include</span> <span class="include">&lt;ESP8266WiFi.h&gt;</span>
<span class="preprocessor">#include</span> <span class="include">&lt;Wire.h&gt;</span>
<span class="preprocessor">#include</span> <span class="include">&lt;PubSubClient.h&gt;</span>
<span class="preprocessor">#include</span> <span class="include">&lt;Adafruit_HDC1000.h&gt;</span>
<span class="preprocessor">#define</span> wifi_ssid <span class="string"><span class="delimiter">&quot;</span><span class="content">YOUR WIFI SSID</span><span class="delimiter">&quot;</span></span> <span class="kt">void</span> <span class="nf">setup</span><span class="p">()</span> <span class="p">{</span>
<span class="preprocessor">#define</span> wifi_password <span class="string"><span class="delimiter">&quot;</span><span class="content">WIFI PASSWORD</span><span class="delimiter">&quot;</span></span> <span class="n">Serial</span><span class="p">.</span><span class="n">begin</span><span class="p">(</span><span class="mi">115200</span><span class="p">);</span>
<span class="n">setup_wifi</span><span class="p">();</span>
<span class="n">client</span><span class="p">.</span><span class="n">setServer</span><span class="p">(</span><span class="n">mqtt_server</span><span class="p">,</span> <span class="mi">1883</span><span class="p">);</span>
<span class="preprocessor">#define</span> mqtt_server <span class="string"><span class="delimiter">&quot;</span><span class="content">YOUR_MQTT_SERVER_HOST</span><span class="delimiter">&quot;</span></span> <span class="c1">// Set SDA and SDL ports
<span class="preprocessor">#define</span> mqtt_user <span class="string"><span class="delimiter">&quot;</span><span class="content">your_username</span><span class="delimiter">&quot;</span></span> </span> <span class="n">Wire</span><span class="p">.</span><span class="n">begin</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">14</span><span class="p">);</span>
<span class="preprocessor">#define</span> mqtt_password <span class="string"><span class="delimiter">&quot;</span><span class="content">your_password</span><span class="delimiter">&quot;</span></span>
<span class="preprocessor">#define</span> humidity_topic <span class="string"><span class="delimiter">&quot;</span><span class="content">sensor/humidity</span><span class="delimiter">&quot;</span></span> <span class="c1">// Start sensor
<span class="preprocessor">#define</span> temperature_topic <span class="string"><span class="delimiter">&quot;</span><span class="content">sensor/temperature</span><span class="delimiter">&quot;</span></span> </span> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">hdc</span><span class="p">.</span><span class="n">begin</span><span class="p">())</span> <span class="p">{</span>
<span class="n">Serial</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="s">"Couldn't find sensor!"</span><span class="p">);</span>
<span class="k">while</span> <span class="p">(</span><span class="mi">1</span><span class="p">);</span>
<span class="p">}</span>
<span class="p">}</span>
WiFiClient espClient; <span class="kt">void</span> <span class="nf">setup_wifi</span><span class="p">()</span> <span class="p">{</span>
PubSubClient client(espClient); <span class="n">delay</span><span class="p">(</span><span class="mi">10</span><span class="p">);</span>
Adafruit_HDC1000 hdc = Adafruit_HDC1000(); <span class="c1">// We start by connecting to a WiFi network
</span> <span class="n">Serial</span><span class="p">.</span><span class="n">println</span><span class="p">();</span>
<span class="n">Serial</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="s">"Connecting to "</span><span class="p">);</span>
<span class="n">Serial</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="n">wifi_ssid</span><span class="p">);</span>
<span class="directive">void</span> setup() { <span class="n">WiFi</span><span class="p">.</span><span class="n">begin</span><span class="p">(</span><span class="n">wifi_ssid</span><span class="p">,</span> <span class="n">wifi_password</span><span class="p">);</span>
Serial.begin(<span class="integer">115200</span>);
setup_wifi();
client.setServer(mqtt_server, <span class="integer">1883</span>);
<span class="comment">// Set SDA and SDL ports</span> <span class="k">while</span> <span class="p">(</span><span class="n">WiFi</span><span class="p">.</span><span class="n">status</span><span class="p">()</span> <span class="o">!=</span> <span class="n">WL_CONNECTED</span><span class="p">)</span> <span class="p">{</span>
Wire.begin(<span class="integer">2</span>, <span class="integer">14</span>); <span class="n">delay</span><span class="p">(</span><span class="mi">500</span><span class="p">);</span>
<span class="n">Serial</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="s">"."</span><span class="p">);</span>
<span class="p">}</span>
<span class="comment">// Start sensor</span> <span class="n">Serial</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="s">""</span><span class="p">);</span>
<span class="keyword">if</span> (!hdc.begin()) { <span class="n">Serial</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="s">"WiFi connected"</span><span class="p">);</span>
Serial.println(<span class="string"><span class="delimiter">&quot;</span><span class="content">Couldn't find sensor!</span><span class="delimiter">&quot;</span></span>); <span class="n">Serial</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="s">"IP address: "</span><span class="p">);</span>
<span class="keyword">while</span> (<span class="integer">1</span>); <span class="n">Serial</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="n">WiFi</span><span class="p">.</span><span class="n">localIP</span><span class="p">());</span>
} <span class="p">}</span>
}
<span class="directive">void</span> setup_wifi() { <span class="kt">void</span> <span class="nf">reconnect</span><span class="p">()</span> <span class="p">{</span>
delay(<span class="integer">10</span>); <span class="c1">// Loop until we're reconnected
<span class="comment">// We start by connecting to a WiFi network</span> </span> <span class="k">while</span> <span class="p">(</span><span class="o">!</span><span class="n">client</span><span class="p">.</span><span class="n">connected</span><span class="p">())</span> <span class="p">{</span>
Serial.println(); <span class="n">Serial</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="s">"Attempting MQTT connection..."</span><span class="p">);</span>
Serial.print(<span class="string"><span class="delimiter">&quot;</span><span class="content">Connecting to </span><span class="delimiter">&quot;</span></span>); <span class="c1">// Attempt to connect
Serial.println(wifi_ssid); </span> <span class="c1">// If you do not want to use a username and password, change next line to
</span> <span class="c1">// if (client.connect("ESP8266Client")) {
</span> <span class="k">if</span> <span class="p">(</span><span class="n">client</span><span class="p">.</span><span class="n">connect</span><span class="p">(</span><span class="s">"ESP8266Client"</span><span class="p">,</span> <span class="n">mqtt_user</span><span class="p">,</span> <span class="n">mqtt_password</span><span class="p">))</span> <span class="p">{</span>
<span class="n">Serial</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="s">"connected"</span><span class="p">);</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
<span class="n">Serial</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="s">"failed, rc="</span><span class="p">);</span>
<span class="n">Serial</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">client</span><span class="p">.</span><span class="n">state</span><span class="p">());</span>
<span class="n">Serial</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="s">" try again in 5 seconds"</span><span class="p">);</span>
<span class="c1">// Wait 5 seconds before retrying
</span> <span class="n">delay</span><span class="p">(</span><span class="mi">5000</span><span class="p">);</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
WiFi.begin(wifi_ssid, wifi_password); <span class="kt">bool</span> <span class="nf">checkBound</span><span class="p">(</span><span class="kt">float</span> <span class="n">newValue</span><span class="p">,</span> <span class="kt">float</span> <span class="n">prevValue</span><span class="p">,</span> <span class="kt">float</span> <span class="n">maxDiff</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="o">!</span><span class="n">isnan</span><span class="p">(</span><span class="n">newValue</span><span class="p">)</span> <span class="o">&amp;&amp;</span>
<span class="p">(</span><span class="n">newValue</span> <span class="o">&lt;</span> <span class="n">prevValue</span> <span class="o">-</span> <span class="n">maxDiff</span> <span class="o">||</span> <span class="n">newValue</span> <span class="o">&gt;</span> <span class="n">prevValue</span> <span class="o">+</span> <span class="n">maxDiff</span><span class="p">);</span>
<span class="p">}</span>
<span class="keyword">while</span> (WiFi.status() != WL_CONNECTED) { <span class="kt">long</span> <span class="n">lastMsg</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
delay(<span class="integer">500</span>); <span class="kt">float</span> <span class="n">temp</span> <span class="o">=</span> <span class="mf">0.0</span><span class="p">;</span>
Serial.print(<span class="string"><span class="delimiter">&quot;</span><span class="content">.</span><span class="delimiter">&quot;</span></span>); <span class="kt">float</span> <span class="n">hum</span> <span class="o">=</span> <span class="mf">0.0</span><span class="p">;</span>
} <span class="kt">float</span> <span class="n">diff</span> <span class="o">=</span> <span class="mf">1.0</span><span class="p">;</span>
Serial.println(<span class="string"><span class="delimiter">&quot;</span><span class="delimiter">&quot;</span></span>); <span class="kt">void</span> <span class="nf">loop</span><span class="p">()</span> <span class="p">{</span>
Serial.println(<span class="string"><span class="delimiter">&quot;</span><span class="content">WiFi connected</span><span class="delimiter">&quot;</span></span>); <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">client</span><span class="p">.</span><span class="n">connected</span><span class="p">())</span> <span class="p">{</span>
Serial.println(<span class="string"><span class="delimiter">&quot;</span><span class="content">IP address: </span><span class="delimiter">&quot;</span></span>); <span class="n">reconnect</span><span class="p">();</span>
Serial.println(WiFi.localIP()); <span class="p">}</span>
} <span class="n">client</span><span class="p">.</span><span class="n">loop</span><span class="p">();</span>
<span class="directive">void</span> reconnect() { <span class="kt">long</span> <span class="n">now</span> <span class="o">=</span> <span class="n">millis</span><span class="p">();</span>
<span class="comment">// Loop until we're reconnected</span> <span class="k">if</span> <span class="p">(</span><span class="n">now</span> <span class="o">-</span> <span class="n">lastMsg</span> <span class="o">&gt;</span> <span class="mi">1000</span><span class="p">)</span> <span class="p">{</span>
<span class="keyword">while</span> (!client.connected()) { <span class="n">lastMsg</span> <span class="o">=</span> <span class="n">now</span><span class="p">;</span>
Serial.print(<span class="string"><span class="delimiter">&quot;</span><span class="content">Attempting MQTT connection...</span><span class="delimiter">&quot;</span></span>);
<span class="comment">// Attempt to connect</span>
<span class="comment">// If you do not want to use a username and password, change next line to</span>
<span class="comment">// if (client.connect(&quot;ESP8266Client&quot;)) {</span>
<span class="keyword">if</span> (client.connect(<span class="string"><span class="delimiter">&quot;</span><span class="content">ESP8266Client</span><span class="delimiter">&quot;</span></span>, mqtt_user, mqtt_password)) {
Serial.println(<span class="string"><span class="delimiter">&quot;</span><span class="content">connected</span><span class="delimiter">&quot;</span></span>);
} <span class="keyword">else</span> {
Serial.print(<span class="string"><span class="delimiter">&quot;</span><span class="content">failed, rc=</span><span class="delimiter">&quot;</span></span>);
Serial.print(client.state());
Serial.println(<span class="string"><span class="delimiter">&quot;</span><span class="content"> try again in 5 seconds</span><span class="delimiter">&quot;</span></span>);
<span class="comment">// Wait 5 seconds before retrying</span>
delay(<span class="integer">5000</span>);
}
}
}
<span class="predefined-type">bool</span> checkBound(<span class="predefined-type">float</span> newValue, <span class="predefined-type">float</span> prevValue, <span class="predefined-type">float</span> maxDiff) { <span class="kt">float</span> <span class="n">newTemp</span> <span class="o">=</span> <span class="n">hdc</span><span class="p">.</span><span class="n">readTemperature</span><span class="p">();</span>
<span class="keyword">return</span> !isnan(newValue) &amp;&amp; <span class="kt">float</span> <span class="n">newHum</span> <span class="o">=</span> <span class="n">hdc</span><span class="p">.</span><span class="n">readHumidity</span><span class="p">();</span>
(newValue &lt; prevValue - maxDiff || newValue &gt; prevValue + maxDiff);
}
<span class="predefined-type">long</span> lastMsg = <span class="integer">0</span>; <span class="k">if</span> <span class="p">(</span><span class="n">checkBound</span><span class="p">(</span><span class="n">newTemp</span><span class="p">,</span> <span class="n">temp</span><span class="p">,</span> <span class="n">diff</span><span class="p">))</span> <span class="p">{</span>
<span class="predefined-type">float</span> temp = <span class="float">0</span><span class="float">.0</span>; <span class="n">temp</span> <span class="o">=</span> <span class="n">newTemp</span><span class="p">;</span>
<span class="predefined-type">float</span> hum = <span class="float">0</span><span class="float">.0</span>; <span class="n">Serial</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="s">"New temperature:"</span><span class="p">);</span>
<span class="predefined-type">float</span> diff = <span class="float">1</span><span class="float">.0</span>; <span class="n">Serial</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="n">temp</span><span class="p">).</span><span class="n">c_str</span><span class="p">());</span>
<span class="n">client</span><span class="p">.</span><span class="n">publish</span><span class="p">(</span><span class="n">temperature_topic</span><span class="p">,</span> <span class="n">String</span><span class="p">(</span><span class="n">temp</span><span class="p">).</span><span class="n">c_str</span><span class="p">(),</span> <span class="nb">true</span><span class="p">);</span>
<span class="p">}</span>
<span class="directive">void</span> loop() { <span class="k">if</span> <span class="p">(</span><span class="n">checkBound</span><span class="p">(</span><span class="n">newHum</span><span class="p">,</span> <span class="n">hum</span><span class="p">,</span> <span class="n">diff</span><span class="p">))</span> <span class="p">{</span>
<span class="keyword">if</span> (!client.connected()) { <span class="n">hum</span> <span class="o">=</span> <span class="n">newHum</span><span class="p">;</span>
reconnect(); <span class="n">Serial</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="s">"New humidity:"</span><span class="p">);</span>
} <span class="n">Serial</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="n">hum</span><span class="p">).</span><span class="n">c_str</span><span class="p">());</span>
client.loop(); <span class="n">client</span><span class="p">.</span><span class="n">publish</span><span class="p">(</span><span class="n">humidity_topic</span><span class="p">,</span> <span class="n">String</span><span class="p">(</span><span class="n">hum</span><span class="p">).</span><span class="n">c_str</span><span class="p">(),</span> <span class="nb">true</span><span class="p">);</span>
<span class="p">}</span>
<span class="predefined-type">long</span> now = millis(); <span class="p">}</span>
<span class="keyword">if</span> (now - lastMsg &gt; <span class="integer">1000</span>) { <span class="p">}</span>
lastMsg = now; </code></pre>
<span class="predefined-type">float</span> newTemp = hdc.readTemperature();
<span class="predefined-type">float</span> newHum = hdc.readHumidity();
<span class="keyword">if</span> (checkBound(newTemp, temp, diff)) {
temp = newTemp;
Serial.print(<span class="string"><span class="delimiter">&quot;</span><span class="content">New temperature:</span><span class="delimiter">&quot;</span></span>);
Serial.println(String(temp).c_str());
client.publish(temperature_topic, String(temp).c_str(), <span class="predefined-constant">true</span>);
}
<span class="keyword">if</span> (checkBound(newHum, hum, diff)) {
hum = newHum;
Serial.print(<span class="string"><span class="delimiter">&quot;</span><span class="content">New humidity:</span><span class="delimiter">&quot;</span></span>);
Serial.println(String(hum).c_str());
client.publish(humidity_topic, String(hum).c_str(), <span class="predefined-constant">true</span>);
}
}
}
</pre></td>
</tr></table>
</div> </div>
<h3><a class="title-link" name="configuring-home-assistant" href="#configuring-home-assistant"></a> Configuring Home Assistant</h3> <h3><a class="title-link" name="configuring-home-assistant" href="#configuring-home-assistant"></a> Configuring Home Assistant</h3>
<p>The last step is to integrate the sensor values into Home Assistant. This can be done by setting up Home Assistant to connect to the MQTT broker and subscribe to the sensor topics.</p> <p>The last step is to integrate the sensor values into Home Assistant. This can be done by setting up Home Assistant to connect to the MQTT broker and subscribe to the sensor topics.</p>
<div class="highlighter-coderay"><table class="CodeRay"><tr> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">mqtt</span><span class="pi">:</span>
<td class="line-numbers"><pre><a href="#n1" name="n1">1</a> <span class="s">broker</span><span class="pi">:</span> <span class="s">YOUR_MQTT_SERVER_HOST</span>
<a href="#n2" name="n2">2</a> <span class="s">username</span><span class="pi">:</span> <span class="s">your_username</span>
<a href="#n3" name="n3">3</a> <span class="s">password</span><span class="pi">:</span> <span class="s">your_password</span>
<a href="#n4" name="n4">4</a>
<a href="#n5" name="n5">5</a>
<a href="#n6" name="n6">6</a>
<a href="#n7" name="n7">7</a>
<a href="#n8" name="n8">8</a>
<a href="#n9" name="n9">9</a>
<strong><a href="#n10" name="n10">10</a></strong>
<a href="#n11" name="n11">11</a>
<a href="#n12" name="n12">12</a>
<a href="#n13" name="n13">13</a>
<a href="#n14" name="n14">14</a>
<a href="#n15" name="n15">15</a>
<a href="#n16" name="n16">16</a>
<a href="#n17" name="n17">17</a>
<a href="#n18" name="n18">18</a>
</pre></td>
<td class="code"><pre><span class="key">mqtt</span>:
<span class="key">broker</span>: <span class="string"><span class="content">YOUR_MQTT_SERVER_HOST</span></span>
<span class="key">username</span>: <span class="string"><span class="content">your_username</span></span>
<span class="key">password</span>: <span class="string"><span class="content">your_password</span></span>
<span class="key">sensor</span>: <span class="s">sensor</span><span class="pi">:</span>
<span class="key">platform</span>: <span class="string"><span class="content">mqtt</span></span> <span class="s">platform</span><span class="pi">:</span> <span class="s">mqtt</span>
<span class="key">name</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Temperature</span><span class="delimiter">&quot;</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s2">"</span><span class="s">Temperature"</span>
<span class="key">state_topic</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">sensor/temperature</span><span class="delimiter">&quot;</span></span> <span class="s">state_topic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">sensor/temperature"</span>
<span class="key">qos</span>: <span class="string"><span class="content">0</span></span> <span class="s">qos</span><span class="pi">:</span> <span class="s">0</span>
<span class="key">unit_of_measurement</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">ºC</span><span class="delimiter">&quot;</span></span> <span class="s">unit_of_measurement</span><span class="pi">:</span> <span class="s2">"</span><span class="s">ºC"</span>
<span class="key">sensor 2</span>: <span class="s">sensor 2</span><span class="pi">:</span>
<span class="key">platform</span>: <span class="string"><span class="content">mqtt</span></span> <span class="s">platform</span><span class="pi">:</span> <span class="s">mqtt</span>
<span class="key">name</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Humidity</span><span class="delimiter">&quot;</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s2">"</span><span class="s">Humidity"</span>
<span class="key">state_topic</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">sensor/humidity</span><span class="delimiter">&quot;</span></span> <span class="s">state_topic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">sensor/humidity"</span>
<span class="key">qos</span>: <span class="string"><span class="content">0</span></span> <span class="s">qos</span><span class="pi">:</span> <span class="s">0</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="s">unit_of_measurement</span><span class="pi">:</span> <span class="s2">"</span><span class="s">%"</span>
</pre></td> </code></pre>
</tr></table>
</div> </div>
</article> </article>
@ -556,7 +421,7 @@ Adafruit_HDC1000 hdc = Adafruit_HDC1000();
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -87,13 +87,13 @@
<div class="meta clearfix"> <div class="meta clearfix">
<time datetime="2015-10-11T17:10:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> October 11, 2015</time> <time datetime="2015-10-11T17:10:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> October 11, 2015</time>
<span class="byline author vcard"><i class='icon-user'></i> Paulus Schoutsen</span> <span class="byline author vcard"><i class='icon-user'></i> Paulus Schoutsen</span>
<span><i class='icon-time'></i> less than one minute reading time</span> <span><i class='icon-time'></i> Less than one minute reading time</span>
<span> <span>
<i class="icon-tags"></i> <i class="icon-tags"></i>
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -201,7 +201,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -121,10 +121,10 @@
<li>Media Player: <a href="/components/media_player.firetv/">Amazon FireTV</a> now supported (<a href="https://github.com/happyleavesaoc">@happyleavesaoc</a>)</li> <li>Media Player: <a href="/components/media_player.firetv/">Amazon FireTV</a> now supported (<a href="https://github.com/happyleavesaoc">@happyleavesaoc</a>)</li>
<li>Device Tracker: <a href="/components/device_tracker.locative/">Geofancy</a> now supported (<a href="https://github.com/wind-rider">@wind-rider</a>)</li> <li>Device Tracker: <a href="/components/device_tracker.locative/">Geofancy</a> now supported (<a href="https://github.com/wind-rider">@wind-rider</a>)</li>
<li>New component <a href="/components/shell_command/">Shell Command</a> can expose shell commands as services (<a href="https://github.com/balloob">@balloob</a>)</li> <li>New component <a href="/components/shell_command/">Shell Command</a> can expose shell commands as services (<a href="https://github.com/balloob">@balloob</a>)</li>
<li><a href="/components/script/">Scripts</a> can now be customized using <code>customize</code> key in <code>configuration.yaml</code> (<a href="https://github.com/balloob">@balloob</a>)</li> <li><a href="/components/script/">Scripts</a> can now be customized using <code class="highlighter-rouge">customize</code> key in <code class="highlighter-rouge">configuration.yaml</code> (<a href="https://github.com/balloob">@balloob</a>)</li>
<li>Light: <a href="/components/light.hyperion/">Hyperion</a> now supported (<a href="https://github.com/MakeMeASandwich">@MakeMeASandwich</a>)</li> <li>Light: <a href="/components/light.hyperion/">Hyperion</a> now supported (<a href="https://github.com/MakeMeASandwich">@MakeMeASandwich</a>)</li>
<li>Sensor: <a href="/components/sensor.arest/">aRest</a> can now also read out pins (<a href="https://github.com/balloob">@balloob</a>)</li> <li>Sensor: <a href="/components/sensor.arest/">aRest</a> can now also read out pins (<a href="https://github.com/balloob">@balloob</a>)</li>
<li>Sensor: <a href="/components/sensor.forecast/">Forecast.io</a> now supports specifying units in <code>configuration.yaml</code> (<a href="https://github.com/balloob">@balloob</a>)</li> <li>Sensor: <a href="/components/sensor.forecast/">Forecast.io</a> now supports specifying units in <code class="highlighter-rouge">configuration.yaml</code> (<a href="https://github.com/balloob">@balloob</a>)</li>
<li>Thermostat: <a href="/components/thermostat.heat_control/">Heat Control</a> has been completely rewritten (<a href="https://github.com/balloob">@balloob</a>)</li> <li>Thermostat: <a href="/components/thermostat.heat_control/">Heat Control</a> has been completely rewritten (<a href="https://github.com/balloob">@balloob</a>)</li>
<li>Switch: <a href="/components/switch.rest/">Rest</a> now supported (<a href="https://github.com/bachp">@bachp</a>)</li> <li>Switch: <a href="/components/switch.rest/">Rest</a> now supported (<a href="https://github.com/bachp">@bachp</a>)</li>
<li>Media Player: <a href="/components/media_player.plex/">Plex</a> can now be auto discovered and configure itself (<a href="https://github.com/tomduijf">@tomduijf</a>)</li> <li>Media Player: <a href="/components/media_player.plex/">Plex</a> can now be auto discovered and configure itself (<a href="https://github.com/tomduijf">@tomduijf</a>)</li>
@ -139,16 +139,16 @@
<p>As part of this release we did some cleanup which introduced backwards incompatible changes:</p> <p>As part of this release we did some cleanup which introduced backwards incompatible changes:</p>
<p><strong>Heat Control thermostat no longer includes scheduling features.</strong><br /> <p><strong>Heat Control thermostat no longer includes scheduling features.</strong>
This feature has been removed completely. Use the <a href="/getting-started/automation/">automation component</a> instead to control target temperature.</p> This feature has been removed completely. Use the <a href="/getting-started/automation/">automation component</a> instead to control target temperature.</p>
<p><strong>Config changed for calling a service from a script.</strong><br /> <p><strong>Config changed for calling a service from a script.</strong>
<code>execute_service:</code> has been replaced with <code>service:</code>. See <a href="/components/script/">component page</a> for example. The old method will continue working for some time.</p> <code class="highlighter-rouge">execute_service:</code> has been replaced with <code class="highlighter-rouge">service:</code>. See <a href="/components/script/">component page</a> for example. The old method will continue working for some time.</p>
<p><strong>Scenes can no longer be turned off.</strong><br /> <p><strong>Scenes can no longer be turned off.</strong>
It is no longer possible to turn a scene off after it has been activated. The way it worked was unpredictable and causes a lot of confusion.</p> It is no longer possible to turn a scene off after it has been activated. The way it worked was unpredictable and causes a lot of confusion.</p>
<p><strong>Downloader treats relative paths now relative to the config dir instead of the current working dir.</strong><br /> <p><strong>Downloader treats relative paths now relative to the config dir instead of the current working dir.</strong>
This makes more sense as most people run Home Assistant as a daemon</p> This makes more sense as most people run Home Assistant as a daemon</p>
</article> </article>
@ -223,7 +223,7 @@ This makes more sense as most people run Home Assistant as a daemon</p>
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -108,15 +108,13 @@
</header> </header>
<p><img src="/images/screenshots/custom-icons.png" style="float: right;" />We have all been hard at work to get this latest release ready. One of the big highlights in this release is the introduction of an extended iconset to be used in the frontend (credits to <a href="https://github.com/happyleavesaoc">@happyleavesaoc</a> for idea and prototype). To get started with customizing, pick any icon from <a href="https://MaterialDesignIcons.com">MaterialDesignIcons.com</a>, prefix the name with <code>mdi:</code> and stick it into your <code>customize</code> section in <code>configuration.yaml</code>:</p> <p><img src="/images/screenshots/custom-icons.png" style="float: right;" />We have all been hard at work to get this latest release ready. One of the big highlights in this release is the introduction of an extended iconset to be used in the frontend (credits to <a href="https://github.com/happyleavesaoc">@happyleavesaoc</a> for idea and prototype). To get started with customizing, pick any icon from <a href="https://MaterialDesignIcons.com">MaterialDesignIcons.com</a>, prefix the name with <code class="highlighter-rouge">mdi:</code> and stick it into your <code class="highlighter-rouge">customize</code> section in <code class="highlighter-rouge">configuration.yaml</code>:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">homeassistant</span><span class="pi">:</span>
<div class="code"><pre><span class="key">homeassistant</span>: <span class="s">customize</span><span class="pi">:</span>
<span class="key">customize</span>: <span class="s">switch.ac</span><span class="pi">:</span>
<span class="key">switch.ac</span>: <span class="s">icon</span><span class="pi">:</span> <span class="s1">'</span><span class="s">mdi:air-conditioner'</span>
<span class="key">icon</span>: <span class="string"><span class="content">'mdi:air-conditioner'</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<h4>Breaking changes</h4> <h4>Breaking changes</h4>
@ -219,7 +217,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/survey/'>Survey</a></li> <li>Survey</li>
</ul> </ul>
@ -259,7 +259,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -87,15 +87,15 @@
<div class="meta clearfix"> <div class="meta clearfix">
<time datetime="2015-12-05T23:39:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> December 5, 2015</time> <time datetime="2015-12-05T23:39:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> December 5, 2015</time>
<span class="byline author vcard"><i class='icon-user'></i> Paulus Schoutsen</span> <span class="byline author vcard"><i class='icon-user'></i> Paulus Schoutsen</span>
<span><i class='icon-time'></i> less than one minute reading time</span> <span><i class='icon-time'></i> Less than one minute reading time</span>
<span> <span>
<i class="icon-tags"></i> <i class="icon-tags"></i>
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/community/'>Community</a></li> <li>Community</li>
<li><a class='category' href='/blog/categories/video/'>Video</a></li> <li>Video</li>
</ul> </ul>
@ -194,7 +194,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -87,13 +87,13 @@
<div class="meta clearfix"> <div class="meta clearfix">
<time datetime="2015-12-06T19:29:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> December 6, 2015</time> <time datetime="2015-12-06T19:29:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> December 6, 2015</time>
<span class="byline author vcard"><i class='icon-user'></i> Paulus Schoutsen</span> <span class="byline author vcard"><i class='icon-user'></i> Paulus Schoutsen</span>
<span><i class='icon-time'></i> less than one minute reading time</span> <span><i class='icon-time'></i> Less than one minute reading time</span>
<span> <span>
<i class="icon-tags"></i> <i class="icon-tags"></i>
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -123,7 +123,7 @@
<li>Bunch of bug fixes and optimizations</li> <li>Bunch of bug fixes and optimizations</li>
</ul> </ul>
<p>To update, run <code>pip3 install --upgrade homeassistant</code>.</p> <p>To update, run <code class="highlighter-rouge">pip3 install --upgrade homeassistant</code>.</p>
<p class="img"> <p class="img">
<img src="/images/screenshots/lock-and-rollershutter-card.png" /> <img src="/images/screenshots/lock-and-rollershutter-card.png" />
@ -201,7 +201,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/how-to/'>How-To</a></li> <li>How-To</li>
</ul> </ul>
@ -108,103 +108,87 @@
</header> </header>
<p><img src="/images/supported_brands/influxdb.png" style="clear: right; border:none; box-shadow: none; float: right; margin-bottom: 12px;" width="200" /><img src="/images/supported_brands/grafana.png" style="clear: right; border:none; box-shadow: none; float: right; margin-bottom: 12px;" width="200" /><br /> <p><img src="/images/supported_brands/influxdb.png" style="clear: right; border:none; box-shadow: none; float: right; margin-bottom: 12px;" width="200" /><img src="/images/supported_brands/grafana.png" style="clear: right; border:none; box-shadow: none; float: right; margin-bottom: 12px;" width="200" />
The <a href="https://influxdb.com/">InfluxDB</a> database is a so-called time series database primarly designed to store sensor data and real-time analytics.</p> The <a href="https://influxdb.com/">InfluxDB</a> database is a so-called time series database primarly designed to store sensor data and real-time analytics.</p>
<p>The <code>influxdb</code> component makes it possible to transfer all state changes from Home Assistant to an external <a href="https://influxdb.com/">InfluxDB</a> database.</p> <p>The <code class="highlighter-rouge">influxdb</code> component makes it possible to transfer all state changes from Home Assistant to an external <a href="https://influxdb.com/">InfluxDB</a> database.</p>
<a name="read-more"></a> <a name="read-more"></a>
<p>The first step is to install the InfluxDB packages. If you are not running Fedora, check the <a href="https://influxdb.com/docs/v0.9/introduction/installation.html">installation</a> section for further details.</p> <p>The first step is to install the InfluxDB packages. If you are not running Fedora, check the <a href="https://influxdb.com/docs/v0.9/introduction/installation.html">installation</a> section for further details.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sudo dnf -y install http://influxdb.s3.amazonaws.com/influxdb-0.9.5.1-1.x86_64.rpm
<div class="code"><pre>$ sudo dnf -y install http://influxdb.s3.amazonaws.com/influxdb-0.9.5.1-1.x86_64.rpm </code></pre>
</pre></div>
</div>
</div> </div>
<p>Launch the InfluxDB service.</p> <p>Launch the InfluxDB service.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sudo systemctl start influxdb
<div class="code"><pre>$ sudo systemctl start influxdb </code></pre>
</pre></div>
</div>
</div> </div>
<p>If everything went well, then the web interface of the database should be accessible at <a href="http://localhost:8083/">http://localhost:8083/</a>. Create a database <code>home_assistant</code> to use with Home Assistant either with the web interface or the commandline tool <code>influx</code>.</p> <p>If everything went well, then the web interface of the database should be accessible at <a href="http://localhost:8083/">http://localhost:8083/</a>. Create a database <code class="highlighter-rouge">home_assistant</code> to use with Home Assistant either with the web interface or the commandline tool <code class="highlighter-rouge">influx</code>.</p>
<p class="img"> <p class="img">
<img src="/images/blog/2015-12-influxdb/influxdb-frontend.png" /> <img src="/images/blog/2015-12-influxdb/influxdb-frontend.png" />
InfluxDB web frontend InfluxDB web frontend
</p> </p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>influx
<div class="code"><pre>$ influx Visit https://enterprise.influxdata.com to register <span class="k">for </span>updates, InfluxDB server management, and monitoring.
Visit https://enterprise.influxdata.com to register for updates, InfluxDB server management, and monitoring.
Connected to http://localhost:8086 version 0.9.5.1 Connected to http://localhost:8086 version 0.9.5.1
InfluxDB shell 0.9.5.1 InfluxDB shell 0.9.5.1
&gt; CREATE DATABASE home_assistant <span class="gp">&gt; </span>CREATE DATABASE home_assistant
</pre></div> </code></pre>
</div>
</div> </div>
<p>An optional step is to create a user. Keep in mind to adjust the configuration (add <code>username</code> and <code>password</code>) in the next step if you prefer to go this way.</p> <p>An optional step is to create a user. Keep in mind to adjust the configuration (add <code class="highlighter-rouge">username</code> and <code class="highlighter-rouge">password</code>) in the next step if you prefer to go this way.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">&gt; </span>CREATE USER <span class="s2">"home-assistant"</span> WITH PASSWORD <span class="s1">'password'</span>
<div class="code"><pre>&gt; CREATE USER &quot;home-assistant&quot; WITH PASSWORD 'password' </code></pre>
</pre></div>
</div>
</div> </div>
<p>To use the <code>influxdb</code> component in your installation, add the following to your <code>configuration.yaml</code> file:</p> <p>To use the <code class="highlighter-rouge">influxdb</code> component in your installation, add the following to your <code class="highlighter-rouge">configuration.yaml</code> file:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">influxdb</span><span class="pi">:</span>
<div class="code"><pre><span class="key">influxdb</span>: <span class="s">host</span><span class="pi">:</span> <span class="s">127.0.0.1</span>
<span class="key">host</span>: <span class="string"><span class="content">127.0.0.1</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p>After you restart Home Assistant you should see that the InfluxDB database gets filled. The <a href="https://influxdb.com/docs/v0.9/query_language/index.html">language</a> to query the database is similar to SQL.</p> <p>After you restart Home Assistant you should see that the InfluxDB database gets filled. The <a href="https://influxdb.com/docs/v0.9/query_language/index.html">language</a> to query the database is similar to SQL.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>influx
<div class="code"><pre>$ influx <span class="o">[</span>...]
[...] <span class="gp">&gt; </span>USE home_assistant
&gt; USE home_assistant
Using database home_assistant Using database home_assistant
&gt; SELECT * FROM binary_sensor <span class="gp">&gt; </span>SELECT <span class="k">*</span> FROM binary_sensor
name: binary_sensor name: binary_sensor
------------------- -------------------
time domain entity_id value <span class="nb">time </span>domain entity_id value
1449496577000000000 binary_sensor bathroom_door 0 1449496577000000000 binary_sensor bathroom_door 0
1449496577000000000 binary_sensor bathroom_window 0 1449496577000000000 binary_sensor bathroom_window 0
1449496577000000000 binary_sensor basement_door 0 1449496577000000000 binary_sensor basement_door 0
1449496577000000000 binary_sensor basement_window 0 1449496577000000000 binary_sensor basement_window 0
1449496684000000000 binary_sensor bathroom_window 1 1449496684000000000 binary_sensor bathroom_window 1
[...] <span class="o">[</span>...]
</pre></div> </code></pre>
</div>
</div> </div>
<p><a href="http://grafana.org/">Grafana</a> is a dashboard that can create graphs from different sources including InfluxDB. The installation is simple, and there are detailed steps for many different configurations on the <a href="http://docs.grafana.org/installation/">Grafana installation</a> page. For a recent system that is running Fedora:</p> <p><a href="http://grafana.org/">Grafana</a> is a dashboard that can create graphs from different sources including InfluxDB. The installation is simple, and there are detailed steps for many different configurations on the <a href="http://docs.grafana.org/installation/">Grafana installation</a> page. For a recent system that is running Fedora:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sudo dnf -y install https://grafanarel.s3.amazonaws.com/builds/grafana-2.5.0-1.x86_64.rpm
<div class="code"><pre>$ sudo dnf -y install https://grafanarel.s3.amazonaws.com/builds/grafana-2.5.0-1.x86_64.rpm </code></pre>
</pre></div>
</div>
</div> </div>
<p>Start the grafana server.</p> <p>Start the grafana server.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sudo systemctl daemon-reload
<div class="code"><pre>$ sudo systemctl daemon-reload <span class="gp">$ </span>sudo systemctl start grafana-server
$ sudo systemctl start grafana-server <span class="gp">$ </span>sudo systemctl status grafana-server
$ sudo systemctl status grafana-server </code></pre>
</pre></div>
</div>
</div> </div>
<p>Login with the username <code>admin</code> and the password <code>admin</code> at <a href="http://localhost:3000/login">http://localhost:3000/login</a>. Now follow the <a href="http://docs.grafana.org/datasources/influxdb/">InfluxDB setup instructions</a>.</p> <p>Login with the username <code class="highlighter-rouge">admin</code> and the password <code class="highlighter-rouge">admin</code> at <a href="http://localhost:3000/login">http://localhost:3000/login</a>. Now follow the <a href="http://docs.grafana.org/datasources/influxdb/">InfluxDB setup instructions</a>.</p>
<p>Now you can start to create dashboards and graphs. You have various options to get the data from the graph. The next image just shows a screenshot of the setting for a temperature sensor.</p> <p>Now you can start to create dashboards and graphs. You have various options to get the data from the graph. The next image just shows a screenshot of the setting for a temperature sensor.</p>
@ -292,7 +276,7 @@ $ sudo systemctl status grafana-server
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/how-to/'>How-To</a></li> <li>How-To</li>
</ul> </ul>
@ -108,7 +108,7 @@
</header> </header>
<p><img src="/images/blog/2015-12-tasker/tasker-logo.png" style="clear: right; border:none; box-shadow: none; float: right; margin-bottom: 12px;" width="200" /><br /> <p><img src="/images/blog/2015-12-tasker/tasker-logo.png" style="clear: right; border:none; box-shadow: none; float: right; margin-bottom: 12px;" width="200" />
In this tutorial I will explain how you can activate Tasker tasks from Home Assistant command line switches. We are going to set up a switch that when toggled will make your Android device say either “On” or “Off”.</p> In this tutorial I will explain how you can activate Tasker tasks from Home Assistant command line switches. We are going to set up a switch that when toggled will make your Android device say either “On” or “Off”.</p>
<p>You could also do this with the automation component instead so whenever you put your house to sleep mode for example your Android device will open up Google Play Books or the Kindle app ready for you to read as well as dimming your lights, but this tutorial is all about the switches.</p> <p>You could also do this with the automation component instead so whenever you put your house to sleep mode for example your Android device will open up Google Play Books or the Kindle app ready for you to read as well as dimming your lights, but this tutorial is all about the switches.</p>
@ -123,7 +123,7 @@ In this tutorial I will explain how you can activate Tasker tasks from Home Assi
<img src="/images/blog/2015-12-tasker/screenshot-1.png" /> <img src="/images/blog/2015-12-tasker/screenshot-1.png" />
</p> </p>
<p>Now type in <code>SayOn</code> in the <code>Message</code> box and you should see a box appear on the right with a URL in it, this is what we will be using in the Python script later on so save that for later. Do the same thing again but this time replace <code>SayOn</code> with <code>SayOff</code>. Now just click the <code>Send message now!</code> button to test that your commands will get sent to your Android device, if they do you will see a toast message at the bottom of your screen like this one.</p> <p>Now type in <code class="highlighter-rouge">SayOn</code> in the <code class="highlighter-rouge">Message</code> box and you should see a box appear on the right with a URL in it, this is what we will be using in the Python script later on so save that for later. Do the same thing again but this time replace <code class="highlighter-rouge">SayOn</code> with <code class="highlighter-rouge">SayOff</code>. Now just click the <code class="highlighter-rouge">Send message now!</code> button to test that your commands will get sent to your Android device, if they do you will see a toast message at the bottom of your screen like this one.</p>
<p class="img"> <p class="img">
<img src="/images/blog/2015-12-tasker/screenshot-2.png" height="450" /> <img src="/images/blog/2015-12-tasker/screenshot-2.png" height="450" />
@ -131,41 +131,37 @@ In this tutorial I will explain how you can activate Tasker tasks from Home Assi
<h3>Tasker Setup</h3> <h3>Tasker Setup</h3>
<p>Open up Tasker and make sure youre in the <code>PROFILES</code> tab, then select the plus icon to create a new profile. Select <code>Event</code> -&gt; <code>Plugin</code> -&gt; <code>AutoRemote</code> -&gt; <code>AutoRemote</code> and then the pencil icon to configure the AutoRemote event. Select <code>Message Filter</code> and enter in <code>SayOn</code> then go back until it asks you for a task. Select <code>New task</code> then just leave the next field blank and select the tick icon. <br /> <p>Open up Tasker and make sure youre in the <code class="highlighter-rouge">PROFILES</code> tab, then select the plus icon to create a new profile. Select <code class="highlighter-rouge">Event</code> -&gt; <code class="highlighter-rouge">Plugin</code> -&gt; <code class="highlighter-rouge">AutoRemote</code> -&gt; <code class="highlighter-rouge">AutoRemote</code> and then the pencil icon to configure the AutoRemote event. Select <code class="highlighter-rouge">Message Filter</code> and enter in <code class="highlighter-rouge">SayOn</code> then go back until it asks you for a task. Select <code class="highlighter-rouge">New task</code> then just leave the next field blank and select the tick icon.
This is where well configure our task, so select the plus icon to select an action. Select <code>Alert</code> -&gt; <code>Say</code> to add a Say action. Enter <code>On</code> in the text field and go back to test your task, make sure your media volume is up then select the play icon, you should hear your device say “On”.</p> This is where well configure our task, so select the plus icon to select an action. Select <code class="highlighter-rouge">Alert</code> -&gt; <code class="highlighter-rouge">Say</code> to add a Say action. Enter <code class="highlighter-rouge">On</code> in the text field and go back to test your task, make sure your media volume is up then select the play icon, you should hear your device say “On”.</p>
<p class="img"> <p class="img">
<img src="/images/blog/2015-12-tasker/screenshot-3.png" height="450" /> <img src="/images/blog/2015-12-tasker/screenshot-3.png" height="450" />
</p> </p>
<p>Now you can go back to the main Tasker screen and create another profile but this time replace <code>SayOn</code> with <code>SayOff</code> and <code>On</code> with <code>Off</code>. After youve done that go to the main screen again and select the menu button at the top then <code>Exit</code> and <code>Save first</code> to make sure everything is saved properly.</p> <p>Now you can go back to the main Tasker screen and create another profile but this time replace <code class="highlighter-rouge">SayOn</code> with <code class="highlighter-rouge">SayOff</code> and <code class="highlighter-rouge">On</code> with <code class="highlighter-rouge">Off</code>. After youve done that go to the main screen again and select the menu button at the top then <code class="highlighter-rouge">Exit</code> and <code class="highlighter-rouge">Save first</code> to make sure everything is saved properly.</p>
<h3>Python Script</h3> <h3>Python Script</h3>
<p>Now its time to set it up the script, so create a new Python script and name it <code>On.py</code> then enter this code:</p> <p>Now its time to set it up the script, so create a new Python script and name it <code class="highlighter-rouge">On.py</code> then enter this code:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-python highlighter-rouge"><pre class="highlight"><code><span class="kn">import</span> <span class="nn">requests</span>
<div class="code"><pre><span class="keyword">import</span> <span class="include">requests</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">'[URL]'</span><span class="p">)</span>
requests.get(<span class="string"><span class="delimiter">'</span><span class="content">[URL]</span><span class="delimiter">'</span></span>) </code></pre>
</pre></div>
</div>
</div> </div>
<p>Enter in your “On” URL then save it. Create another script but this time call it <code>Off.py</code> and enter your “off” URL instead.</p> <p>Enter in your “On” URL then save it. Create another script but this time call it <code class="highlighter-rouge">Off.py</code> and enter your “off” URL instead.</p>
<h3>Home Assistant Configuration</h3> <h3>Home Assistant Configuration</h3>
<p>Add a command line switch to your Home Assistant configuration:</p> <p>Add a command line switch to your Home Assistant configuration:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">switch</span><span class="pi">:</span>
<div class="code"><pre><span class="key">switch</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">command_switch</span>
<span class="key">platform</span>: <span class="string"><span class="content">command_switch</span></span> <span class="s">switches</span><span class="pi">:</span>
<span class="key">switches</span>: <span class="s">tasker_say</span><span class="pi">:</span>
<span class="key">tasker_say</span>: <span class="s">oncmd</span><span class="pi">:</span> <span class="s">python "[LocationOfOnScript]"</span>
<span class="key">oncmd</span>: <span class="string"><span class="content">python &quot;[LocationOfOnScript]&quot;</span></span> <span class="s">offcmd</span><span class="pi">:</span> <span class="s">python "[LocationOfOffScript]"</span>
<span class="key">offcmd</span>: <span class="string"><span class="content">python &quot;[LocationOfOffScript]&quot;</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p>Now load up Home Assistant and whenever you toggle the switch you created your Android device will respond with either “On” or “Off”. :-)</p> <p>Now load up Home Assistant and whenever you toggle the switch you created your Android device will respond with either “On” or “Off”. :-)</p>
@ -242,7 +238,7 @@ requests.get(<span class="string"><span class="delimiter">'</span><span class="c
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/public-service-announcement/'>Public-Service-Announcement</a></li> <li>Public-Service-Announcement</li>
</ul> </ul>
@ -214,7 +214,7 @@ Philips Hue FAQ entries regarding 3rd party light bulbs.
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -87,13 +87,13 @@
<div class="meta clearfix"> <div class="meta clearfix">
<time datetime="2015-12-13T18:05:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> December 13, 2015</time> <time datetime="2015-12-13T18:05:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> December 13, 2015</time>
<span class="byline author vcard"><i class='icon-user'></i> Paulus Schoutsen & Martin Hjelmare</span> <span class="byline author vcard"><i class='icon-user'></i> Paulus Schoutsen & Martin Hjelmare</span>
<span><i class='icon-time'></i> four minutes reading time</span> <span><i class='icon-time'></i> five minutes reading time</span>
<span> <span>
<i class="icon-tags"></i> <i class="icon-tags"></i>
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/how-to/'>How-To</a></li> <li>How-To</li>
</ul> </ul>
@ -148,61 +148,53 @@
<p>Lets Encrypt will give you a free 90-day certificate if you pass their domain validation challenge. Domains are validated by having certain data be accessible on your domain for Lets Encrypt (<a href="https://letsencrypt.org/how-it-works/">they describe it better themselves</a>).</p> <p>Lets Encrypt will give you a free 90-day certificate if you pass their domain validation challenge. Domains are validated by having certain data be accessible on your domain for Lets Encrypt (<a href="https://letsencrypt.org/how-it-works/">they describe it better themselves</a>).</p>
<p>Assuming that your home is behind a router, the first thing to do is to set up port forwarding from your router to your computer that will run Lets Encrypt. For the Lets Encrypt set up we need to forward external port <code>80</code> to internal port <code>80</code> (http connections). This can be set up by accessing your router admin interface (<a href="http://portforward.com">Site with port forwarding instructions per router</a>). This port forward must be active whenever you want to request a new certificate from Lets Encrypt, typically every three months. If you normally dont use or have an app that listens to port <code>80</code>, it should be safe to leave the port open. This will make renewing certificates easier.</p> <p>Assuming that your home is behind a router, the first thing to do is to set up port forwarding from your router to your computer that will run Lets Encrypt. For the Lets Encrypt set up we need to forward external port <code class="highlighter-rouge">80</code> to internal port <code class="highlighter-rouge">80</code> (http connections). This can be set up by accessing your router admin interface (<a href="http://portforward.com">Site with port forwarding instructions per router</a>). This port forward must be active whenever you want to request a new certificate from Lets Encrypt, typically every three months. If you normally dont use or have an app that listens to port <code class="highlighter-rouge">80</code>, it should be safe to leave the port open. This will make renewing certificates easier.</p>
<p>Now youre ready to install and run the client that requests certificates from Lets Encrypt. The following example will use the platform independent script to install and run the <a href="https://certbot.eff.org/">certbot</a> client from Lets Encrypt. If there is a certbot package for your OS, its recommended to install the package instead of the platform independent script. Read the <a href="https://certbot.eff.org/">docs</a> for more information. There are also other clients that might offer more customization and options. See the <a href="https://letsencrypt.org/docs/client-options/">client options page</a> at Lets Encrypt.</p> <p>Now youre ready to install and run the client that requests certificates from Lets Encrypt. The following example will use the platform independent script to install and run the <a href="https://certbot.eff.org/">certbot</a> client from Lets Encrypt. If there is a certbot package for your OS, its recommended to install the package instead of the platform independent script. Read the <a href="https://certbot.eff.org/">docs</a> for more information. There are also other clients that might offer more customization and options. See the <a href="https://letsencrypt.org/docs/client-options/">client options page</a> at Lets Encrypt.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>mkdir certbot
<div class="code"><pre>$ mkdir certbot <span class="gp">$ </span><span class="nb">cd </span>certbot/
$ cd certbot/ <span class="gp">$ </span>wget https://dl.eff.org/certbot-auto
$ wget https://dl.eff.org/certbot-auto <span class="gp">$ </span>chmod a+x certbot-auto
$ chmod a+x certbot-auto <span class="gp">$ </span>./certbot-auto certonly --standalone <span class="se">\</span>
$ ./certbot-auto certonly --standalone \ --standalone-supported-challenges http-01 <span class="se">\</span>
--standalone-supported-challenges http-01 \ --email your@email.address <span class="se">\</span>
--email your@email.address \
-d hass-example.duckdns.org -d hass-example.duckdns.org
</pre></div> </code></pre>
</div>
</div> </div>
<p>If youre using Docker, run the following command to generate the required keys:</p> <p>If youre using Docker, run the following command to generate the required keys:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code>sudo mkdir /etc/letsencrypt /var/lib/letsencrypt
<div class="code"><pre>sudo mkdir /etc/letsencrypt /var/lib/letsencrypt sudo docker run -it --rm -p 80:80 --name certbot <span class="se">\</span>
sudo docker run -it --rm -p 80:80 --name certbot \ -v <span class="s2">"/etc/letsencrypt:/etc/letsencrypt"</span> <span class="se">\</span>
-v &quot;/etc/letsencrypt:/etc/letsencrypt&quot; \ -v <span class="s2">"/var/lib/letsencrypt:/var/lib/letsencrypt"</span> <span class="se">\</span>
-v &quot;/var/lib/letsencrypt:/var/lib/letsencrypt&quot; \ quay.io/letsencrypt/letsencrypt:latest certonly <span class="se">\</span>
quay.io/letsencrypt/letsencrypt:latest certonly \ --standalone --standalone-supported-challenges http-01 <span class="se">\</span>
--standalone --standalone-supported-challenges http-01 \
--email your@email.address -d hass-example.duckdns.org --email your@email.address -d hass-example.duckdns.org
</pre></div> </code></pre>
</div>
</div> </div>
<p>With either method your certificate will be generated and put in the directory <code>/etc/letsencrypt/live/hass-example.duckdns.org</code>. As the lifetime is only 90 days, you will have to repeat this every 90 days. Theres a special command to simplify renewing certificates:</p> <p>With either method your certificate will be generated and put in the directory <code class="highlighter-rouge">/etc/letsencrypt/live/hass-example.duckdns.org</code>. As the lifetime is only 90 days, you will have to repeat this every 90 days. Theres a special command to simplify renewing certificates:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code>./certbot-auto renew --quiet --no-self-upgrade --standalone <span class="se">\</span>
<div class="code"><pre>./certbot-auto renew --quiet --no-self-upgrade --standalone \
--standalone-supported-challenges http-01 --standalone-supported-challenges http-01
</pre></div> </code></pre>
</div>
</div> </div>
<p><img width="60" src="/images/favicon-192x192.png" style="float: right; border:none; box-shadow: none;" /></p> <p><img width="60" src="/images/favicon-192x192.png" style="float: right; border:none; box-shadow: none;" /></p>
<h3><a class="title-link" name="home-assistant" href="#home-assistant"></a> Home Assistant</h3> <h3><a class="title-link" name="home-assistant" href="#home-assistant"></a> Home Assistant</h3>
<p>Before updating the Home Assistant configuration, we have to forward port <code>443</code> (https connections) to port <code>8123</code> on the computer that will run Home Assistant. Do this in your router configuration as previously done for port <code>80</code>.</p> <p>Before updating the Home Assistant configuration, we have to forward port <code class="highlighter-rouge">443</code> (https connections) to port <code class="highlighter-rouge">8123</code> on the computer that will run Home Assistant. Do this in your router configuration as previously done for port <code class="highlighter-rouge">80</code>.</p>
<p>The final step is to point Home Assistant at the generated certificates. Before you do this, make sure that the user running Home Assistant has read access to the folder that holds the certificates.</p> <p>The final step is to point Home Assistant at the generated certificates. Before you do this, make sure that the user running Home Assistant has read access to the folder that holds the certificates.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">http</span><span class="pi">:</span>
<div class="code"><pre><span class="key">http</span>: <span class="s">api_password</span><span class="pi">:</span> <span class="s">YOUR_SECRET_PASSWORD</span>
<span class="key">api_password</span>: <span class="string"><span class="content">YOUR_SECRET_PASSWORD</span></span> <span class="s">ssl_certificate</span><span class="pi">:</span> <span class="s">/etc/letsencrypt/live/hass-example.duckdns.org/fullchain.pem</span>
<span class="key">ssl_certificate</span>: <span class="string"><span class="content">/etc/letsencrypt/live/hass-example.duckdns.org/fullchain.pem</span></span> <span class="s">ssl_key</span><span class="pi">:</span> <span class="s">/etc/letsencrypt/live/hass-example.duckdns.org/privkey.pem</span>
<span class="key">ssl_key</span>: <span class="string"><span class="content">/etc/letsencrypt/live/hass-example.duckdns.org/privkey.pem</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p>You can now navigate to https://hass-example.duckdns.org and enjoy encryption!</p> <p>You can now navigate to https://hass-example.duckdns.org and enjoy encryption!</p>
@ -281,7 +273,7 @@ sudo docker run -it --rm -p 80:80 --name certbot \
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -137,17 +137,15 @@
<p>This release introduces templates. This will allow you to parse data before it gets processed or create messages for notifications on the fly based on data within Home Assistant. The notification component and the new Alexa/Amazon Echo component are both using the new template functionality to render responses. A template editor has been added to the developer tool section in the app so you can get instant feedback if your templates are working or not.</p> <p>This release introduces templates. This will allow you to parse data before it gets processed or create messages for notifications on the fly based on data within Home Assistant. The notification component and the new Alexa/Amazon Echo component are both using the new template functionality to render responses. A template editor has been added to the developer tool section in the app so you can get instant feedback if your templates are working or not.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-text highlighter-rouge"><pre class="highlight"><code>The temperature at home is {{ states('sensor.temperature') }}.
<div class="code"><pre>The temperature at home is {{ states('sensor.temperature') }}. </code></pre>
</pre></div>
</div>
</div> </div>
<p>More information and examples can be found in the <a href="/topics/templating/">template documentation</a>.</p> <p>More information and examples can be found in the <a href="/topics/templating/">template documentation</a>.</p>
<h3>Breaking changes</h3> <h3>Breaking changes</h3>
<p>Templates will now be the only way to extract data from raw sources like REST, CommandSensor or MQTT. This will replace any specific option that used to do this before. This means that <code>precision</code>, <code>factor</code>, <code>attribute</code> or <code>json_path</code> etc will no longer work.</p> <p>Templates will now be the only way to extract data from raw sources like REST, CommandSensor or MQTT. This will replace any specific option that used to do this before. This means that <code class="highlighter-rouge">precision</code>, <code class="highlighter-rouge">factor</code>, <code class="highlighter-rouge">attribute</code> or <code class="highlighter-rouge">json_path</code> etc will no longer work.</p>
<p>Affected components and platforms:</p> <p>Affected components and platforms:</p>
@ -235,7 +233,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -122,7 +122,7 @@
<li>Switch: <a href="/components/switch.wemo/">wemo</a> now uses subscription to states instead of polling (<a href="https://github.com/pavoni">@pavoni</a>)</li> <li>Switch: <a href="/components/switch.wemo/">wemo</a> now uses subscription to states instead of polling (<a href="https://github.com/pavoni">@pavoni</a>)</li>
<li><a href="/components/tellduslive/">Telldus Live</a> support added (<a href="https://github.com/molobrakos">@molobrakos</a>)</li> <li><a href="/components/tellduslive/">Telldus Live</a> support added (<a href="https://github.com/molobrakos">@molobrakos</a>)</li>
<li><a href="/components/vera/">Vera</a> now uses subscription to states instead of polling (<a href="https://github.com/pavoni">@pavoni</a>)</li> <li><a href="/components/vera/">Vera</a> now uses subscription to states instead of polling (<a href="https://github.com/pavoni">@pavoni</a>)</li>
<li>New <a href="/topics/templating/#home-assistant-template-extensions">template helper method</a> <code>is_state_attr(entity_id, name, value)</code> added (<a href="https://github.com/andythigpen">@andythigpen</a>)</li> <li>New <a href="/topics/templating/#home-assistant-template-extensions">template helper method</a> <code class="highlighter-rouge">is_state_attr(entity_id, name, value)</code> added (<a href="https://github.com/andythigpen">@andythigpen</a>)</li>
<li>Device tracker: <a href="/components/device_tracker.owntracks/">OwnTracks</a> transition events now supported (<a href="https://github.com/xifle">@xifle</a>)</li> <li>Device tracker: <a href="/components/device_tracker.owntracks/">OwnTracks</a> transition events now supported (<a href="https://github.com/xifle">@xifle</a>)</li>
<li>Light: <a href="/components/light.hue/">Philips Hue</a> platform now supports multiple hubs (<a href="https://github.com/rhooper">@rhooper</a>)</li> <li>Light: <a href="/components/light.hue/">Philips Hue</a> platform now supports multiple hubs (<a href="https://github.com/rhooper">@rhooper</a>)</li>
<li>Notify: <a href="/components/notify.free_mobile/">Free Mobile</a> platform added (<a href="https://github.com/HydrelioxGitHub">@HydrelioxGitHub</a>)</li> <li>Notify: <a href="/components/notify.free_mobile/">Free Mobile</a> platform added (<a href="https://github.com/HydrelioxGitHub">@HydrelioxGitHub</a>)</li>
@ -138,7 +138,7 @@
<h3>Backwards incompatible changes</h3> <h3>Backwards incompatible changes</h3>
<ul> <ul>
<li>The <a href="/components/binary_sensor.rpi_gpio/">RPi.GPIO sensor platform</a> has been moved to the <code>binary_sensor</code> component.</li> <li>The <a href="/components/binary_sensor.rpi_gpio/">RPi.GPIO sensor platform</a> has been moved to the <code class="highlighter-rouge">binary_sensor</code> component.</li>
<li><a href="/components/sensor.mysensors/">MySensors sensor platform</a> now requires the <a href="/components/mysensors/">MySensors</a> component to be configured.</li> <li><a href="/components/sensor.mysensors/">MySensors sensor platform</a> now requires the <a href="/components/mysensors/">MySensors</a> component to be configured.</li>
<li>Geofancy platform has been renamed to <a href="/components/device_tracker.locative/">Locative</a>.</li> <li>Geofancy platform has been renamed to <a href="/components/device_tracker.locative/">Locative</a>.</li>
</ul> </ul>
@ -215,7 +215,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/internet-of-things/'>Internet-of-Things</a></li> <li>Internet-of-Things</li>
</ul> </ul>
@ -116,7 +116,7 @@
<p>Yes, you can solve this with presence detection. What if your phone runs out of battery? Youll have to resort to the switch again.</p> <p>Yes, you can solve this with presence detection. What if your phone runs out of battery? Youll have to resort to the switch again.</p>
<p>If you find that using your new home devices is cumbersome, the promise of home automation technology has failed you. Your lights should work with both a switch (or button) at the entrance of your room and via presence detection. Honestly, there are hardly any valid use cases for being able to control lights from your phone except for showing off.<br /> <p>If you find that using your new home devices is cumbersome, the promise of home automation technology has failed you. Your lights should work with both a switch (or button) at the entrance of your room and via presence detection. Honestly, there are hardly any valid use cases for being able to control lights from your phone except for showing off.
<a name="read-more"></a></p> <a name="read-more"></a></p>
<h3><a class="title-link" name="you-are-not-the-only-user-of-your-home-automation" href="#you-are-not-the-only-user-of-your-home-automation"></a> You are not the only user of your home automation.</h3> <h3><a class="title-link" name="you-are-not-the-only-user-of-your-home-automation" href="#you-are-not-the-only-user-of-your-home-automation"></a> You are not the only user of your home automation.</h3>
@ -219,7 +219,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -131,12 +131,12 @@ Example of the new views in the frontend. <a href="/components/group/">Learn mor
<li><a href="/components/insteon_hub/">Insteon hub</a> support added (<a href="https://github.com/FreekingDean">@FreekingDean</a>)</li> <li><a href="/components/insteon_hub/">Insteon hub</a> support added (<a href="https://github.com/FreekingDean">@FreekingDean</a>)</li>
<li><a href="/components/statsd/">Statsd</a> component added (<a href="https://github.com/michaelkuty">@michaelkuty</a>)</li> <li><a href="/components/statsd/">Statsd</a> component added (<a href="https://github.com/michaelkuty">@michaelkuty</a>)</li>
<li>Light: <a href="/components/light.rfxtrx/">Rfxtrx</a> platform now supports dimming (<a href="https://github.com/turbokongen">@turbokongen</a>)</li> <li>Light: <a href="/components/light.rfxtrx/">Rfxtrx</a> platform now supports dimming (<a href="https://github.com/turbokongen">@turbokongen</a>)</li>
<li>Time scheduling (including <a href="/getting-started/automation-trigger/#time-trigger">time automation</a>) now works with intervals (ie. <code>/5</code>) (<a href="https://github.com/kennedyshead">@kennedyshead</a>)</li> <li>Time scheduling (including <a href="/getting-started/automation-trigger/#time-trigger">time automation</a>) now works with intervals (ie. <code class="highlighter-rouge">/5</code>) (<a href="https://github.com/kennedyshead">@kennedyshead</a>)</li>
<li>Sensor: <a href="/components/sensor.onewire/">onewire</a> support added (<a href="https://github.com/deisi">@deisi</a>)</li> <li>Sensor: <a href="/components/sensor.onewire/">onewire</a> support added (<a href="https://github.com/deisi">@deisi</a>)</li>
<li><a href="/components/zigbee/">Zigbee</a> support added (<a href="https://github.com/flyte">@flyte</a>)</li> <li><a href="/components/zigbee/">Zigbee</a> support added (<a href="https://github.com/flyte">@flyte</a>)</li>
<li>Device Tracker: <a href="/components/device_tracker.owntracks/">OwnTracks</a> can now track iBeacons (<a href="https://github.com/pavoni">@pavoni</a>)</li> <li>Device Tracker: <a href="/components/device_tracker.owntracks/">OwnTracks</a> can now track iBeacons (<a href="https://github.com/pavoni">@pavoni</a>)</li>
<li>Notify: <a href="/components/notify.google_voice/">Google Voice SMS</a> platform added (<a href="https://github.com/w1ll1am23">@w1ll1am23</a>)</li> <li>Notify: <a href="/components/notify.google_voice/">Google Voice SMS</a> platform added (<a href="https://github.com/w1ll1am23">@w1ll1am23</a>)</li>
<li>Toggle service added to <code>homeassistant</code>, <code>switch</code>, <code>light</code> and <code>media_player</code> (<a href="https://github.com/rmkraus">@rmkraus</a>)</li> <li>Toggle service added to <code class="highlighter-rouge">homeassistant</code>, <code class="highlighter-rouge">switch</code>, <code class="highlighter-rouge">light</code> and <code class="highlighter-rouge">media_player</code> (<a href="https://github.com/rmkraus">@rmkraus</a>)</li>
<li><a href="/components/thermostat/">Thermostat</a> services added to control fans (<a href="https://github.com/auchter">@auchter</a>)</li> <li><a href="/components/thermostat/">Thermostat</a> services added to control fans (<a href="https://github.com/auchter">@auchter</a>)</li>
<li>Improved Python automation: Event helpers are now also available as decorators for custom components (<a href="https://github.com/rmkraus">@rmkraus</a>)</li> <li>Improved Python automation: Event helpers are now also available as decorators for custom components (<a href="https://github.com/rmkraus">@rmkraus</a>)</li>
<li>Frontend: support added for tabs to show <a href="/components/group/">different views</a> of your house (<a href="https://github.com/balloob">@balloob</a>)</li> <li>Frontend: support added for tabs to show <a href="/components/group/">different views</a> of your house (<a href="https://github.com/balloob">@balloob</a>)</li>
@ -221,7 +221,7 @@ Example of the new views in the frontend. <a href="/components/group/">Learn mor
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -12,12 +12,12 @@
<meta name="description" content="Jer and St. John describe how they connected SmartThings with Home Assistant."> <meta name="description" content="Jer and St. John describe how they connected SmartThings with Home Assistant.">
<meta name="viewport" content="width=device-width"> <meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/blog/2016/02/09/smarter-smart-things-with-mqtt-and-home-assistant/"> <link rel="canonical" href="https://home-assistant.io/blog/2016/02/09/Smarter-Smart-Things-with-MQTT-and-Home-Assistant/">
<meta property="fb:app_id" content="338291289691179"> <meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Smarter SmartThings with MQTT and Home Assistant"> <meta property="og:title" content="Smarter SmartThings with MQTT and Home Assistant">
<meta property="og:site_name" content="Home Assistant"> <meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/blog/2016/02/09/smarter-smart-things-with-mqtt-and-home-assistant/"> <meta property="og:url" content="https://home-assistant.io/blog/2016/02/09/Smarter-Smart-Things-with-MQTT-and-Home-Assistant/">
<meta property="og:type" content="article"> <meta property="og:type" content="article">
<meta property="og:description" content="Jer and St. John describe how they connected SmartThings with Home Assistant."> <meta property="og:description" content="Jer and St. John describe how they connected SmartThings with Home Assistant.">
<meta property="og:image" content="https://home-assistant.io/images/blog/2016-02-smartthings/social.png"> <meta property="og:image" content="https://home-assistant.io/images/blog/2016-02-smartthings/social.png">
@ -87,15 +87,15 @@
<div class="meta clearfix"> <div class="meta clearfix">
<time datetime="2016-02-09T07:44:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> February 09, 2016</time> <time datetime="2016-02-09T07:44:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> February 09, 2016</time>
<span class="byline author vcard"><i class='icon-user'></i> Jeremiah Wuenschel and St. John Johnson</span> <span class="byline author vcard"><i class='icon-user'></i> Jeremiah Wuenschel and St. John Johnson</span>
<span><i class='icon-time'></i> eight minutes reading time</span> <span><i class='icon-time'></i> nine minutes reading time</span>
<span> <span>
<i class="icon-tags"></i> <i class="icon-tags"></i>
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/how-to/'>How-To</a></li> <li>How-To</li>
<li><a class='category' href='/blog/categories/mqtt/'>MQTT</a></li> <li>MQTT</li>
</ul> </ul>
@ -141,18 +141,16 @@
<p>There is very little you need to do to get Mosca running. The easiest approach is to use <a href="https://www.docker.com/">Docker</a>, and run a command like the following:</p> <p>There is very little you need to do to get Mosca running. The easiest approach is to use <a href="https://www.docker.com/">Docker</a>, and run a command like the following:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>docker run <span class="se">\</span>
<div class="code"><pre>$ docker run \ -d <span class="se">\</span>
-d \ --name<span class="o">=</span><span class="s2">"mqtt"</span> <span class="se">\</span>
--name=&quot;mqtt&quot; \ -v /opt/mosca:/db <span class="se">\</span>
-v /opt/mosca:/db \ -p 1883:1883 <span class="se">\</span>
-p 1883:1883 \
matteocollina/mosca matteocollina/mosca
</pre></div> </code></pre>
</div>
</div> </div>
<p>This will start Mosca up inside of a docker container, while keeping persistent storage for Mosca in <code>/opt/mosca</code>. The default configuration is the only thing we need to get things up and running.</p> <p>This will start Mosca up inside of a docker container, while keeping persistent storage for Mosca in <code class="highlighter-rouge">/opt/mosca</code>. The default configuration is the only thing we need to get things up and running.</p>
<p>If you dont want to mess with Docker and can get node.js installed without trouble, the <a href="https://github.com/mcollina/mosca#standalone">standalone</a> instructions are all you need.</p> <p>If you dont want to mess with Docker and can get node.js installed without trouble, the <a href="https://github.com/mcollina/mosca#standalone">standalone</a> instructions are all you need.</p>
@ -160,44 +158,38 @@
<p>This is the small piece of magic that bridges the gap between MQTT and SmartThings. It is a node.js app, and like Mosca it is probably easiest to install with Docker:</p> <p>This is the small piece of magic that bridges the gap between MQTT and SmartThings. It is a node.js app, and like Mosca it is probably easiest to install with Docker:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>docker run <span class="se">\</span>
<div class="code"><pre>$ docker run \ -d <span class="se">\</span>
-d \ --name<span class="o">=</span><span class="s2">"mqtt-bridge"</span> <span class="se">\</span>
--name=&quot;mqtt-bridge&quot; \ -v /opt/mqtt-bridge:/config <span class="se">\</span>
-v /opt/mqtt-bridge:/config \ -p 8080:8080 <span class="se">\</span>
-p 8080:8080 \
stjohnjohnson/smartthings-mqtt-bridge stjohnjohnson/smartthings-mqtt-bridge
</pre></div> </code></pre>
</div>
</div> </div>
<p>The code for this bridge is <a href="https://github.com/stjohnjohnson/smartthings-mqtt-bridge">on Github</a> if you want to start it up independently.</p> <p>The code for this bridge is <a href="https://github.com/stjohnjohnson/smartthings-mqtt-bridge">on Github</a> if you want to start it up independently.</p>
<p>The MQTT Bridge only needs to know where your MQTT broker lives. If you are using these docker commands as-is, edit <code>/opt/mqtt-bridge/config.yml</code> to look like this:</p> <p>The MQTT Bridge only needs to know where your MQTT broker lives. If you are using these docker commands as-is, edit <code class="highlighter-rouge">/opt/mqtt-bridge/config.yml</code> to look like this:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="nn">---</span>
<div class="code"><pre><span class="head"><span class="head">---</span></span> <span class="s">mqtt</span><span class="pi">:</span>
<span class="key">mqtt</span>: <span class="s">host</span><span class="pi">:</span> <span class="s">&lt;IP of the host&gt;</span>
<span class="key">host</span>: <span class="string"><span class="content">&lt;IP of the host&gt;</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p>Restart the bridge, and you are ready to go:</p> <p>Restart the bridge, and you are ready to go:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>docker restart mqtt-bridge
<div class="code"><pre>$ docker restart mqtt-bridge </code></pre>
</pre></div>
</div>
</div> </div>
<h3>SmartThings Device</h3> <h3>SmartThings Device</h3>
<p>The next step (and possibly the most confusing) is the device type. Go to the <a href="https://graph.api.smartthings.com/ide/devices">Smart Things Device IDE</a> and <code>Create New Device Handler</code>. Choose <code>From Code</code> and paste in the <a href="https://github.com/stjohnjohnson/smartthings-mqtt-bridge/blob/master/devicetypes/stj/mqtt-bridge.src/mqtt-bridge.groovy">MQTT Bridge Device Code</a>. Click <code>Save</code>, <code>Publish</code>, and then <code>For Me</code>.</p> <p>The next step (and possibly the most confusing) is the device type. Go to the <a href="https://graph.api.smartthings.com/ide/devices">Smart Things Device IDE</a> and <code class="highlighter-rouge">Create New Device Handler</code>. Choose <code class="highlighter-rouge">From Code</code> and paste in the <a href="https://github.com/stjohnjohnson/smartthings-mqtt-bridge/blob/master/devicetypes/stj/mqtt-bridge.src/mqtt-bridge.groovy">MQTT Bridge Device Code</a>. Click <code class="highlighter-rouge">Save</code>, <code class="highlighter-rouge">Publish</code>, and then <code class="highlighter-rouge">For Me</code>.</p>
<p>Now to install your new Device Handler. Go back to <code>My Devices</code> in the IDE, and click <code>New Device</code>. Enter a name, and pick any random set of characters for the Device Network Id (this will automatically update later). For Type, scroll to the bottom of the list and find your newly created <code>MQTT Bridge</code>. Fill in the other boxes however you like.</p> <p>Now to install your new Device Handler. Go back to <code class="highlighter-rouge">My Devices</code> in the IDE, and click <code class="highlighter-rouge">New Device</code>. Enter a name, and pick any random set of characters for the Device Network Id (this will automatically update later). For Type, scroll to the bottom of the list and find your newly created <code class="highlighter-rouge">MQTT Bridge</code>. Fill in the other boxes however you like.</p>
<p>Go back to <code>My Devices</code>, and click on your new device in the list. This will bring up a page that allows you to edit your devices Preferences. Click <code>edit</code> and fill in the 3 pieces of information it asks for.</p> <p>Go back to <code class="highlighter-rouge">My Devices</code>, and click on your new device in the list. This will bring up a page that allows you to edit your devices Preferences. Click <code class="highlighter-rouge">edit</code> and fill in the 3 pieces of information it asks for.</p>
<ul> <ul>
<li>MQTT Bridge IP Address: &lt;IP address of the MQTT Bridge from the previous step&gt;</li> <li>MQTT Bridge IP Address: &lt;IP address of the MQTT Bridge from the previous step&gt;</li>
@ -211,20 +203,18 @@
<p>The last step is to setup the SmartApp. After this, any registered devices will start sending their events to MQTT.</p> <p>The last step is to setup the SmartApp. After this, any registered devices will start sending their events to MQTT.</p>
<p>Go to the <a href="https://graph.api.smartthings.com/ide/apps">Smart App IDE</a>. Click <code>New SmartApp</code>, followed by <code>From Code</code>. Paste in the <a href="https://github.com/stjohnjohnson/smartthings-mqtt-bridge/blob/master/smartapps/stj/mqtt-bridge.src/mqtt-bridge.groovy">MQTT Bridge SmartApp code</a> and click <code>Save</code>. Click <code>Publish</code> and then <code>For Me</code>. In the SmartThings mobile app, add the new SmartApp and configure it with your devices and MQTT Bridge device. Clicking <code>done</code> will subscribe SmartThings to your MQTT broker and begin 2-way propagation of events.</p> <p>Go to the <a href="https://graph.api.smartthings.com/ide/apps">Smart App IDE</a>. Click <code class="highlighter-rouge">New SmartApp</code>, followed by <code class="highlighter-rouge">From Code</code>. Paste in the <a href="https://github.com/stjohnjohnson/smartthings-mqtt-bridge/blob/master/smartapps/stj/mqtt-bridge.src/mqtt-bridge.groovy">MQTT Bridge SmartApp code</a> and click <code class="highlighter-rouge">Save</code>. Click <code class="highlighter-rouge">Publish</code> and then <code class="highlighter-rouge">For Me</code>. In the SmartThings mobile app, add the new SmartApp and configure it with your devices and MQTT Bridge device. Clicking <code class="highlighter-rouge">done</code> will subscribe SmartThings to your MQTT broker and begin 2-way propagation of events.</p>
<h3>Configure Home Assistant</h3> <h3>Configure Home Assistant</h3>
<p>To add SmartThings devices to Home Assistant over MQTT, first enable MQTT in Home Assistant:</p> <p>To add SmartThings devices to Home Assistant over MQTT, first enable MQTT in Home Assistant:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">mqtt</span><span class="pi">:</span>
<div class="code"><pre><span class="key">mqtt</span>: <span class="s">broker</span><span class="pi">:</span> <span class="s">localhost</span>
<span class="key">broker</span>: <span class="string"><span class="content">localhost</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p>Replace <code>localhost</code> with the location of the running MQTT Broker. Devices from the MQTT Bridge are published to the path <code>smartthings/&lt;Device Name&gt;/&lt;Atribute&gt;</code></p> <p>Replace <code class="highlighter-rouge">localhost</code> with the location of the running MQTT Broker. Devices from the MQTT Bridge are published to the path <code class="highlighter-rouge">smartthings/&lt;Device Name&gt;/&lt;Atribute&gt;</code></p>
<p>For example, my Dimmer Z-Wave Lamp is called “Fireplace Lights” in SmartThings. The following topics are published:</p> <p>For example, my Dimmer Z-Wave Lamp is called “Fireplace Lights” in SmartThings. The following topics are published:</p>
@ -249,55 +239,51 @@
<p>Here is an example Home Assistant config:</p> <p>Here is an example Home Assistant config:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">switch</span><span class="pi">:</span>
<div class="code"><pre><span class="key">switch</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">mqtt</span>
<span class="key">platform</span>: <span class="string"><span class="content">mqtt</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s2">"</span><span class="s">Fireplace</span><span class="nv"> </span><span class="s">Lights"</span>
<span class="key">name</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Fireplace Lights</span><span class="delimiter">&quot;</span></span> <span class="s">state_topic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">smartthings/Fireplace</span><span class="nv"> </span><span class="s">Lights/switch"</span>
<span class="key">state_topic</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">smartthings/Fireplace Lights/switch</span><span class="delimiter">&quot;</span></span> <span class="s">command_topic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">smartthings/Fireplace</span><span class="nv"> </span><span class="s">Lights/switch"</span>
<span class="key">command_topic</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">smartthings/Fireplace Lights/switch</span><span class="delimiter">&quot;</span></span> <span class="s">brightness_state_topic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">smartthings/Fireplace</span><span class="nv"> </span><span class="s">Lights/level"</span>
<span class="key">brightness_state_topic</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">smartthings/Fireplace Lights/level</span><span class="delimiter">&quot;</span></span> <span class="s">brightness_command_topic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">smartthings/Fireplace</span><span class="nv"> </span><span class="s">Lights/level"</span>
<span class="key">brightness_command_topic</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">smartthings/Fireplace Lights/level</span><span class="delimiter">&quot;</span></span> <span class="s">payload_on</span><span class="pi">:</span> <span class="s2">"</span><span class="s">on"</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="s">payload_off</span><span class="pi">:</span> <span class="s2">"</span><span class="s">off"</span>
<span class="key">payload_off</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">off</span><span class="delimiter">&quot;</span></span> <span class="s">retain</span><span class="pi">:</span> <span class="s">true</span>
<span class="key">retain</span>: <span class="string"><span class="content">true</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p>We recommend <code>retain: true</code> for every MQTT device in order to keep states in sync when things become disconnected.</p> <p>We recommend <code class="highlighter-rouge">retain: true</code> for every MQTT device in order to keep states in sync when things become disconnected.</p>
<p>Start digging through the <a href="/components/mqtt/">MQTT Components</a> in Home Assistant to find which components map to the new events being published to MQTT.</p> <p>Start digging through the <a href="/components/mqtt/">MQTT Components</a> in Home Assistant to find which components map to the new events being published to MQTT.</p>
<h3>Configuring with Docker-Compose</h3> <h3>Configuring with Docker-Compose</h3>
<p>Our personal preference for starting the whole suite of software is to use a single Docker-Compose file. Just create a file called <code>docker-compose.yml</code> like this:</p> <p>Our personal preference for starting the whole suite of software is to use a single Docker-Compose file. Just create a file called <code class="highlighter-rouge">docker-compose.yml</code> like this:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">mqtt</span><span class="pi">:</span>
<div class="code"><pre><span class="key">mqtt</span>: <span class="s">image</span><span class="pi">:</span> <span class="s">matteocollina/mosca</span>
<span class="key">image</span>: <span class="string"><span class="content">matteocollina/mosca</span></span> <span class="s">ports</span><span class="pi">:</span>
<span class="key">ports</span>: <span class="pi">-</span> <span class="s">1883:1883</span>
- <span class="string"><span class="content">1883:1883</span></span>
<span class="key">mqttbridge</span>: <span class="s">mqttbridge</span><span class="pi">:</span>
<span class="key">image</span>: <span class="string"><span class="content">stjohnjohnson/smartthings-mqtt-bridge</span></span> <span class="s">image</span><span class="pi">:</span> <span class="s">stjohnjohnson/smartthings-mqtt-bridge</span>
<span class="key">volumes</span>: <span class="s">volumes</span><span class="pi">:</span>
- <span class="string"><span class="content">./mqtt-bridge:/config</span></span> <span class="pi">-</span> <span class="s">./mqtt-bridge:/config</span>
<span class="key">ports</span>: <span class="s">ports</span><span class="pi">:</span>
- <span class="string"><span class="content">8080:8080</span></span> <span class="pi">-</span> <span class="s">8080:8080</span>
<span class="key">links</span>: <span class="s">links</span><span class="pi">:</span>
- <span class="string"><span class="content">mqtt</span></span> <span class="pi">-</span> <span class="s">mqtt</span>
<span class="key">homeassistant</span>: <span class="s">homeassistant</span><span class="pi">:</span>
<span class="key">image</span>: <span class="string"><span class="content">homeassistant/home-assistant:latest</span></span> <span class="s">image</span><span class="pi">:</span> <span class="s">homeassistant/home-assistant:latest</span>
<span class="key">ports</span>: <span class="s">ports</span><span class="pi">:</span>
- <span class="string"><span class="content">80:80</span></span> <span class="pi">-</span> <span class="s">80:80</span>
<span class="key">volumes</span>: <span class="s">volumes</span><span class="pi">:</span>
- <span class="string"><span class="content">./home-assistant:/config</span></span> <span class="pi">-</span> <span class="s">./home-assistant:/config</span>
- <span class="string"><span class="content">/etc/localtime:/etc/localtime:ro</span></span> <span class="pi">-</span> <span class="s">/etc/localtime:/etc/localtime:ro</span>
<span class="key">links</span>: <span class="s">links</span><span class="pi">:</span>
- <span class="string"><span class="content">mqtt</span></span> <span class="pi">-</span> <span class="s">mqtt</span>
</pre></div> </code></pre>
</div>
</div> </div>
<p>This will start home-assistant, MQTT, and the Bridge, in dependency order. All config can reference the name of the docker container instead of using IP addresses (e.g. mqtt for the broker host in Home Assistant).</p> <p>This will start home-assistant, MQTT, and the Bridge, in dependency order. All config can reference the name of the docker container instead of using IP addresses (e.g. mqtt for the broker host in Home Assistant).</p>
@ -308,12 +294,10 @@
<p><strong>Custom Device Type:</strong> SmartThings custom device types allow developers to define handlers for HTTP events received directly over the local network by the SmartThings hub. Messages received are authenticated by MAC address, and can contain arbitrary strings in their payload. Since a Device Type is only ever tied to a single device, we need to add a SmartApp to the mix in order to translate events between individual devices and our special Home Assistant Bridge device. Here is what we have so far:</p> <p><strong>Custom Device Type:</strong> SmartThings custom device types allow developers to define handlers for HTTP events received directly over the local network by the SmartThings hub. Messages received are authenticated by MAC address, and can contain arbitrary strings in their payload. Since a Device Type is only ever tied to a single device, we need to add a SmartApp to the mix in order to translate events between individual devices and our special Home Assistant Bridge device. Here is what we have so far:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-text highlighter-rouge"><pre class="highlight"><code>Z-Wave Switch |
<div class="code"><pre>Z-Wave Switch |
Zigbee motion sensor |&lt;---&gt; Bridge App &lt;---&gt; Bridge Device Type &lt;---&gt; &lt;Local network&gt; Zigbee motion sensor |&lt;---&gt; Bridge App &lt;---&gt; Bridge Device Type &lt;---&gt; &lt;Local network&gt;
Z-Wave light bulb | Z-Wave light bulb |
</pre></div> </code></pre>
</div>
</div> </div>
<p>On the Home Assistant side, there is a powerful platform available based on the MQTT lightweight message bus protocol. Everything from lights to switches to temperature sensors can be defined in Home Assistant as an MQTT component, so it makes for a convenient integration point. This requires an MQTT broker for handling the message bus, and one last piece to translate between the HTTP that SmartThings supports and MQTT.</p> <p>On the Home Assistant side, there is a powerful platform available based on the MQTT lightweight message bus protocol. Everything from lights to switches to temperature sensors can be defined in Home Assistant as an MQTT component, so it makes for a convenient integration point. This requires an MQTT broker for handling the message bus, and one last piece to translate between the HTTP that SmartThings supports and MQTT.</p>
@ -375,12 +359,12 @@ Z-Wave light bulb |
class="twitter-share-button" class="twitter-share-button"
data-via="home_assistant" data-via="home_assistant"
data-related="home_assistant" data-related="home_assistant"
data-url="https://home-assistant.io/blog/2016/02/09/smarter-smart-things-with-mqtt-and-home-assistant/" data-url="https://home-assistant.io/blog/2016/02/09/Smarter-Smart-Things-with-MQTT-and-Home-Assistant/"
data-counturl="https://home-assistant.io/blog/2016/02/09/smarter-smart-things-with-mqtt-and-home-assistant/" >Tweet</a> data-counturl="https://home-assistant.io/blog/2016/02/09/Smarter-Smart-Things-with-MQTT-and-Home-Assistant/" >Tweet</a>
<div class="fb-share-button" style='top: -6px;' <div class="fb-share-button" style='top: -6px;'
data-href="https://home-assistant.io/blog/2016/02/09/smarter-smart-things-with-mqtt-and-home-assistant/" data-href="https://home-assistant.io/blog/2016/02/09/Smarter-Smart-Things-with-MQTT-and-Home-Assistant/"
data-layout="button_count"> data-layout="button_count">
</div> </div>
@ -408,7 +392,7 @@ Z-Wave light bulb |
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>
@ -466,8 +450,8 @@ Z-Wave light bulb |
// var disqus_developer = 1; // var disqus_developer = 1;
var disqus_identifier = 'https://home-assistant.io/blog/2016/02/09/smarter-smart-things-with-mqtt-and-home-assistant/'; var disqus_identifier = 'https://home-assistant.io/blog/2016/02/09/Smarter-Smart-Things-with-MQTT-and-Home-Assistant/';
var disqus_url = 'https://home-assistant.io/blog/2016/02/09/smarter-smart-things-with-mqtt-and-home-assistant/'; var disqus_url = 'https://home-assistant.io/blog/2016/02/09/Smarter-Smart-Things-with-MQTT-and-Home-Assistant/';
var disqus_script = 'embed.js'; var disqus_script = 'embed.js';
(function () { (function () {

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/internet-of-things/'>Internet-of-Things</a></li> <li>Internet-of-Things</li>
</ul> </ul>
@ -167,7 +167,7 @@
</tr> </tr>
</table> </table>
<p>The background to how we got to these classifiers can be read after the break.<br /> <p>The background to how we got to these classifiers can be read after the break.
<a name="read-more"></a></p> <a name="read-more"></a></p>
<h2><a class="title-link" name="state" href="#state"></a> State</h2> <h2><a class="title-link" name="state" href="#state"></a> State</h2>
@ -358,7 +358,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -224,7 +224,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/how-to/'>How-To</a></li> <li>How-To</li>
</ul> </ul>
@ -138,120 +138,102 @@
<h3>core.conf</h3> <h3>core.conf</h3>
<p>The core configuration is shared between all instances:</p> <p>The core configuration is shared between all instances:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-conf highlighter-rouge"><pre class="highlight"><code>[<span class="n">mpd</span>]
<div class="code"><pre>[mpd] <span class="n">hostname</span> = ::
hostname = ::
[http] [<span class="n">http</span>]
hostname = :: <span class="n">hostname</span> = ::
[audio] [<span class="n">audio</span>]
output = alsasink <span class="n">output</span> = <span class="n">alsasink</span>
[spotify] [<span class="n">spotify</span>]
username = &lt;redacted&gt; <span class="n">username</span> = &lt;<span class="n">redacted</span>&gt;
password = &lt;redacted&gt; <span class="n">password</span> = &lt;<span class="n">redacted</span>&gt;
</pre></div> </code></pre>
</div>
</div> </div>
<h3>local.conf</h3> <h3>local.conf</h3>
<p>Add the local configuration on computers that have local media files:</p> <p>Add the local configuration on computers that have local media files:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-conf highlighter-rouge"><pre class="highlight"><code>[<span class="n">local</span>]
<div class="code"><pre>[local] <span class="n">media_dir</span> = &lt;<span class="n">your</span>/<span class="n">music</span>/<span class="n">here</span>&gt;
media_dir = &lt;your/music/here&gt; </code></pre>
</pre></div>
</div>
</div> </div>
<h3>snapcast.conf</h3> <h3>snapcast.conf</h3>
<p>Finally, the Mopidy instance that connects with Snapcast needs special configuration. Run on a different port to avoid conflicts if you have a second Mopidy instance running on your computer. The audio output is sent to a named pipe - Snapcast will read from there. Note that you may have to adjust the audio output attribute depending on your system and audio sources.</p> <p>Finally, the Mopidy instance that connects with Snapcast needs special configuration. Run on a different port to avoid conflicts if you have a second Mopidy instance running on your computer. The audio output is sent to a named pipe - Snapcast will read from there. Note that you may have to adjust the audio output attribute depending on your system and audio sources.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-conf highlighter-rouge"><pre class="highlight"><code>[<span class="n">mpd</span>]
<div class="code"><pre>[mpd] <span class="n">hostname</span> = ::
hostname = :: <span class="n">port</span> = <span class="m">6601</span>
port = 6601
[http] [<span class="n">http</span>]
hostname = :: <span class="n">hostname</span> = ::
port = 6681 <span class="n">port</span> = <span class="m">6681</span>
[audio] [<span class="n">audio</span>]
output = audioresample ! audio/x-raw,rate=48000,channels=2,format=S16LE ! audioconvert ! wavenc ! filesink location=/tmp/snapfifo <span class="n">output</span> = <span class="n">audioresample</span> ! <span class="n">audio</span>/<span class="n">x</span>-<span class="n">raw</span>,<span class="n">rate</span>=<span class="m">48000</span>,<span class="n">channels</span>=<span class="m">2</span>,<span class="n">format</span>=<span class="n">S16LE</span> ! <span class="n">audioconvert</span> ! <span class="n">wavenc</span> ! <span class="n">filesink</span> <span class="n">location</span>=/<span class="n">tmp</span>/<span class="n">snapfifo</span>
</pre></div> </code></pre>
</div>
</div> </div>
<h2>Run Mopidy</h2> <h2>Run Mopidy</h2>
<p>To run a room-specific instance:</p> <p>To run a room-specific instance:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>mopidy --config <span class="nv">$CONF_DIR</span>/core.conf
<div class="code"><pre>$ mopidy --config $CONF_DIR/core.conf </code></pre>
</pre></div>
</div>
</div> </div>
<p>To run a room-specific instance with local media:</p> <p>To run a room-specific instance with local media:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>mopidy --config <span class="nv">$CONF_DIR</span>/core.conf:<span class="nv">$CONF_DIR</span>/local.conf
<div class="code"><pre>$ mopidy --config $CONF_DIR/core.conf:$CONF_DIR/local.conf </code></pre>
</pre></div>
</div>
</div> </div>
<p>To run the special Snapcast-connected instance (with local media):</p> <p>To run the special Snapcast-connected instance (with local media):</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>mopidy --config <span class="nv">$CONF_DIR</span>/core.conf:<span class="nv">$CONF_DIR</span>/local.conf:<span class="nv">$CONF_DIR</span>/snapcast.conf
<div class="code"><pre>$ mopidy --config $CONF_DIR/core.conf:$CONF_DIR/local.conf:$CONF_DIR/snapcast.conf </code></pre>
</pre></div>
</div>
</div> </div>
<h2>Run Snapcast</h2> <h2>Run Snapcast</h2>
<p>Start the <code>snapserver</code> on the same server running Mopidy with the snapcast configuration.</p> <p>Start the <code class="highlighter-rouge">snapserver</code> on the same server running Mopidy with the snapcast configuration.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>snapserver <span class="c"># or use systemd</span>
<div class="code"><pre>$ snapserver # or use systemd </code></pre>
</pre></div>
</div>
</div> </div>
<p>Start the <code>snapclient</code> on computers that will be playing audio.</p> <p>Start the <code class="highlighter-rouge">snapclient</code> on computers that will be playing audio.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>snapclient <span class="c"># or use systemd, add -h &lt;server host&gt; if necessary</span>
<div class="code"><pre>$ snapclient # or use systemd, add -h &lt;server host&gt; if necessary </code></pre>
</pre></div>
</div>
</div> </div>
<h2>Configure Snapcast</h2> <h2>Configure Snapcast</h2>
<p>There are a number of snapcast configuration options, but the one relevant to Home Assistant is the client names. You can set them in the snapserver configuration file, by default located at <code>~/.config/Snapcast/settings.json</code>. Only edit this file while the <code>snapserver</code> is not running. Modify the <code>name</code> JSON value to your liking - this is how the client will be named in Home Assistant.</p> <p>There are a number of snapcast configuration options, but the one relevant to Home Assistant is the client names. You can set them in the snapserver configuration file, by default located at <code class="highlighter-rouge">~/.config/Snapcast/settings.json</code>. Only edit this file while the <code class="highlighter-rouge">snapserver</code> is not running. Modify the <code class="highlighter-rouge">name</code> JSON value to your liking - this is how the client will be named in Home Assistant.</p>
<h2>Configure Home Assistant</h2> <h2>Configure Home Assistant</h2>
<p>Use the <a href="/components/media_player.mpd/">mpd</a> and <a href="/components/media_player.snapcast/">snapcast</a> components. Optionally, use <a href="/components/weblink/">weblink</a> to provide easy access to a Mopidy web UI.</p> <p>Use the <a href="/components/media_player.mpd/">mpd</a> and <a href="/components/media_player.snapcast/">snapcast</a> components. Optionally, use <a href="/components/weblink/">weblink</a> to provide easy access to a Mopidy web UI.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">media_player</span><span class="pi">:</span>
<div class="code"><pre><span class="key">media_player</span>: <span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">snapcast</span>
- <span class="string"><span class="content">platform: snapcast</span></span> <span class="s">host</span><span class="pi">:</span> <span class="s">xxxxx</span>
<span class="key">host</span>: <span class="string"><span class="content">xxxxx</span></span> <span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">mpd</span>
- <span class="string"><span class="content">platform: mpd</span></span> <span class="s">server</span><span class="pi">:</span> <span class="s">xxxx</span>
<span class="key">server</span>: <span class="string"><span class="content">xxxx</span></span> <span class="s">location</span><span class="pi">:</span> <span class="s">Multi-Room Controller</span>
<span class="key">location</span>: <span class="string"><span class="content">Multi-Room Controller</span></span> <span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">mpd</span>
- <span class="string"><span class="content">platform: mpd</span></span> <span class="s">server</span><span class="pi">:</span> <span class="s">xxx</span>
<span class="key">server</span>: <span class="string"><span class="content">xxx</span></span> <span class="s">location</span><span class="pi">:</span> <span class="s">Room 1</span>
<span class="key">location</span>: <span class="string"><span class="content">Room 1</span></span>
<span class="key">weblink</span>: <span class="s">weblink</span><span class="pi">:</span>
<span class="key">entities</span>: <span class="s">entities</span><span class="pi">:</span>
- <span class="string"><span class="content">name: Multi-Room Player</span></span> <span class="pi">-</span> <span class="s">name</span><span class="pi">:</span> <span class="s">Multi-Room Player</span>
<span class="key">url</span>: <span class="string"><span class="content">xxxx</span></span> <span class="s">url</span><span class="pi">:</span> <span class="s">xxxx</span>
</pre></div> </code></pre>
</div>
</div> </div>
</article> </article>
@ -326,7 +308,7 @@ output = audioresample ! audio/x-raw,rate=48000,channels=2,format=S16LE ! audioc
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,9 +93,9 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/community/'>Community</a></li> <li>Community</li>
<li><a class='category' href='/blog/categories/video/'>Video</a></li> <li>Video</li>
</ul> </ul>
@ -136,21 +136,19 @@
<p>Example config.json entry to load Home Assistant:</p> <p>Example config.json entry to load Home Assistant:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-json highlighter-rouge"><pre class="highlight"><code><span class="s2">"platforms"</span><span class="err">:</span><span class="w"> </span><span class="p">[</span><span class="w">
<div class="code"><pre><span class="key"><span class="delimiter">&quot;</span><span class="content">platforms</span><span class="delimiter">&quot;</span></span>: [ </span><span class="p">{</span><span class="w">
{ </span><span class="nt">"platform"</span><span class="p">:</span><span class="w"> </span><span class="s2">"HomeAssistant"</span><span class="p">,</span><span class="w">
<span class="key"><span class="delimiter">&quot;</span><span class="content">platform</span><span class="delimiter">&quot;</span></span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">HomeAssistant</span><span class="delimiter">&quot;</span></span>, </span><span class="nt">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"HomeAssistant"</span><span class="p">,</span><span class="w">
<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">HomeAssistant</span><span class="delimiter">&quot;</span></span>, </span><span class="nt">"host"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://192.168.1.50:8123"</span><span class="p">,</span><span class="w">
<span class="key"><span class="delimiter">&quot;</span><span class="content">host</span><span class="delimiter">&quot;</span></span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">http://192.168.1.50:8123</span><span class="delimiter">&quot;</span></span>, </span><span class="nt">"password"</span><span class="p">:</span><span class="w"> </span><span class="s2">"xxx"</span><span class="p">,</span><span class="w">
<span class="key"><span class="delimiter">&quot;</span><span class="content">password</span><span class="delimiter">&quot;</span></span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">xxx</span><span class="delimiter">&quot;</span></span>, </span><span class="nt">"supported_types"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"light"</span><span class="p">,</span><span class="w"> </span><span class="s2">"switch"</span><span class="p">,</span><span class="w"> </span><span class="s2">"media_player"</span><span class="p">,</span><span class="w"> </span><span class="s2">"scene"</span><span class="p">]</span><span class="w">
<span class="key"><span class="delimiter">&quot;</span><span class="content">supported_types</span><span class="delimiter">&quot;</span></span>: [<span class="string"><span class="delimiter">&quot;</span><span class="content">light</span><span class="delimiter">&quot;</span></span>, <span class="string"><span class="delimiter">&quot;</span><span class="content">switch</span><span class="delimiter">&quot;</span></span>, <span class="string"><span class="delimiter">&quot;</span><span class="content">media_player</span><span class="delimiter">&quot;</span></span>, <span class="string"><span class="delimiter">&quot;</span><span class="content">scene</span><span class="delimiter">&quot;</span></span>] </span><span class="p">}</span><span class="w">
} </span><span class="p">]</span><span class="w">
] </span></code></pre>
</pre></div>
</div>
</div> </div>
<p><a href="https://github.com/nfarina/homebridge">HomeBridge on GitHub</a><br /> <p><a href="https://github.com/nfarina/homebridge">HomeBridge on GitHub</a>
<a href="https://github.com/maddox/homebridge-homeassistant">HomeBridge Home Assistant Plugin</a></p> <a href="https://github.com/maddox/homebridge-homeassistant">HomeBridge Home Assistant Plugin</a></p>
<h3><a class="title-link" name="custom-alarm-system-with-home-assistant" href="#custom-alarm-system-with-home-assistant"></a> Custom alarm system with Home Assistant</h3> <h3><a class="title-link" name="custom-alarm-system-with-home-assistant" href="#custom-alarm-system-with-home-assistant"></a> Custom alarm system with Home Assistant</h3>
@ -234,7 +232,7 @@ Hold your NFC tag against the belly of Garfield to unlock the alarm.
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -121,7 +121,7 @@
<li>Sensor: <a href="/components/sensor.neurio_energy/">Neurio energy sensor</a> now supported (<a href="https://github.com/infamy">@infamy</a>)</li> <li>Sensor: <a href="/components/sensor.neurio_energy/">Neurio energy sensor</a> now supported (<a href="https://github.com/infamy">@infamy</a>)</li>
<li>Binary Sensor: <a href="/components/binary_sensor.nx584/">nx584</a> support added (<a href="https://github.com/kk7ds">@kk7ds</a>)</li> <li>Binary Sensor: <a href="/components/binary_sensor.nx584/">nx584</a> support added (<a href="https://github.com/kk7ds">@kk7ds</a>)</li>
<li>Improve and clarify CI testing (<a href="https://github.com/sdague">@sdague</a>)</li> <li>Improve and clarify CI testing (<a href="https://github.com/sdague">@sdague</a>)</li>
<li>Automation: State <a href="/getting-started/automation-trigger/#state-trigger">triggers</a> and <a href="/getting-started/automation-condition/#state-condition">conditions</a> now takes optional <code>for</code> config parameter to only trigger when a state hasnt changed for a certain period of time (<a href="https://github.com/pavoni">@pavoni</a>, <a href="https://github.com/stefan-jonasson">@stefan-jonasson</a>)</li> <li>Automation: State <a href="/getting-started/automation-trigger/#state-trigger">triggers</a> and <a href="/getting-started/automation-condition/#state-condition">conditions</a> now takes optional <code class="highlighter-rouge">for</code> config parameter to only trigger when a state hasnt changed for a certain period of time (<a href="https://github.com/pavoni">@pavoni</a>, <a href="https://github.com/stefan-jonasson">@stefan-jonasson</a>)</li>
<li>Sensor: <a href="/components/sensor.nest/">Nest</a> weather data added (<a href="https://github.com/w1ll1am23">@w1ll1am23</a>)</li> <li>Sensor: <a href="/components/sensor.nest/">Nest</a> weather data added (<a href="https://github.com/w1ll1am23">@w1ll1am23</a>)</li>
<li>Device Tracker: <a href="/components/device_tracker.unifi/">Ubiquiti Unifi</a> now supported (<a href="https://github.com/kk7ds">@kk7ds</a>)</li> <li>Device Tracker: <a href="/components/device_tracker.unifi/">Ubiquiti Unifi</a> now supported (<a href="https://github.com/kk7ds">@kk7ds</a>)</li>
<li>Binary Sensor: <a href="/components/binary_sensor.mysensors/">MySensors</a> now supported (<a href="https://github.com/MartinHjelmare">@MartinHjelmare</a>)</li> <li>Binary Sensor: <a href="/components/binary_sensor.mysensors/">MySensors</a> now supported (<a href="https://github.com/MartinHjelmare">@MartinHjelmare</a>)</li>
@ -147,7 +147,7 @@
<li>Component: Simple Alarm has been removed. Still available in <a href="https://home-assistant.io/cookbook/python_component_simple_alarm/">the cookbook</a>.</li> <li>Component: Simple Alarm has been removed. Still available in <a href="https://home-assistant.io/cookbook/python_component_simple_alarm/">the cookbook</a>.</li>
<li>Script: Turning on a <a href="/components/script/">script</a> that is already on is now a no-op instead of skipping current delay.</li> <li>Script: Turning on a <a href="/components/script/">script</a> that is already on is now a no-op instead of skipping current delay.</li>
<li>Wemo switches now have to be set up via the main <a href="/components/wemo/">Wemo component</a></li> <li>Wemo switches now have to be set up via the main <a href="/components/wemo/">Wemo component</a></li>
<li>Command line platforms for <a href="/components/switch.command_line/">switch</a>, <a href="/components/sensor.command_line/">sensor</a> and <a href="/components/binary_sensor.command_line/">binary_sensor</a> have been renamed to <code>command_line</code>.</li> <li>Command line platforms for <a href="/components/switch.command_line/">switch</a>, <a href="/components/sensor.command_line/">sensor</a> and <a href="/components/binary_sensor.command_line/">binary_sensor</a> have been renamed to <code class="highlighter-rouge">command_line</code>.</li>
<li>The rfxtrx sensors entity ids will incur a one time change to move to a stable format. See <a href="/components/sensor.rfxtrx/">the docs</a> for more details.</li> <li>The rfxtrx sensors entity ids will incur a one time change to move to a stable format. See <a href="/components/sensor.rfxtrx/">the docs</a> for more details.</li>
</ul> </ul>
</article> </article>
@ -223,7 +223,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -129,31 +129,29 @@
<li>Binary Sensor: Wemo Motion now supported (<a href="https://github.com/pavoni">@pavoni</a>, <a href="https://github.com/ryanlaux">@ryanlaux</a>)</li> <li>Binary Sensor: Wemo Motion now supported (<a href="https://github.com/pavoni">@pavoni</a>, <a href="https://github.com/ryanlaux">@ryanlaux</a>)</li>
</ul> </ul>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example using templates for service and data in service call.</span>
<div class="code"><pre><span class="comment"># Example using templates for service and data in service call.</span> <span class="c1"># Works for automation, Alexa, universal media player, template switch.</span>
<span class="comment"># Works for automation, Alexa, universal media player, template switch.</span> <span class="s">automation</span><span class="pi">:</span>
<span class="key">automation</span>: <span class="pi">-</span> <span class="s">trigger</span><span class="pi">:</span>
- <span class="string"><span class="content">trigger:</span><span class="content"> <span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">state</span>
- platform: state <span class="s">entity_id</span><span class="pi">:</span> <span class="s">switch.bathroom</span>
entity_id: switch.bathroom</span></span> <span class="s">action</span><span class="pi">:</span>
<span class="key">action</span>: <span class="s">service_template</span><span class="pi">:</span> <span class="pi">&gt;</span>
<span class="key">service_template</span>: <span class="string"><span class="delimiter">&gt;</span><span class="content"> <span class="no">{% if is_state('switch.bathroom', 'on') %}</span>
{% if is_state('switch.bathroom', 'on') %} <span class="no">switch.turn_on</span>
switch.turn_on <span class="no">{% else %}</span>
{% else %} <span class="no">switch.turn_off</span>
switch.turn_off <span class="no">{% endif %}</span>
{% endif %}</span></span> <span class="s">data_template</span><span class="pi">:</span>
<span class="key">data_template</span>: <span class="s">entity_id</span><span class="pi">:</span> <span class="s">switch.{{ states('input_select.is') }}</span>
<span class="key">entity_id</span>: <span class="string"><span class="content">switch.{{ states('input_select.is') }}</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<h3>Breaking Changes</h3> <h3>Breaking Changes</h3>
<ul> <ul>
<li>Media Player: Attributes to call service play_media has been renamed to<br /> <li>Media Player: Attributes to call service play_media has been renamed to
<code>media_content_type</code> and <code>media_content_id</code>, to match the corresponding media<br /> <code class="highlighter-rouge">media_content_type</code> and <code class="highlighter-rouge">media_content_id</code>, to match the corresponding media
player state attributes. This change affects automations, scripts and scenes.</li> player state attributes. This change affects automations, scripts and scenes.</li>
</ul> </ul>
</article> </article>
@ -229,7 +227,7 @@ player state attributes. This change affects automations, scripts and scenes.</l
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -108,7 +108,7 @@
</header> </header>
<p>Party people, 0.16 is here! The big thing with this release is that we have completely removed the barrier to get started by MQTT by being able to launch an embedded MQTT server: <a href="https://github.com/beerfactory/hbmqtt">hbMQTT</a>. Just add <code>mqtt:</code> to your config and a broker is launched and connected with Home Assistant. See the <a href="/components/mqtt/#use-the-embedded-broker">documentation</a> for more info.</p> <p>Party people, 0.16 is here! The big thing with this release is that we have completely removed the barrier to get started by MQTT by being able to launch an embedded MQTT server: <a href="https://github.com/beerfactory/hbmqtt">hbMQTT</a>. Just add <code class="highlighter-rouge">mqtt:</code> to your config and a broker is launched and connected with Home Assistant. See the <a href="/components/mqtt/#use-the-embedded-broker">documentation</a> for more info.</p>
<p>Further in this release a bunch of cool new stuff, bug fixes and rewrites for the Vera and Tellstick component (see breaking changes section at bottom for this!).</p> <p>Further in this release a bunch of cool new stuff, bug fixes and rewrites for the Vera and Tellstick component (see breaking changes section at bottom for this!).</p>
@ -146,26 +146,22 @@
</li> </li>
</ul> </ul>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">tellstick</span><span class="pi">:</span>
<div class="code"><pre><span class="key">tellstick</span>: <span class="s">signal_repetitions</span><span class="pi">:</span> <span class="s">X</span>
<span class="key">signal_repetitions</span>: <span class="string"><span class="content">X</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<ul> <ul>
<li>Vera configuration has changed</li> <li>Vera configuration has changed</li>
</ul> </ul>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">vera</span><span class="pi">:</span>
<div class="code"><pre><span class="key">vera</span>: <span class="s">vera_controller_url</span><span class="pi">:</span> <span class="s">http://192.168.1.161:3480/</span>
<span class="key">vera_controller_url</span>: <span class="string"><span class="content">http://192.168.1.161:3480/</span></span> <span class="c1"># Optional to exclude devices - this is a list of vera device ids</span>
<span class="comment"># Optional to exclude devices - this is a list of vera device ids</span> <span class="s">exclude</span><span class="pi">:</span> <span class="pi">[</span> <span class="nv">13</span><span class="pi">,</span> <span class="nv">14</span><span class="pi">,</span> <span class="nv">16</span><span class="pi">,</span> <span class="nv">20</span><span class="pi">,</span> <span class="nv">23</span><span class="pi">,</span> <span class="nv">72</span><span class="pi">,</span> <span class="nv">73</span><span class="pi">,</span> <span class="nv">74</span><span class="pi">,</span> <span class="nv">75</span><span class="pi">,</span> <span class="nv">76</span><span class="pi">,</span> <span class="nv">77</span><span class="pi">,</span> <span class="nv">78</span><span class="pi">,</span> <span class="nv">88</span><span class="pi">,</span> <span class="nv">89</span><span class="pi">,</span> <span class="nv">99</span><span class="pi">]</span>
<span class="key">exclude</span>: <span class="string"><span class="content">[ 13, 14, 16, 20, 23, 72, 73, 74, 75, 76, 77, 78, 88, 89, 99]</span></span> <span class="c1"># Optional to import switches as lights - this is a list of vera device ids</span>
<span class="comment"># Optional to import switches as lights - this is a list of vera device ids</span> <span class="s">lights</span><span class="pi">:</span> <span class="pi">[</span><span class="nv">15</span><span class="pi">,</span> <span class="nv">17</span><span class="pi">,</span> <span class="nv">19</span><span class="pi">,</span> <span class="nv">21</span><span class="pi">,</span> <span class="nv">22</span><span class="pi">,</span> <span class="nv">24</span><span class="pi">,</span> <span class="nv">26</span><span class="pi">,</span> <span class="nv">43</span><span class="pi">,</span> <span class="nv">64</span><span class="pi">,</span> <span class="nv">70</span><span class="pi">,</span> <span class="nv">87</span><span class="pi">]</span>
<span class="key">lights</span>: <span class="string"><span class="content">[15, 17, 19, 21, 22, 24, 26, 43, 64, 70, 87]</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
</article> </article>
@ -240,7 +236,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/internet-of-things/'>Internet-of-Things</a></li> <li>Internet-of-Things</li>
</ul> </ul>
@ -192,7 +192,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/how-to/'>How-To</a></li> <li>How-To</li>
</ul> </ul>
@ -108,7 +108,7 @@
</header> </header>
<p>The frontend of Home Assistant is served with the help of a local web server. If you have <a href="/getting-started/devices/#customizing-devices-and-services">customized</a> your installation you already use this functionality. The content of your folder <code>www</code> in your Home Assistant configuration directory (<code>.homeassistant</code>) is available under <code>/local</code> (eg. <a href="https://localhost:8123/local">https://localhost:8123/local</a>).</p> <p>The frontend of Home Assistant is served with the help of a local web server. If you have <a href="/getting-started/devices/#customizing-devices-and-services">customized</a> your installation you already use this functionality. The content of your folder <code class="highlighter-rouge">www</code> in your Home Assistant configuration directory (<code class="highlighter-rouge">.homeassistant</code>) is available under <code class="highlighter-rouge">/local</code> (eg. <a href="https://localhost:8123/local">https://localhost:8123/local</a>).</p>
<p>But there is more you can do! You can not only host images for customization there but HTML files or even web applications including CSS and Javascript.</p> <p>But there is more you can do! You can not only host images for customization there but HTML files or even web applications including CSS and Javascript.</p>
@ -198,7 +198,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -132,7 +132,7 @@
<h3>Breaking changes</h3> <h3>Breaking changes</h3>
<p>As of now we are not aware of any breaking changes. However, it might be that Home Assistant will not start for you because of an invalid configuration. A common mistake that people are making is that they are still referring to <code>execute_service</code> in their script configs. This should be <code>service</code>.</p> <p>As of now we are not aware of any breaking changes. However, it might be that Home Assistant will not start for you because of an invalid configuration. A common mistake that people are making is that they are still referring to <code class="highlighter-rouge">execute_service</code> in their script configs. This should be <code class="highlighter-rouge">service</code>.</p>
</article> </article>
@ -206,7 +206,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/website/'>Website</a></li> <li>Website</li>
</ul> </ul>
@ -190,7 +190,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/organisation/'>Organisation</a></li> <li>Organisation</li>
</ul> </ul>
@ -207,7 +207,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -143,12 +143,12 @@
<h3>Breaking changes</h3> <h3>Breaking changes</h3>
<ul> <ul>
<li>We have migrated our datetime format to be iso8601. This will only impact you if you are consuming the date times from the API directly. You can ignore this if you are just using Home Assistant via configuration and the frontend.</li> <li>We have migrated our datetime format to be iso8601. This will only impact you if you are consuming the date times from the API directly. You can ignore this if you are just using Home Assistant via configuration and the frontend.</li>
<li>The constant <code>TEMP_CELCIUS</code> is now correctly called <code>TEMP_CELSIUS</code>. Old one is deprecated and will eventually be removed.</li> <li>The constant <code class="highlighter-rouge">TEMP_CELCIUS</code> is now correctly called <code class="highlighter-rouge">TEMP_CELSIUS</code>. Old one is deprecated and will eventually be removed.</li>
<li>The location of the Docker image has changed. There was no possibility for us to keep maintaining the old image (as it was bound to the GitHub repo under my name) or to make a redirect. So if you are using the Home Assistant Docker image, change it to run <code>homeassistant/home-assistant:latest</code> for the latest release and <code>homeassistant/home-assistant:dev</code> for the latest dev version.</li> <li>The location of the Docker image has changed. There was no possibility for us to keep maintaining the old image (as it was bound to the GitHub repo under my name) or to make a redirect. So if you are using the Home Assistant Docker image, change it to run <code class="highlighter-rouge">homeassistant/home-assistant:latest</code> for the latest release and <code class="highlighter-rouge">homeassistant/home-assistant:dev</code> for the latest dev version.</li>
<li>MySensors received two big changes that will cause you to update your configs. See <a href="/components/mysensors/">component page</a> for new example config. <li>MySensors received two big changes that will cause you to update your configs. See <a href="/components/mysensors/">component page</a> for new example config.
<ol> <ol>
<li>All MySensors entity IDs are different! There was an error in the naming that caused MySensors to append node ID and child ID instead of separating them with an underscore. This has been fixed but will cause all your MySensors entity IDs to change. This is a one time breaking change.</li> <li>All MySensors entity IDs are different! There was an error in the naming that caused MySensors to append node ID and child ID instead of separating them with an underscore. This has been fixed but will cause all your MySensors entity IDs to change. This is a one time breaking change.</li>
<li>The second change is that we now support the TCP ethernet gateway. This is causing a slight change to the config format: you have to change <code>port:</code> under <code>gateways</code> to <code>device:</code>.</li> <li>The second change is that we now support the TCP ethernet gateway. This is causing a slight change to the config format: you have to change <code class="highlighter-rouge">port:</code> under <code class="highlighter-rouge">gateways</code> to <code class="highlighter-rouge">device:</code>.</li>
</ol> </ol>
</li> </li>
</ul> </ul>
@ -225,7 +225,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,11 +93,11 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/owntracks/'>OwnTracks</a></li> <li>OwnTracks</li>
<li><a class='category' href='/blog/categories/presence-detection/'>Presence-Detection</a></li> <li>Presence-Detection</li>
<li><a class='category' href='/blog/categories/ibeacons/'>iBeacons</a></li> <li>iBeacons</li>
</ul> </ul>
@ -136,17 +136,15 @@
<p>You tell HomeAssistant about fixed locations by creating a Zone with the longitude and latitude of your beacon. You should also give the zone a name which you will also use when you set up OwnTracks. An an example this zone specifies the location of my drive way.</p> <p>You tell HomeAssistant about fixed locations by creating a Zone with the longitude and latitude of your beacon. You should also give the zone a name which you will also use when you set up OwnTracks. An an example this zone specifies the location of my drive way.</p>
<p><strong>Example <code>configuration.yaml</code> entry</strong></p> <p><strong>Example <code class="highlighter-rouge">configuration.yaml</code> entry</strong></p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code>
<div class="code"><pre> <span class="s">zone</span><span class="pi">:</span>
<span class="key">zone</span>: <span class="pi">-</span> <span class="s">name</span><span class="pi">:</span> <span class="s1">'</span><span class="s">Drive'</span>
- <span class="string"><span class="content">name: 'Drive'</span></span> <span class="s">latitude</span><span class="pi">:</span> <span class="s">XXX</span>
<span class="key">latitude</span>: <span class="string"><span class="content">XXX</span></span> <span class="s">longitude</span><span class="pi">:</span> <span class="s">YYY</span>
<span class="key">longitude</span>: <span class="string"><span class="content">YYY</span></span> <span class="s">radius</span><span class="pi">:</span> <span class="s">100</span>
<span class="key">radius</span>: <span class="string"><span class="content">100</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p>The radius isnt used by the beacon code, but it is used by the GPS location sensing code. Ill come back to this a little later. For now just use 50 or 100.</p> <p>The radius isnt used by the beacon code, but it is used by the GPS location sensing code. Ill come back to this a little later. For now just use 50 or 100.</p>
@ -157,13 +155,13 @@
<ol> <ol>
<li>Go to the OwnTracks app on your phone</li> <li>Go to the OwnTracks app on your phone</li>
<li>Touch the <code>Regions</code> menu at the bottom of the screen</li> <li>Touch the <code class="highlighter-rouge">Regions</code> menu at the bottom of the screen</li>
<li>Touch the <code>+</code> symbol at the top right of the screen</li> <li>Touch the <code class="highlighter-rouge">+</code> symbol at the top right of the screen</li>
<li>Give the beacon a name e.g. <code>-drive</code> (start the name with a <code>-</code> see below for the reason)</li> <li>Give the beacon a name e.g. <code class="highlighter-rouge">-drive</code> (start the name with a <code class="highlighter-rouge">-</code> see below for the reason)</li>
<li>Turn Share to <code>On</code></li> <li>Turn Share to <code class="highlighter-rouge">On</code></li>
<li>Skip the <code>Circular Region</code> section</li> <li>Skip the <code class="highlighter-rouge">Circular Region</code> section</li>
<li>Enter the <code>UUID</code> of your beacon - this may be written on your beacon - or you can copy it from the management app that came with your iBeacon device. Its a long number so its easier to copy if you can!</li> <li>Enter the <code class="highlighter-rouge">UUID</code> of your beacon - this may be written on your beacon - or you can copy it from the management app that came with your iBeacon device. Its a long number so its easier to copy if you can!</li>
<li>Enter the <code>Minor</code> and <code>Major</code> numbers for your iBeacon - or leave them at 0 which will match all beacons with that <code>UUID</code></li> <li>Enter the <code class="highlighter-rouge">Minor</code> and <code class="highlighter-rouge">Major</code> numbers for your iBeacon - or leave them at 0 which will match all beacons with that <code class="highlighter-rouge">UUID</code></li>
</ol> </ol>
<p class="img"> <p class="img">
@ -178,7 +176,7 @@
<p>When OwnTracks sees the beacon (and turns the region red), it also sends an MQTT packet to HA to say that you have entered that region.</p> <p>When OwnTracks sees the beacon (and turns the region red), it also sends an MQTT packet to HA to say that you have entered that region.</p>
<p>The result of the configuration above would be to set the location of device.phone to <code>Drive</code> , (and the GPS location to XXX,YYY) when your phone sees the beacon.</p> <p>The result of the configuration above would be to set the location of device.phone to <code class="highlighter-rouge">Drive</code> , (and the GPS location to XXX,YYY) when your phone sees the beacon.</p>
<p>So with the steps above you should be able to improve the reliability of tracking your phone - and send timely updates to HA. I did this for my home - and the lights now turn on before I reach the house on foot. If I arrive by car they turn on within a few seconds of arriving, before I can get to the front door.</p> <p>So with the steps above you should be able to improve the reliability of tracking your phone - and send timely updates to HA. I did this for my home - and the lights now turn on before I reach the house on foot. If I arrive by car they turn on within a few seconds of arriving, before I can get to the front door.</p>
@ -190,27 +188,25 @@
<p>However you can also use beacons for situations where GPS doesnt work well.</p> <p>However you can also use beacons for situations where GPS doesnt work well.</p>
<p>This might be because the zones are too close together - or even on top of each other!<br /> <p>This might be because the zones are too close together - or even on top of each other!
For example, my wife works next door - and I couldnt detect whether shes at home or in the office via GPS because the accuracy wasnt high enough. However I can do this by using two beacons.</p> For example, my wife works next door - and I couldnt detect whether shes at home or in the office via GPS because the accuracy wasnt high enough. However I can do this by using two beacons.</p>
<p>To make this type of presence detection work you need to turn GPS off for a zone in Home Assistant by making them <code>passive</code>. This is important because otherwise HA will try to decide between two close together zones without enough data. This doesnt work well.</p> <p>To make this type of presence detection work you need to turn GPS off for a zone in Home Assistant by making them <code class="highlighter-rouge">passive</code>. This is important because otherwise HA will try to decide between two close together zones without enough data. This doesnt work well.</p>
<p>A passive zone can only be entered via an iBeacon, so a GPS location update will always pick the other zone.</p> <p>A passive zone can only be entered via an iBeacon, so a GPS location update will always pick the other zone.</p>
<p>I set up my Home zone to be a standard region, and my office zone to be passive, so the home zone can be entered in the normal way via either GPS or a Beacon.</p> <p>I set up my Home zone to be a standard region, and my office zone to be passive, so the home zone can be entered in the normal way via either GPS or a Beacon.</p>
<p><strong>Example <code>configuration.yaml</code> entry</strong></p> <p><strong>Example <code class="highlighter-rouge">configuration.yaml</code> entry</strong></p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code>
<div class="code"><pre> <span class="s">zone</span><span class="pi">:</span>
<span class="key">zone</span>: <span class="pi">-</span> <span class="s">name</span><span class="pi">:</span> <span class="s1">'</span><span class="s">Office'</span>
- <span class="string"><span class="content">name: 'Office'</span></span> <span class="s">latitude</span><span class="pi">:</span> <span class="s">XXX</span>
<span class="key">latitude</span>: <span class="string"><span class="content">XXX</span></span> <span class="s">longitude</span><span class="pi">:</span> <span class="s">YYY</span>
<span class="key">longitude</span>: <span class="string"><span class="content">YYY</span></span> <span class="s">radius</span><span class="pi">:</span> <span class="s">3</span>
<span class="key">radius</span>: <span class="string"><span class="content">3</span></span> <span class="s">passive</span><span class="pi">:</span> <span class="s">true</span>
<span class="key">passive</span>: <span class="string"><span class="content">true</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p>You could use this technique to try to detect which room someone is in. This might allow you to notice whether someone is in the living room or the bedroom - even though one is above the other (although beacon packets do pass through walls and floors).</p> <p>You could use this technique to try to detect which room someone is in. This might allow you to notice whether someone is in the living room or the bedroom - even though one is above the other (although beacon packets do pass through walls and floors).</p>
@ -229,18 +225,18 @@ For example, my wife works next door - and I couldnt detect whether shes a
<h4><a class="title-link" name="connections-and-disconnecting" href="#connections-and-disconnecting"></a> Connections and disconnecting</h4> <h4><a class="title-link" name="connections-and-disconnecting" href="#connections-and-disconnecting"></a> Connections and disconnecting</h4>
<p>Owntracks treats a region name with a leading <code>-</code> as a hint that it shouldnt disconnect after a single missed packet. This improves the ability to keep a connection to a beacon.</p> <p>Owntracks treats a region name with a leading <code class="highlighter-rouge">-</code> as a hint that it shouldnt disconnect after a single missed packet. This improves the ability to keep a connection to a beacon.</p>
<p>However, even when using this feature Ive noticed that you can still lose connections (although it seems to vary by beacon manufacturer and type - Ill talk more about this in <em>part 2</em>). This means that its best to take into account that you may see false enter/leave events in HA. You may be able to improve this by changing how often the beacons send packets - and by increasing the signal strength (both will drain your beacon batteries more quickly). You can usually change these parameters in the app supplied by the iBeacon maker. You can also find some high power beacons (which have worked well for me).</p> <p>However, even when using this feature Ive noticed that you can still lose connections (although it seems to vary by beacon manufacturer and type - Ill talk more about this in <em>part 2</em>). This means that its best to take into account that you may see false enter/leave events in HA. You may be able to improve this by changing how often the beacons send packets - and by increasing the signal strength (both will drain your beacon batteries more quickly). You can usually change these parameters in the app supplied by the iBeacon maker. You can also find some high power beacons (which have worked well for me).</p>
<p>In automations you can use a <code>for:</code> to avoid triggering during a brief disconnect, or use a script with a delay. Stay tuned for <em>part 2</em> for an example of this.</p> <p>In automations you can use a <code class="highlighter-rouge">for:</code> to avoid triggering during a brief disconnect, or use a script with a delay. Stay tuned for <em>part 2</em> for an example of this.</p>
<h4><a class="title-link" name="using-multiple-beacons-for-the-same-zone" href="#using-multiple-beacons-for-the-same-zone"></a> Using Multiple beacons for the same Zone</h4> <h4><a class="title-link" name="using-multiple-beacons-for-the-same-zone" href="#using-multiple-beacons-for-the-same-zone"></a> Using Multiple beacons for the same Zone</h4>
<p>iBeacons have a <code>UUID</code> (usually set to the same value for beacons from the same manufacturer), as well as a <code>minor</code> and <code>major</code> number. If you set two beacons to have exactly same details then OwnTracks will think multiple beacons are at the same location.</p> <p>iBeacons have a <code class="highlighter-rouge">UUID</code> (usually set to the same value for beacons from the same manufacturer), as well as a <code class="highlighter-rouge">minor</code> and <code class="highlighter-rouge">major</code> number. If you set two beacons to have exactly same details then OwnTracks will think multiple beacons are at the same location.</p>
<p>This means you can have more than one beacon around your home - and a connection to any of them will count as <code>home</code> to OwnTracks and HA. This reduces disconnections.</p> <p>This means you can have more than one beacon around your home - and a connection to any of them will count as <code class="highlighter-rouge">home</code> to OwnTracks and HA. This reduces disconnections.</p>
<p>You can achieve the same effect by using the same the same <code>UUID</code> but different <code>major</code> / <code>minor</code> numbers - and tell OwnTracks not to worry about the <code>minor</code> / <code>major</code> numbers for a particular region by setting them to 0).</p> <p>You can achieve the same effect by using the same the same <code class="highlighter-rouge">UUID</code> but different <code class="highlighter-rouge">major</code> / <code class="highlighter-rouge">minor</code> numbers - and tell OwnTracks not to worry about the <code class="highlighter-rouge">minor</code> / <code class="highlighter-rouge">major</code> numbers for a particular region by setting them to 0).</p>
<p><em>Make sure to also check out <a href="/blog/2016/05/26/ibeacons-how-to-track-things-that-cant-track-themselves-part-ii/">part II</a> where I talk about how to use iBeacons to track any object.</em></p> <p><em>Make sure to also check out <a href="/blog/2016/05/26/ibeacons-how-to-track-things-that-cant-track-themselves-part-ii/">part II</a> where I talk about how to use iBeacons to track any object.</em></p>
</article> </article>
@ -316,7 +312,7 @@ For example, my wife works next door - and I couldnt detect whether shes a
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -87,15 +87,15 @@
<div class="meta clearfix"> <div class="meta clearfix">
<time datetime="2016-05-06T14:09:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> May 6, 2016</time> <time datetime="2016-05-06T14:09:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> May 6, 2016</time>
<span class="byline author vcard"><i class='icon-user'></i> Paulus Schoutsen</span> <span class="byline author vcard"><i class='icon-user'></i> Paulus Schoutsen</span>
<span><i class='icon-time'></i> less than one minute reading time</span> <span><i class='icon-time'></i> Less than one minute reading time</span>
<span> <span>
<i class="icon-tags"></i> <i class="icon-tags"></i>
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/talks/'>Talks</a></li> <li>Talks</li>
<li><a class='category' href='/blog/categories/video/'>Video</a></li> <li>Video</li>
</ul> </ul>
@ -188,7 +188,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -110,49 +110,45 @@
<p>This release is big. Until now, our automations and scripts have been very static. Starting today it should all be a bit more dynamic.</p> <p>This release is big. Until now, our automations and scripts have been very static. Starting today it should all be a bit more dynamic.</p>
<p><strong>Scripts</strong> are now available in automations and when responding to Alexa/Amazon Echo. Both of these components will now expose data to be used in script templates (including <code>from_state</code> !). Passing data to script entities is available by passing the data to the script services.</p> <p><strong>Scripts</strong> are now available in automations and when responding to Alexa/Amazon Echo. Both of these components will now expose data to be used in script templates (including <code class="highlighter-rouge">from_state</code> !). Passing data to script entities is available by passing the data to the script services.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">automation</span><span class="pi">:</span>
<div class="code"><pre><span class="key">automation</span>: <span class="s">trigger</span><span class="pi">:</span>
<span class="key">trigger</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">mqtt</span>
<span class="key">platform</span>: <span class="string"><span class="content">mqtt</span></span> <span class="s">topic</span><span class="pi">:</span> <span class="s">some/notify/topic</span>
<span class="key">topic</span>: <span class="string"><span class="content">some/notify/topic</span></span> <span class="s">action</span><span class="pi">:</span>
<span class="key">action</span>: <span class="s">service</span><span class="pi">:</span> <span class="s">notify.notify</span>
<span class="key">service</span>: <span class="string"><span class="content">notify.notify</span></span> <span class="s">data_template</span><span class="pi">:</span>
<span class="key">data_template</span>: <span class="s">message</span><span class="pi">:</span>
<span class="key">message</span>:
<span class="key">automation 2</span>: <span class="s">automation 2</span><span class="pi">:</span>
<span class="key">trigger</span>: <span class="s">trigger</span><span class="pi">:</span>
<span class="key">platform</span>: <span class="string"><span class="content">state</span></span> <span class="s">platform</span><span class="pi">:</span> <span class="s">state</span>
<span class="key">entity_id</span>: <span class="string"><span class="content">light.hue</span></span> <span class="s">entity_id</span><span class="pi">:</span> <span class="s">light.hue</span>
<span class="key">action</span>: <span class="s">action</span><span class="pi">:</span>
<span class="key">service</span>: <span class="string"><span class="content">notify.notify</span></span> <span class="s">service</span><span class="pi">:</span> <span class="s">notify.notify</span>
<span class="key">data_template</span>: <span class="s">data_template</span><span class="pi">:</span>
<span class="key">message</span>: <span class="string"><span class="content">is now </span></span> <span class="s">message</span><span class="pi">:</span> <span class="s">is now</span>
</pre></div> </code></pre>
</div>
</div> </div>
<p><strong>Entity Namespaces</strong> allow you to influence the entity ids for a specific platform. For example you can turn <code>light.living_room</code> into <code>light.holiday_home_living_room</code> with the following config:</p> <p><strong>Entity Namespaces</strong> allow you to influence the entity ids for a specific platform. For example you can turn <code class="highlighter-rouge">light.living_room</code> into <code class="highlighter-rouge">light.holiday_home_living_room</code> with the following config:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">light</span><span class="pi">:</span>
<div class="code"><pre><span class="key">light</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">hue</span>
<span class="key">platform</span>: <span class="string"><span class="content">hue</span></span> <span class="s">entity_namespace</span><span class="pi">:</span> <span class="s">holiday_home</span>
<span class="key">entity_namespace</span>: <span class="string"><span class="content">holiday_home</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<ul> <ul>
<li>Automation: allow <a href="/getting-started/scripts/">script syntax</a> for action (<a href="https://github.com/balloob/">@balloob</a>)</li> <li>Automation: allow <a href="/getting-started/scripts/">script syntax</a> for action (<a href="https://github.com/balloob/">@balloob</a>)</li>
<li>Automation: expose <a href="/getting-started/automation-templating/#available-trigger-data"><code>trigger</code> variable</a> to script templates (<a href="https://github.com/balloob/">@balloob</a>)</li> <li>Automation: expose <a href="/getting-started/automation-templating/#available-trigger-data"><code class="highlighter-rouge">trigger</code> variable</a> to script templates (<a href="https://github.com/balloob/">@balloob</a>)</li>
<li>Script: allow passing variables for script templates in the <a href="/components/script/#passing-parameters-in-service-calls">script service calls</a> (<a href="https://github.com/balloob/">@balloob</a>)</li> <li>Script: allow passing variables for script templates in the <a href="/components/script/#passing-parameters-in-service-calls">script service calls</a> (<a href="https://github.com/balloob/">@balloob</a>)</li>
<li>Alexa/Amazon Echo: allow <a href="/getting-started/scripts/">script syntax</a> for action (<a href="https://github.com/balloob/">@balloob</a>)</li> <li>Alexa/Amazon Echo: allow <a href="/getting-started/scripts/">script syntax</a> for action (<a href="https://github.com/balloob/">@balloob</a>)</li>
<li>Alexa/Amazon Echo: <a href="/components/alexa/#configuring-home-assistant">expose intent variables</a> to script templates (<a href="https://github.com/balloob/">@balloob</a>)</li> <li>Alexa/Amazon Echo: <a href="/components/alexa/#configuring-home-assistant">expose intent variables</a> to script templates (<a href="https://github.com/balloob/">@balloob</a>)</li>
<li>Script syntax: <a href="/getting-started/scripts-conditions/">conditions now supported</a> to interrupt execution (<a href="https://github.com/balloob/">@balloob</a>)</li> <li>Script syntax: <a href="/getting-started/scripts-conditions/">conditions now supported</a> to interrupt execution (<a href="https://github.com/balloob/">@balloob</a>)</li>
<li>Automation: use <a href="/getting-started/scripts-conditions/">new condition syntax</a> (<a href="https://github.com/balloob/">@balloob</a>)</li> <li>Automation: use <a href="/getting-started/scripts-conditions/">new condition syntax</a> (<a href="https://github.com/balloob/">@balloob</a>)</li>
<li>Script syntax: two new conditions <a href="/getting-started/scripts-conditions/#and-condition"><code>and</code></a> and <a href="/getting-started/scripts-conditions/#or-condition"><code>or</code></a> to combine conditions (<a href="https://github.com/balloob/">@balloob</a>)</li> <li>Script syntax: two new conditions <a href="/getting-started/scripts-conditions/#and-condition"><code class="highlighter-rouge">and</code></a> and <a href="/getting-started/scripts-conditions/#or-condition"><code class="highlighter-rouge">or</code></a> to combine conditions (<a href="https://github.com/balloob/">@balloob</a>)</li>
<li>Any platform: Allow setting <a href="/topics/platform_options/#entity-namespace">entity namespace</a> to prefix entity_ids. (<a href="https://github.com/balloob/">@balloob</a>)</li> <li>Any platform: Allow setting <a href="/topics/platform_options/#entity-namespace">entity namespace</a> to prefix entity_ids. (<a href="https://github.com/balloob/">@balloob</a>)</li>
<li>Switch: <a href="/components/switch.rpi_rf/">Raspberry Pi generic 433 Mhz GPIO adapters</a> now supported (<a href="https://github.com/milaq/">@milaq</a>)</li> <li>Switch: <a href="/components/switch.rpi_rf/">Raspberry Pi generic 433 Mhz GPIO adapters</a> now supported (<a href="https://github.com/milaq/">@milaq</a>)</li>
<li>Z-Wave: use more sane defaults (<a href="https://github.com/danieljkemp/">@danieljkemp</a>)</li> <li>Z-Wave: use more sane defaults (<a href="https://github.com/danieljkemp/">@danieljkemp</a>)</li>
@ -165,14 +161,14 @@
<li>Switch: <a href="/components/switch.acer_projector/">Acer Projectors</a> now supported (<a href="https://github.com/deisi/">@deisi</a>)</li> <li>Switch: <a href="/components/switch.acer_projector/">Acer Projectors</a> now supported (<a href="https://github.com/deisi/">@deisi</a>)</li>
<li>New <a href="/components/hvac/">HVAC component</a> added with Z-Wave support (<a href="https://github.com/turbokongen/">@turbokongen</a>)</li> <li>New <a href="/components/hvac/">HVAC component</a> added with Z-Wave support (<a href="https://github.com/turbokongen/">@turbokongen</a>)</li>
<li>Support added for <a href="/components/octoprint/">OctoPrint</a> (<a href="https://github.com/w1ll1am23/">@w1ll1am23</a>)</li> <li>Support added for <a href="/components/octoprint/">OctoPrint</a> (<a href="https://github.com/w1ll1am23/">@w1ll1am23</a>)</li>
<li>Configuration.yaml can now refer to environment variables using <code>!env_var</code> (<a href="https://github.com/bah2830/">@bah2830</a>)</li> <li>Configuration.yaml can now refer to environment variables using <code class="highlighter-rouge">!env_var</code> (<a href="https://github.com/bah2830/">@bah2830</a>)</li>
<li>Lock: <a href="/components/lock.zwave/">Z-Wave</a> now supported (<a href="https://github.com/devdelay/">@devdelay</a>)</li> <li>Lock: <a href="/components/lock.zwave/">Z-Wave</a> now supported (<a href="https://github.com/devdelay/">@devdelay</a>)</li>
<li>New <a href="/components/dweet/">Dweet component</a> to export data (<a href="https://github.com/fabaff/">@fabaff</a>)</li> <li>New <a href="/components/dweet/">Dweet component</a> to export data (<a href="https://github.com/fabaff/">@fabaff</a>)</li>
<li>Media Player now supports stop command + initial kodi support (<a href="https://github.com/hmronline/">@hmronline</a>)</li> <li>Media Player now supports stop command + initial kodi support (<a href="https://github.com/hmronline/">@hmronline</a>)</li>
<li>Zigbee: push updates now supported (<a href="https://github.com/flyte/">@flyte</a>)</li> <li>Zigbee: push updates now supported (<a href="https://github.com/flyte/">@flyte</a>)</li>
<li>Wink devices with battery level will now show these (<a href="https://github.com/w1ll1am23/">@w1ll1am23</a>)</li> <li>Wink devices with battery level will now show these (<a href="https://github.com/w1ll1am23/">@w1ll1am23</a>)</li>
<li>Templates: new <a href="/topics/templating/#home-assistant-template-extensions"><code>as_timestamp</code></a> method now available (<a href="https://github.com/srcLurker/">@srcLurker</a>)</li> <li>Templates: new <a href="/topics/templating/#home-assistant-template-extensions"><code class="highlighter-rouge">as_timestamp</code></a> method now available (<a href="https://github.com/srcLurker/">@srcLurker</a>)</li>
<li>API: Add [<code>/api/discovery_info</code>] with basic instance info (<a href="https://github.com/robbiet480/">@robbiet480</a>)</li> <li>API: Add [<code class="highlighter-rouge">/api/discovery_info</code>] with basic instance info (<a href="https://github.com/robbiet480/">@robbiet480</a>)</li>
<li>Sensor: <a href="/components/sensor.google_travel_time/">Google Maps travel time</a> added (<a href="https://github.com/Danielhiversen/">@Danielhiversen</a>)</li> <li>Sensor: <a href="/components/sensor.google_travel_time/">Google Maps travel time</a> added (<a href="https://github.com/Danielhiversen/">@Danielhiversen</a>)</li>
<li>HTTP: Allow adding <a href="/components/http/">CORS headers</a> (<a href="https://github.com/robbiet480/">@robbiet480</a>)</li> <li>HTTP: Allow adding <a href="/components/http/">CORS headers</a> (<a href="https://github.com/robbiet480/">@robbiet480</a>)</li>
<li>Sensor: <a href="/components/sensor.fitbit/">Fitbit</a> support added (<a href="https://github.com/robbiet480/">@robbiet480</a>)</li> <li>Sensor: <a href="/components/sensor.fitbit/">Fitbit</a> support added (<a href="https://github.com/robbiet480/">@robbiet480</a>)</li>
@ -181,29 +177,25 @@
<h3>Deprecations</h3> <h3>Deprecations</h3>
<ul> <ul>
<li>Conditions in automations should now specify which condition to use with <code>condition:</code> instead of <code>platform:</code>. For example <code>condition: state</code>.</li> <li>Conditions in automations should now specify which condition to use with <code class="highlighter-rouge">condition:</code> instead of <code class="highlighter-rouge">platform:</code>. For example <code class="highlighter-rouge">condition: state</code>.</li>
<li>RFXtrx has a new config format.</li> <li>RFXtrx has a new config format.</li>
</ul> </ul>
<p>Old RFXtrx config format:</p> <p>Old RFXtrx config format:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code> <span class="s">devices</span><span class="pi">:</span>
<div class="code"><pre> <span class="key">devices</span>: <span class="s">123efab1</span><span class="pi">:</span>
<span class="key">123efab1</span>: <span class="s">name</span><span class="pi">:</span> <span class="s">My DI.0 light device</span>
<span class="key">name</span>: <span class="string"><span class="content">My DI.0 light device</span></span> <span class="s">packetid</span><span class="pi">:</span> <span class="s">1b2200000890efab1213f60</span>
<span class="key">packetid</span>: <span class="string"><span class="content">1b2200000890efab1213f60</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p>New RFXtrx config format:</p> <p>New RFXtrx config format:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code> <span class="s">devices</span><span class="pi">:</span>
<div class="code"><pre> <span class="key">devices</span>: <span class="s">1b2200000890efab1213f60</span><span class="pi">:</span>
<span class="key">1b2200000890efab1213f60</span>: <span class="s">name</span><span class="pi">:</span> <span class="s">My DI.0 light device</span>
<span class="key">name</span>: <span class="string"><span class="content">My DI.0 light device</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
</article> </article>
@ -278,7 +270,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -87,13 +87,13 @@
<div class="meta clearfix"> <div class="meta clearfix">
<time datetime="2016-05-12T00:09:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> May 12, 2016</time> <time datetime="2016-05-12T00:09:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> May 12, 2016</time>
<span class="byline author vcard"><i class='icon-user'></i> Paulus Schoutsen</span> <span class="byline author vcard"><i class='icon-user'></i> Paulus Schoutsen</span>
<span><i class='icon-time'></i> less than one minute reading time</span> <span><i class='icon-time'></i> Less than one minute reading time</span>
<span> <span>
<i class="icon-tags"></i> <i class="icon-tags"></i>
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/video/'>Video</a></li> <li>Video</li>
</ul> </ul>
@ -188,7 +188,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/technology/'>Technology</a></li> <li>Technology</li>
</ul> </ul>
@ -202,7 +202,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -116,7 +116,7 @@
<li>Restarting now supported without forking (<a href="https://github.com/jaharkes">@jaharkes</a>)</li> <li>Restarting now supported without forking (<a href="https://github.com/jaharkes">@jaharkes</a>)</li>
<li>Add <a href="/components/recorder/">purge days option</a> to recorder component (<a href="https://github.com/justyns">@justyns</a>, <a href="https://github.com/infamy">@infamy</a>)</li> <li>Add <a href="/components/recorder/">purge days option</a> to recorder component (<a href="https://github.com/justyns">@justyns</a>, <a href="https://github.com/infamy">@infamy</a>)</li>
<li>Generic load_platform mechanism for entity components (<a href="https://github.com/kellerza">@kellerza</a>)</li> <li>Generic load_platform mechanism for entity components (<a href="https://github.com/kellerza">@kellerza</a>)</li>
<li>Template: new <a href="/topics/templating/#home-assistant-template-extensions"><code>relative_time</code></a> function to render ie. <code>7 seconds ago</code> (<a href="https://github.com/robbiet480">@robbiet480</a>)</li> <li>Template: new <a href="/topics/templating/#home-assistant-template-extensions"><code class="highlighter-rouge">relative_time</code></a> function to render ie. <code class="highlighter-rouge">7 seconds ago</code> (<a href="https://github.com/robbiet480">@robbiet480</a>)</li>
<li>Sensor: <a href="/components/sensor.supervisord/">supervisord</a> now supported (<a href="https://github.com/happyleavesaoc">@happyleavesaoc</a>)</li> <li>Sensor: <a href="/components/sensor.supervisord/">supervisord</a> now supported (<a href="https://github.com/happyleavesaoc">@happyleavesaoc</a>)</li>
<li>Docker: we should no longer get SSL errors with requests (<a href="https://github.com/lwis">@lwis</a>)</li> <li>Docker: we should no longer get SSL errors with requests (<a href="https://github.com/lwis">@lwis</a>)</li>
<li>Media Player: <a href="/components/media_player.gpmdp/">Google Play Music Desktop Player</a> now supported (<a href="https://github.com/GreenTurtwig">@GreenTurtwig</a>)</li> <li>Media Player: <a href="/components/media_player.gpmdp/">Google Play Music Desktop Player</a> now supported (<a href="https://github.com/GreenTurtwig">@GreenTurtwig</a>)</li>
@ -128,7 +128,7 @@
<li>Sensor: <a href="/components/sensor.lastfm/">Last.fm</a> now supported (<a href="https://github.com/darookee">@darookee</a>, <a href="https://github.com/GreenTurtwig">@GreenTurtwig</a>)</li> <li>Sensor: <a href="/components/sensor.lastfm/">Last.fm</a> now supported (<a href="https://github.com/darookee">@darookee</a>, <a href="https://github.com/GreenTurtwig">@GreenTurtwig</a>)</li>
<li>Notify: Amazon <a href="/components/notify.aws_lambda/">Lambda</a>, <a href="/components/notify.aws_sns/">SNS</a>, <a href="/components/notify.aws_sqs/">SQS</a> now supported (<a href="https://github.com/robbiet480">@robbiet480</a>)</li> <li>Notify: Amazon <a href="/components/notify.aws_lambda/">Lambda</a>, <a href="/components/notify.aws_sns/">SNS</a>, <a href="/components/notify.aws_sqs/">SQS</a> now supported (<a href="https://github.com/robbiet480">@robbiet480</a>)</li>
<li>Light: allow human readable colors in turn_on command (<a href="https://github.com/robbiet480">@robbiet480</a>)</li> <li>Light: allow human readable colors in turn_on command (<a href="https://github.com/robbiet480">@robbiet480</a>)</li>
<li>YAML: new include dir options <a href="/topics/splitting_configuration/#advanced-usage"><code>!include_dir_merge_list</code></a> and <a href="/topics/splitting_configuration/#advanced-usage"><code>!include_dir_merge_named</code></a> (<a href="https://github.com/happyleavesaoc">@happyleavesaoc</a>)</li> <li>YAML: new include dir options <a href="/topics/splitting_configuration/#advanced-usage"><code class="highlighter-rouge">!include_dir_merge_list</code></a> and <a href="/topics/splitting_configuration/#advanced-usage"><code class="highlighter-rouge">!include_dir_merge_named</code></a> (<a href="https://github.com/happyleavesaoc">@happyleavesaoc</a>)</li>
<li>Media Player: <a href="/components/media_player.lg_netcast/">LG Netcast TVs</a> now supported (<a href="https://github.com/wokar">@wokar</a>)</li> <li>Media Player: <a href="/components/media_player.lg_netcast/">LG Netcast TVs</a> now supported (<a href="https://github.com/wokar">@wokar</a>)</li>
<li>Media Player: Allow enqueuing media on Sonos (<a href="https://github.com/shaftoe">@shaftoe</a>)</li> <li>Media Player: Allow enqueuing media on Sonos (<a href="https://github.com/shaftoe">@shaftoe</a>)</li>
<li>Notify: <a href="/components/notify.ecobee/">Ecobee thermostats</a> now supported (<a href="https://github.com/nkgilley">@nkgilley</a>)</li> <li>Notify: <a href="/components/notify.ecobee/">Ecobee thermostats</a> now supported (<a href="https://github.com/nkgilley">@nkgilley</a>)</li>
@ -143,12 +143,10 @@
<li>Asus WRT will now default to SSH with Telnet being an option</li> <li>Asus WRT will now default to SSH with Telnet being an option</li>
</ul> </ul>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">device_tracker</span><span class="pi">:</span>
<div class="code"><pre><span class="key">device_tracker</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">asuswrt</span>
<span class="key">platform</span>: <span class="string"><span class="content">asuswrt</span></span> <span class="s">protocol</span><span class="pi">:</span> <span class="s">telnet</span>
<span class="key">protocol</span>: <span class="string"><span class="content">telnet</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
</article> </article>
@ -223,7 +221,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -87,13 +87,13 @@
<div class="meta clearfix"> <div class="meta clearfix">
<time datetime="2016-05-22T16:06:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> May 22, 2016</time> <time datetime="2016-05-22T16:06:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> May 22, 2016</time>
<span class="byline author vcard"><i class='icon-user'></i> Paulus Schoutsen</span> <span class="byline author vcard"><i class='icon-user'></i> Paulus Schoutsen</span>
<span><i class='icon-time'></i> less than one minute reading time</span> <span><i class='icon-time'></i> Less than one minute reading time</span>
<span> <span>
<i class="icon-tags"></i> <i class="icon-tags"></i>
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/video/'>Video</a></li> <li>Video</li>
</ul> </ul>
@ -110,10 +110,8 @@
<p>We are always hard at work at the virtual Home Assistant headquarters to make it easier for you to get started with Home Assistant. Thats why <a href="https://github.com/jbags81">@jbags81</a> recently introduced the <a href="/getting-started/installation-raspberry-pi-all-in-one/">all-in-one installer</a>. It allows you to get up and running with a complete Home Assistant setup by entering one line of code into your Raspberry Pi running Raspbian Jessie:</p> <p>We are always hard at work at the virtual Home Assistant headquarters to make it easier for you to get started with Home Assistant. Thats why <a href="https://github.com/jbags81">@jbags81</a> recently introduced the <a href="/getting-started/installation-raspberry-pi-all-in-one/">all-in-one installer</a>. It allows you to get up and running with a complete Home Assistant setup by entering one line of code into your Raspberry Pi running Raspbian Jessie:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code>wget -Nnv https://raw.githubusercontent.com/home-assistant/fabric-home-assistant/master/hass_rpi_installer.sh <span class="o">&amp;&amp;</span> bash hass_rpi_installer.sh;
<div class="code"><pre>wget -Nnv https://raw.githubusercontent.com/home-assistant/fabric-home-assistant/master/hass_rpi_installer.sh &amp;&amp; bash hass_rpi_installer.sh; </code></pre>
</pre></div>
</div>
</div> </div>
<p>This feature wouldnt be complete if it wasnt accompanied by a new video by Ben from <a href="http://www.bruhautomation.com">BRUH Automation</a>. The video shows how to install Raspbian Jessie on your Raspberry Pi and use the new installation script to get a full Home Assistant system up and running.</p> <p>This feature wouldnt be complete if it wasnt accompanied by a new video by Ben from <a href="http://www.bruhautomation.com">BRUH Automation</a>. The video shows how to install Raspbian Jessie on your Raspberry Pi and use the new installation script to get a full Home Assistant system up and running.</p>
@ -194,7 +192,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,11 +93,11 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/device-tracking/'>Device-Tracking</a></li> <li>Device-Tracking</li>
<li><a class='category' href='/blog/categories/owntracks/'>OwnTracks</a></li> <li>OwnTracks</li>
<li><a class='category' href='/blog/categories/ibeacons/'>iBeacons</a></li> <li>iBeacons</li>
</ul> </ul>
@ -158,72 +158,68 @@
<p>With the basic tracking working - you can use automation to do things like open your gates if your car comes home</p> <p>With the basic tracking working - you can use automation to do things like open your gates if your car comes home</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">automation</span><span class="pi">:</span>
<div class="code"><pre><span class="key">automation</span>: <span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s1">'</span><span class="s">Open</span><span class="nv"> </span><span class="s">gate'</span>
- <span class="string"><span class="content">alias: 'Open gate'</span></span> <span class="s">trigger</span><span class="pi">:</span>
<span class="key">trigger</span>: <span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">state</span>
- <span class="string"><span class="content">platform: state</span></span> <span class="s">entity_id</span><span class="pi">:</span> <span class="s">device_tracker.beacon_car</span>
<span class="key">entity_id</span>: <span class="string"><span class="content">device_tracker.beacon_car</span></span> <span class="s">from</span><span class="pi">:</span> <span class="s1">'</span><span class="s">not_home'</span>
<span class="key">from</span>: <span class="string"><span class="content">'not_home'</span></span> <span class="s">to</span><span class="pi">:</span> <span class="s1">'</span><span class="s">home'</span>
<span class="key">to</span>: <span class="string"><span class="content">'home'</span></span> <span class="s">condition</span><span class="pi">:</span>
<span class="key">condition</span>: <span class="pi">-</span> <span class="s">condition</span><span class="pi">:</span> <span class="s">state</span>
- <span class="string"><span class="content">condition: state</span></span> <span class="s">entity_id</span><span class="pi">:</span> <span class="s">switch.gate</span>
<span class="key">entity_id</span>: <span class="string"><span class="content">switch.gate</span></span> <span class="s">state</span><span class="pi">:</span> <span class="s1">'</span><span class="s">off'</span>
<span class="key">state</span>: <span class="string"><span class="content">'off'</span></span> <span class="s">action</span><span class="pi">:</span>
<span class="key">action</span>: <span class="s">service</span><span class="pi">:</span> <span class="s">switch.turn_on</span>
<span class="key">service</span>: <span class="string"><span class="content">switch.turn_on</span></span> <span class="s">entity_id</span><span class="pi">:</span> <span class="s">switch.gate</span>
<span class="key">entity_id</span>: <span class="string"><span class="content">switch.gate</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p>Or warn you if you leave your keys behind</p> <p>Or warn you if you leave your keys behind</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">automation</span><span class="pi">:</span>
<div class="code"><pre><span class="key">automation</span>: <span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s1">'</span><span class="s">Forgotten</span><span class="nv"> </span><span class="s">keys'</span>
- <span class="string"><span class="content">alias: 'Forgotten keys'</span></span> <span class="s">trigger</span><span class="pi">:</span>
<span class="key">trigger</span>: <span class="s">platform</span><span class="pi">:</span> <span class="s">template</span>
<span class="key">platform</span>: <span class="string"><span class="content">template</span></span> <span class="s">value_template</span><span class="pi">:</span> <span class="s1">'</span><span class="s">{{</span><span class="nv"> </span><span class="s">states.device_tracker.greg_gregphone.state</span><span class="nv"> </span><span class="s">!=</span><span class="nv"> </span><span class="s">states.device_tracker.beacon_keys.state}}'</span>
<span class="key">value_template</span>: <span class="string"><span class="content">'{{states.device_tracker.greg_gregphone.state != states.device_tracker.beacon_keys.state}}'</span></span> <span class="s">condition</span><span class="pi">:</span>
<span class="key">condition</span>: <span class="s">condition</span><span class="pi">:</span> <span class="s">template</span>
<span class="key">condition</span>: <span class="string"><span class="content">template</span></span> <span class="s">value_template</span><span class="pi">:</span> <span class="s1">'</span><span class="s">{{</span><span class="nv"> </span><span class="s">states.device_tracker.greg_gregphone.state</span><span class="nv"> </span><span class="s">!=</span><span class="nv"> </span><span class="s">"home"</span><span class="nv"> </span><span class="s">}}'</span>
<span class="key">value_template</span>: <span class="string"><span class="content">'{{ states.device_tracker.greg_gregphone.state != &quot;home&quot; }}'</span></span> <span class="s">action</span><span class="pi">:</span>
<span class="key">action</span>: <span class="s">service</span><span class="pi">:</span> <span class="s">script.turn_on</span>
<span class="key">service</span>: <span class="string"><span class="content">script.turn_on</span></span> <span class="s">entity_id</span><span class="pi">:</span> <span class="s">script.send_key_alert</span>
<span class="key">entity_id</span>: <span class="string"><span class="content">script.send_key_alert</span></span>
- <span class="string"><span class="content">alias: 'Forgotten keys - cancel'</span></span> <span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s1">'</span><span class="s">Forgotten</span><span class="nv"> </span><span class="s">keys</span><span class="nv"> </span><span class="s">-</span><span class="nv"> </span><span class="s">cancel'</span>
<span class="key">trigger</span>: <span class="s">trigger</span><span class="pi">:</span>
<span class="key">platform</span>: <span class="string"><span class="content">template</span></span> <span class="s">platform</span><span class="pi">:</span> <span class="s">template</span>
<span class="key">value_template</span>: <span class="string"><span class="content">'{{states.device_tracker.greg_gregphone.state == states.device_tracker.beacon_keys.state}}'</span></span> <span class="s">value_template</span><span class="pi">:</span> <span class="s1">'</span><span class="s">{{</span><span class="nv"> </span><span class="s">states.device_tracker.greg_gregphone.state</span><span class="nv"> </span><span class="s">==</span><span class="nv"> </span><span class="s">states.device_tracker.beacon_keys.state</span><span class="nv"> </span><span class="s">}}'</span>
<span class="key">condition</span>: <span class="s">condition</span><span class="pi">:</span>
- <span class="string"><span class="content">condition: state</span></span> <span class="pi">-</span> <span class="s">condition</span><span class="pi">:</span> <span class="s">state</span>
<span class="key">entity_id</span>: <span class="string"><span class="content">script.send_key_alert</span></span> <span class="s">entity_id</span><span class="pi">:</span> <span class="s">script.send_key_alert</span>
<span class="key">state</span>: <span class="string"><span class="content">'on'</span></span> <span class="s">state</span><span class="pi">:</span> <span class="s1">'</span><span class="s">on'</span>
<span class="key">action</span>: <span class="s">action</span><span class="pi">:</span>
<span class="key">service</span>: <span class="string"><span class="content">script.turn_off</span></span> <span class="s">service</span><span class="pi">:</span> <span class="s">script.turn_off</span>
<span class="key">entity_id</span>: <span class="string"><span class="content">script.send_key_alert</span></span> <span class="s">entity_id</span><span class="pi">:</span> <span class="s">script.send_key_alert</span>
</pre></div> </code></pre>
</div>
</div> </div>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">script</span><span class="pi">:</span>
<div class="code"><pre><span class="key">script</span>: <span class="s">send_key_alert</span><span class="pi">:</span>
<span class="key">send_key_alert</span>: <span class="s">sequence</span><span class="pi">:</span>
<span class="key">sequence</span>: <span class="pi">-</span> <span class="s">delay</span><span class="pi">:</span>
- <span class="string"><span class="content">delay:</span><span class="content"> <span class="s">minutes</span><span class="pi">:</span> <span class="s">2</span>
minutes: 2</span></span> <span class="pi">-</span> <span class="s">service</span><span class="pi">:</span> <span class="s">notify.notify</span>
- <span class="string"><span class="content">service: notify.notify</span></span> <span class="s">data</span><span class="pi">:</span>
<span class="key">data</span>: <span class="s">message</span><span class="pi">:</span> <span class="s1">'</span><span class="s">You</span><span class="nv"> </span><span class="s">forgot</span><span class="nv"> </span><span class="s">your</span><span class="nv"> </span><span class="s">keys'</span>
<span class="key">message</span>: <span class="string"><span class="content">'You forgot your keys'</span></span> <span class="s">target</span><span class="pi">:</span> <span class="s1">'</span><span class="s">device/gregs_iphone'</span>
<span class="key">target</span>: <span class="string"><span class="content">'device/gregs_iphone'</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p>(The delay is needed for two reasons: -<br /> <p>(The delay is needed for two reasons: -</p>
1. HA updates the beacon and phone locations at slightly different times - so you dont want the automation to trigger in the gap between the updates<br /> <ol>
2. Ive found that beacons (especially the low power Estimote Nearables) can get disconnected for a few seconds so its best to wait a minute or so before deciding that youve left your keys behind)</p> <li>HA updates the beacon and phone locations at slightly different times - so you dont want the automation to trigger in the gap between the updates</li>
<li>Ive found that beacons (especially the low power Estimote Nearables) can get disconnected for a few seconds so its best to wait a minute or so before deciding that youve left your keys behind)</li>
</ol>
<h3><a class="title-link" name="using-both-types-of-ibeacons-at-the-same-time" href="#using-both-types-of-ibeacons-at-the-same-time"></a> Using both types of iBeacons at the same time</h3> <h3><a class="title-link" name="using-both-types-of-ibeacons-at-the-same-time" href="#using-both-types-of-ibeacons-at-the-same-time"></a> Using both types of iBeacons at the same time</h3>
<p>Of course you can use both fixed and mobile beacons at the same time. I want my gates to open when I arrive home in the car - so I use an iBeacon in the car so that I can track the car, and a iBeacon on my drive so that a location update is triggered when I arrive. Ive been experimenting with a high power beacon in a waterproof box on my drive which seems to work well to notice when I get home.</p> <p>Of course you can use both fixed and mobile beacons at the same time. I want my gates to open when I arrive home in the car - so I use an iBeacon in the car so that I can track the car, and a iBeacon on my drive so that a location update is triggered when I arrive. Ive been experimenting with a high power beacon in a waterproof box on my drive which seems to work well to notice when I get home.</p>
@ -332,7 +328,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,9 +93,9 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/community/'>Community</a></li> <li>Community</li>
<li><a class='category' href='/blog/categories/video/'>Video</a></li> <li>Video</li>
</ul> </ul>
@ -208,7 +208,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -142,7 +142,7 @@
<ul> <ul>
<li>Our work in the WSGI stack is not fully done yet. We still have a minor issues where retrieving the error log in the about screen can raise an encoding error</li> <li>Our work in the WSGI stack is not fully done yet. We still have a minor issues where retrieving the error log in the about screen can raise an encoding error</li>
<li>The API used to incorrectly accept a JSON body with form-url-encoded headers. Our cURL examples on the website used to be wrong and have <a href="/developers/rest_api/">been updated</a>.</li> <li>The API used to incorrectly accept a JSON body with form-url-encoded headers. Our cURL examples on the website used to be wrong and have <a href="/developers/rest_api/">been updated</a>.</li>
<li>Make sure your configuration.yaml file contains <code>frontend:</code> to serve the frontend</li> <li>Make sure your configuration.yaml file contains <code class="highlighter-rouge">frontend:</code> to serve the frontend</li>
</ul> </ul>
<h3>Hotfixes 0.21.1 and 0.21.2</h3> <h3>Hotfixes 0.21.1 and 0.21.2</h3>
@ -242,7 +242,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/video/'>Video</a></li> <li>Video</li>
</ul> </ul>
@ -213,7 +213,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -149,14 +149,12 @@
<li>The new Netatmo support caused us to change how Netatmo are configured. Its now done via its own component.</li> <li>The new Netatmo support caused us to change how Netatmo are configured. Its now done via its own component.</li>
</ul> </ul>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">netatmo</span><span class="pi">:</span>
<div class="code"><pre><span class="key">netatmo</span>: <span class="s">api_key</span><span class="pi">:</span> <span class="s">API_KEY</span>
<span class="key">api_key</span>: <span class="string"><span class="content">API_KEY</span></span> <span class="s">secret_key</span><span class="pi">:</span> <span class="s">SECRET_KEY</span>
<span class="key">secret_key</span>: <span class="string"><span class="content">SECRET_KEY</span></span> <span class="s">username</span><span class="pi">:</span> <span class="s">username</span>
<span class="key">username</span>: <span class="string"><span class="content">username</span></span> <span class="s">password</span><span class="pi">:</span> <span class="s">password</span>
<span class="key">password</span>: <span class="string"><span class="content">password</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<h3><a class="title-link" name="hotfix-0221---june-20" href="#hotfix-0221---june-20"></a> Hotfix 0.22.1 - June 20</h3> <h3><a class="title-link" name="hotfix-0221---june-20" href="#hotfix-0221---june-20"></a> Hotfix 0.22.1 - June 20</h3>
@ -237,7 +235,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/how-to/'>How-To</a></li> <li>How-To</li>
</ul> </ul>
@ -108,7 +108,7 @@
</header> </header>
<p><img src="/images/blog/2016-06-cranberry/motion.png" style="clear: right; border:none; box-shadow: none; float: right; margin-bottom: 12px;" width="200" /><br /> <p><img src="/images/blog/2016-06-cranberry/motion.png" style="clear: right; border:none; box-shadow: none; float: right; margin-bottom: 12px;" width="200" />
In the past month I was thinking about ways to integrate USB webcams into Home Assistant again. The main reason was that this would give those devices a second life and enable one to benefit from low-cost video surveillance. There are a couple of options available like <a href="http://www.pygame.org/hifi.html">pygame</a> or <a href="http://www.simplecv.org/">SimpleCV</a> but I never finished something. With the <a href="https://home-assistant.io/components/camera.local_file/">Local File camera platform</a> by <a href="https://github.com/Landrash">Landrash</a> and <a href="http://lavrsen.dk/foswiki/bin/view/Motion/WebHome">motion</a> you could integrate a local USB webcam with a few very easy steps.</p> In the past month I was thinking about ways to integrate USB webcams into Home Assistant again. The main reason was that this would give those devices a second life and enable one to benefit from low-cost video surveillance. There are a couple of options available like <a href="http://www.pygame.org/hifi.html">pygame</a> or <a href="http://www.simplecv.org/">SimpleCV</a> but I never finished something. With the <a href="https://home-assistant.io/components/camera.local_file/">Local File camera platform</a> by <a href="https://github.com/Landrash">Landrash</a> and <a href="http://lavrsen.dk/foswiki/bin/view/Motion/WebHome">motion</a> you could integrate a local USB webcam with a few very easy steps.</p>
<p>In this blog post I am using a Fedora 24 (will most likely work on other distributions too) installation with Home Assistant 0.22.1 on a Foxconn nT-330i with an old <a href="http://support.logitech.com/en_us/product/quickcam-sphere-af">Logitech QuickCam Orbit AF</a> and a <a href="http://support.logitech.com/en_us/product/hd-webcam-c270">Logitech HD Webcam C270</a>. As a start only the Quickcam is used. No multi-camera setup for now.</p> <p>In this blog post I am using a Fedora 24 (will most likely work on other distributions too) installation with Home Assistant 0.22.1 on a Foxconn nT-330i with an old <a href="http://support.logitech.com/en_us/product/quickcam-sphere-af">Logitech QuickCam Orbit AF</a> and a <a href="http://support.logitech.com/en_us/product/hd-webcam-c270">Logitech HD Webcam C270</a>. As a start only the Quickcam is used. No multi-camera setup for now.</p>
@ -117,98 +117,86 @@ In the past month I was thinking about ways to integrate USB webcams into Home A
<p>Check first if the your operating system lists your cameras.</p> <p>Check first if the your operating system lists your cameras.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>lsusb
<div class="code"><pre>$ lsusb <span class="o">[</span>...]
[...] Bus 002 Device 016: ID 046d:08cc Logitech, Inc. Mic <span class="o">(</span>PTZ<span class="o">)</span>
Bus 002 Device 016: ID 046d:08cc Logitech, Inc. Mic (PTZ) <span class="o">[</span>...]
[...] </code></pre>
</pre></div>
</div>
</div> </div>
<p>The camera we are going to use is available at <code>/dev/video1</code>. The C270 is the one on <code>/dev/video0</code>.</p> <p>The camera we are going to use is available at <code class="highlighter-rouge">/dev/video1</code>. The C270 is the one on <code class="highlighter-rouge">/dev/video0</code>.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>ls -al /dev/video<span class="k">*</span>
<div class="code"><pre>$ ls -al /dev/video*
crw-rw----+ 1 root video 81, 0 Jun 23 08:05 /dev/video0 crw-rw----+ 1 root video 81, 0 Jun 23 08:05 /dev/video0
crw-rw----+ 1 root video 81, 1 Jun 23 08:36 /dev/video1 crw-rw----+ 1 root video 81, 1 Jun 23 08:36 /dev/video1
</pre></div> </code></pre>
</div>
</div> </div>
<p>We need an additional software part to handle the cameras. <a href="http://lavrsen.dk/foswiki/bin/view/Motion/WebHome">motion</a> is capable of monitoring the video signal from USB and network cameras, do motion detection, and other nifty stuff like saving images, add text, or basic image manipulations. Make sure that you have the <a href="http://rpmfusion.org/">RPM Fusion respository</a> enabled.</p> <p>We need an additional software part to handle the cameras. <a href="http://lavrsen.dk/foswiki/bin/view/Motion/WebHome">motion</a> is capable of monitoring the video signal from USB and network cameras, do motion detection, and other nifty stuff like saving images, add text, or basic image manipulations. Make sure that you have the <a href="http://rpmfusion.org/">RPM Fusion respository</a> enabled.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sudo dnf -y install motion
<div class="code"><pre>$ sudo dnf -y install motion </code></pre>
</pre></div>
</div>
</div> </div>
<p>For our setup we need to modify the file <code>/etc/motion/motion.conf</code>. For now the most important parameters are <code>videodevice</code>, <code>snapshot_interval</code>, and <code>target_dir</code>. The other settings can be left to their defaults. We are going to use the device <code>/dev/video1</code>, use a 30 seconds interval, and set the path to <code>/tmp</code>.</p> <p>For our setup we need to modify the file <code class="highlighter-rouge">/etc/motion/motion.conf</code>. For now the most important parameters are <code class="highlighter-rouge">videodevice</code>, <code class="highlighter-rouge">snapshot_interval</code>, and <code class="highlighter-rouge">target_dir</code>. The other settings can be left to their defaults. We are going to use the device <code class="highlighter-rouge">/dev/video1</code>, use a 30 seconds interval, and set the path to <code class="highlighter-rouge">/tmp</code>.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="o">[</span>...]
<div class="code"><pre>[...] <span class="c">###########################################################</span>
########################################################### <span class="c"># Capture device options</span>
# Capture device options <span class="c">############################################################</span>
############################################################
# Videodevice to be used for capturing (default /dev/video0) <span class="c"># Videodevice to be used for capturing (default /dev/video0)</span>
# for FreeBSD default is /dev/bktr0 <span class="c"># for FreeBSD default is /dev/bktr0</span>
videodevice /dev/video1 videodevice /dev/video1
[..] <span class="o">[</span>..]
############################################################ <span class="c">############################################################</span>
# Snapshots (Traditional Periodic Webcam File Output) <span class="c"># Snapshots (Traditional Periodic Webcam File Output)</span>
############################################################ <span class="c">############################################################</span>
# Make automated snapshot every N seconds (default: 0 = disabled) <span class="c"># Make automated snapshot every N seconds (default: 0 = disabled)</span>
snapshot_interval 30 snapshot_interval 30
[...] <span class="o">[</span>...]
############################################################ <span class="c">############################################################</span>
# Target Directories and filenames For Images And Films <span class="c"># Target Directories and filenames For Images And Films</span>
# For the options snapshot_, picture_, movie_ and timelapse_filename <span class="c"># For the options snapshot_, picture_, movie_ and timelapse_filename</span>
# you can use conversion specifiers <span class="c"># you can use conversion specifiers</span>
# %Y = year, %m = month, %d = date, <span class="c"># %Y = year, %m = month, %d = date,</span>
# %H = hour, %M = minute, %S = second, <span class="c"># %H = hour, %M = minute, %S = second,</span>
# %v = event, %q = frame number, %t = thread (camera) number, <span class="c"># %v = event, %q = frame number, %t = thread (camera) number,</span>
# %D = changed pixels, %N = noise level, <span class="c"># %D = changed pixels, %N = noise level,</span>
# %i and %J = width and height of motion area, <span class="c"># %i and %J = width and height of motion area,</span>
# %K and %L = X and Y coordinates of motion center <span class="c"># %K and %L = X and Y coordinates of motion center</span>
# %C = value defined by text_event <span class="c"># %C = value defined by text_event</span>
# Quotation marks round string are allowed. <span class="c"># Quotation marks round string are allowed.</span>
############################################################ <span class="c">############################################################</span>
# Target base directory for pictures and films <span class="c"># Target base directory for pictures and films</span>
# Recommended to use absolute path. (Default: current working directory) <span class="c"># Recommended to use absolute path. (Default: current working directory)</span>
target_dir /tmp target_dir /tmp
[...] <span class="o">[</span>...]
</pre></div> </code></pre>
</div>
</div> </div>
<p>Its suggested that you adjust at least <code>width</code> and <code>height</code> to get a bigger image from your camera. If you are done, fire up <code>motion</code>.</p> <p>Its suggested that you adjust at least <code class="highlighter-rouge">width</code> and <code class="highlighter-rouge">height</code> to get a bigger image from your camera. If you are done, fire up <code class="highlighter-rouge">motion</code>.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sudo motion
<div class="code"><pre>$ sudo motion <span class="o">[</span>0] <span class="o">[</span>NTC] <span class="o">[</span>ALL] conf_load: Processing thread 0 - config file /etc/motion/motion.conf
[0] [NTC] [ALL] conf_load: Processing thread 0 - config file /etc/motion/motion.conf <span class="o">[</span>0] <span class="o">[</span>ALR] <span class="o">[</span>ALL] conf_cmdparse: Unknown config option <span class="s2">"sdl_threadnr"</span>
[0] [ALR] [ALL] conf_cmdparse: Unknown config option &quot;sdl_threadnr&quot; <span class="o">[</span>0] <span class="o">[</span>NTC] <span class="o">[</span>ALL] motion_startup: Motion 3.3.0 Started
[0] [NTC] [ALL] motion_startup: Motion 3.3.0 Started <span class="o">[</span>0] <span class="o">[</span>NTC] <span class="o">[</span>ALL] motion_startup: Logging to file <span class="o">(</span>/var/log/motion.log<span class="o">)</span>
[0] [NTC] [ALL] motion_startup: Logging to file (/var/log/motion.log) </code></pre>
</pre></div>
</div>
</div> </div>
<p>Your <code>target_dir</code> will start filling up with images from your camera. <code>motion</code> will create a symlink called <code>lastsnap.jpg</code> which always point to the latest snapshot. We will setup the <a href="https://home-assistant.io/components/camera.local_file/">Local File camera platform</a> to use this file.</p> <p>Your <code class="highlighter-rouge">target_dir</code> will start filling up with images from your camera. <code class="highlighter-rouge">motion</code> will create a symlink called <code class="highlighter-rouge">lastsnap.jpg</code> which always point to the latest snapshot. We will setup the <a href="https://home-assistant.io/components/camera.local_file/">Local File camera platform</a> to use this file.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">camera</span><span class="pi">:</span>
<div class="code"><pre><span class="key">camera</span>: <span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">local_file</span>
- <span class="string"><span class="content">platform: local_file</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s">Cranberry cam</span>
<span class="key">name</span>: <span class="string"><span class="content">Cranberry cam</span></span> <span class="s">file_path</span><span class="pi">:</span> <span class="s">/tmp/lastsnap.jpg</span>
<span class="key">file_path</span>: <span class="string"><span class="content">/tmp/lastsnap.jpg</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p class="img"> <p class="img">
@ -216,20 +204,18 @@ target_dir /tmp
The “Cranberry cam” in action The “Cranberry cam” in action
</p> </p>
<p>The machine with the attached USB camera will become a webcam server as well because <code>motion</code>s built-in HTTP server is enabled by default. This means that you could connect your USB webcams to a different machine in your network, run <code>motion</code> there, adjust your firewall rules, and use Home Assistant to display the videos. Just check http://[IP of your webcam host]:8081/ to see the stream. This required more powerful hardware than using snapshots, of course.</p> <p>The machine with the attached USB camera will become a webcam server as well because <code class="highlighter-rouge">motion</code>s built-in HTTP server is enabled by default. This means that you could connect your USB webcams to a different machine in your network, run <code class="highlighter-rouge">motion</code> there, adjust your firewall rules, and use Home Assistant to display the videos. Just check http://[IP of your webcam host]:8081/ to see the stream. This required more powerful hardware than using snapshots, of course.</p>
<p>In a scenario like this needs a <a href="https://home-assistant.io/components/camera.mjpeg/">Generic MJPEG IP Camera </a> in your <code>configuration.yaml</code> file.</p> <p>In a scenario like this needs a <a href="https://home-assistant.io/components/camera.mjpeg/">Generic MJPEG IP Camera </a> in your <code class="highlighter-rouge">configuration.yaml</code> file.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">camera</span><span class="pi">:</span>
<div class="code"><pre><span class="key">camera</span>: <span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">mjpeg</span>
- <span class="string"><span class="content">platform: mjpeg</span></span> <span class="s">mjpeg_url</span><span class="pi">:</span> <span class="s">http://[IP of your webcam host]:8081</span>
<span class="key">mjpeg_url</span>: <span class="string"><span class="content">http://[IP of your webcam host]:8081</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s">Cranberry Live cam</span>
<span class="key">name</span>: <span class="string"><span class="content">Cranberry Live cam</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
<p><a href="http://lavrsen.dk/foswiki/bin/view/Motion/WebHome">motion</a> is a powerful tool and this blog post only showed two very simple use cases. Take a look at the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuide">documentation</a> of <code>motion</code> to unleash its potential.</p> <p><a href="http://lavrsen.dk/foswiki/bin/view/Motion/WebHome">motion</a> is a powerful tool and this blog post only showed two very simple use cases. Take a look at the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuide">documentation</a> of <code class="highlighter-rouge">motion</code> to unleash its potential.</p>
</article> </article>
@ -303,7 +289,7 @@ target_dir /tmp
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -161,7 +161,7 @@
<h3><a class="title-link" name="faq" href="#faq"></a> FAQ</h3> <h3><a class="title-link" name="faq" href="#faq"></a> FAQ</h3>
<ul> <ul>
<li><code>elevation: </code> was introduced to the configuration for weather/sunrise data. For existing <a href="https://home-assistant.io/getting-started/basic/">configurations</a> add the value shown in the warning <code>[homeassistant.config] Incomplete core config. Auto detected elevation: 665</code> to your <code>configuration.yaml</code> file.</li> <li><code class="highlighter-rouge">elevation: </code> was introduced to the configuration for weather/sunrise data. For existing <a href="https://home-assistant.io/getting-started/basic/">configurations</a> add the value shown in the warning <code class="highlighter-rouge">[homeassistant.config] Incomplete core config. Auto detected elevation: 665</code> to your <code class="highlighter-rouge">configuration.yaml</code> file.</li>
</ul> </ul>
</article> </article>
@ -236,7 +236,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/how-to/'>How-To</a></li> <li>How-To</li>
</ul> </ul>
@ -108,7 +108,7 @@
</header> </header>
<p><img src="/images/blog/2016-07-pocketchip/pocketchip-logo.png" style="clear: right; border:none; box-shadow: none; float: right; margin-bottom: 12px;" width="200" /><br /> <p><img src="/images/blog/2016-07-pocketchip/pocketchip-logo.png" style="clear: right; border:none; box-shadow: none; float: right; margin-bottom: 12px;" width="200" />
Over a year ago I participated in the <a href="https://www.kickstarter.com/projects/1598272670/chip-the-worlds-first-9-computer/description">kickstarter campaign</a> for “CHIP - The Worlds First Nine Dollar Computer” by <a href="https://www.nextthing.co/">Next Thing Co.</a>. I went for the PocketCHIP because of the idea. Display, built-in storage (thus no need for SD cards), battery-powered, and a keyboard are pretty nice features. Last week a package arrives…</p> Over a year ago I participated in the <a href="https://www.kickstarter.com/projects/1598272670/chip-the-worlds-first-9-computer/description">kickstarter campaign</a> for “CHIP - The Worlds First Nine Dollar Computer” by <a href="https://www.nextthing.co/">Next Thing Co.</a>. I went for the PocketCHIP because of the idea. Display, built-in storage (thus no need for SD cards), battery-powered, and a keyboard are pretty nice features. Last week a package arrives…</p>
<a name="read-more"></a> <a name="read-more"></a>
@ -122,43 +122,35 @@ Over a year ago I participated in the <a href="https://www.kickstarter.com/proje
<p>If you start using a PocketCHIP you will definitely look like a Blackberry or a GameBoy user. Typing is done with your thumbs :-)</p> <p>If you start using a PocketCHIP you will definitely look like a Blackberry or a GameBoy user. Typing is done with your thumbs :-)</p>
<p>First a couple of tweaks like setting up <code>sudo</code>, upgrading the existing installation, change passwords, enabling ssh, and removal of the annoying stuff then installation of Home Assistant. There is not much to tell…its straight-forward. For the sake of completeness below the notes about what I did.</p> <p>First a couple of tweaks like setting up <code class="highlighter-rouge">sudo</code>, upgrading the existing installation, change passwords, enabling ssh, and removal of the annoying stuff then installation of Home Assistant. There is not much to tell…its straight-forward. For the sake of completeness below the notes about what I did.</p>
<p>A Debian installation is available by default. This means that some dependencies for Home Assistant are missing. I havent checked if a new build for the PocketCHIP would include them. So, after a <code>$ sudo apt-get update</code> installing those dependencies take a minute or two.</p> <p>A Debian installation is available by default. This means that some dependencies for Home Assistant are missing. I havent checked if a new build for the PocketCHIP would include them. So, after a <code class="highlighter-rouge">$ sudo apt-get update</code> installing those dependencies take a minute or two.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sudo apt-get install python3-dev python3-pip python3-venv
<div class="code"><pre>$ sudo apt-get install python3-dev python3-pip python3-venv </code></pre>
</pre></div>
</div>
</div> </div>
<p>As usual I run Python applications in a <a href="https://docs.python.org/3/library/venv.html">venv</a>.</p> <p>As usual I run Python applications in a <a href="https://docs.python.org/3/library/venv.html">venv</a>.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>pvenv ha
<div class="code"><pre>$ pvenv ha </code></pre>
</pre></div>
</div>
</div> </div>
<p>Lets activate the created environment.</p> <p>Lets activate the created environment.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span><span class="nb">cd </span>ha
<div class="code"><pre>$ cd ha <span class="gp">$ </span><span class="nb">source </span>bin/activate
$ source bin/activate </code></pre>
</pre></div>
</div>
</div> </div>
<p>If you havent seen the next two commands already then you should visit our <a href="https://home-assistant.io/">frontsite</a>.</p> <p>If you havent seen the next two commands already then you should visit our <a href="https://home-assistant.io/">frontsite</a>.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>pip3 install homeassistant
<div class="code"><pre>$ pip3 install homeassistant <span class="gp">$ </span>hass --open-ui
$ hass --open-ui </code></pre>
</pre></div>
</div>
</div> </div>
<p>With <code>surf</code> the browsing experience on the low-resolution display is not that great. Most smartphones, even very cheap ones, have touchscreens with higher resolutions. Nevermind, <a href="https://twitter.com/fabaff/status/748852317047418880"><code>midori</code></a> is not better.</p> <p>With <code class="highlighter-rouge">surf</code> the browsing experience on the low-resolution display is not that great. Most smartphones, even very cheap ones, have touchscreens with higher resolutions. Nevermind, <a href="https://twitter.com/fabaff/status/748852317047418880"><code class="highlighter-rouge">midori</code></a> is not better.</p>
<p class="img"> <p class="img">
<img src="/images/blog/2016-07-pocketchip/pocketchip.png" /> <img src="/images/blog/2016-07-pocketchip/pocketchip.png" />
@ -239,7 +231,7 @@ $ hass --open-ui
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -114,14 +114,12 @@
<p><a href="https://github.com/rhooper/">Roy Hooper</a> did an amazing job migrating the history support from being tied to SQLite to use the ORM SQLAlchemy instead. This means that you can now use <strong>any</strong> SQL backend for the history. So besides SQLite you can now databases like MySQL or PostgreSQL. However, this does require that you install <a href="http://www.sqlalchemy.org/">SQLAlchemy</a> and run a command to migrate your existing history over. We tried to make the process as seamless as possible by introducing a new command line script:</p> <p><a href="https://github.com/rhooper/">Roy Hooper</a> did an amazing job migrating the history support from being tied to SQLite to use the ORM SQLAlchemy instead. This means that you can now use <strong>any</strong> SQL backend for the history. So besides SQLite you can now databases like MySQL or PostgreSQL. However, this does require that you install <a href="http://www.sqlalchemy.org/">SQLAlchemy</a> and run a command to migrate your existing history over. We tried to make the process as seamless as possible by introducing a new command line script:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>pip3 install SQLAlchemy
<div class="code"><pre>$ pip3 install SQLAlchemy <span class="gp">$ </span>hass --script db_migrator --config /path/to/config
$ hass --script db_migrator --config /path/to/config </code></pre>
</pre></div>
</div>
</div> </div>
<p>You can omit the <code>--config</code> option if you use the default configuration directory. Run the script with <code>--help</code> to get more options.</p> <p>You can omit the <code class="highlighter-rouge">--config</code> option if you use the default configuration directory. Run the script with <code class="highlighter-rouge">--help</code> to get more options.</p>
<p><img src="/images/supported_brands/yahooweather.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="150" /><img src="/images/supported_brands/joaoapps_join.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="150" /><img src="/images/supported_brands/knx.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="150" /><img src="/images/supported_brands/tp-link.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="150" /></p> <p><img src="/images/supported_brands/yahooweather.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="150" /><img src="/images/supported_brands/joaoapps_join.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="150" /><img src="/images/supported_brands/knx.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="150" /><img src="/images/supported_brands/tp-link.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="150" /></p>
@ -138,7 +136,7 @@ $ hass --script db_migrator --config /path/to/config
<li><a href="/components/statsd/">StatsD</a> can now also export attributes (<a href="https://github.com/bah2830/">@bah2830</a>)</li> <li><a href="/components/statsd/">StatsD</a> can now also export attributes (<a href="https://github.com/bah2830/">@bah2830</a>)</li>
<li>Support for <a href="/components/knx/">KNX</a> added (<a href="https://github.com/usul27">@usul27</a>)</li> <li>Support for <a href="/components/knx/">KNX</a> added (<a href="https://github.com/usul27">@usul27</a>)</li>
<li>Switch: <a href="/components/switch.tplink/">TPLink</a> HS100/HS110 now supported (<a href="https://github.com/GadgetReactor">@GadgetReactor</a>)</li> <li>Switch: <a href="/components/switch.tplink/">TPLink</a> HS100/HS110 now supported (<a href="https://github.com/GadgetReactor">@GadgetReactor</a>)</li>
<li>Stability fixes for <a href="//components/rfxtrx/">RFXtrx</a> ([@Danielhiversen])</li> <li>Stability fixes for <a href="//components/rfxtrx/">RFXtrx</a> (<a href="https://github.com/danielhiversen">@Danielhiversen</a>)</li>
<li>Tweaks to <a href="/components/zwave/">Z-Wave</a> (<a href="https://github.com/turbokongen/">@turbokongen</a>)</li> <li>Tweaks to <a href="/components/zwave/">Z-Wave</a> (<a href="https://github.com/turbokongen/">@turbokongen</a>)</li>
<li>Light: <a href="/components/light/">Brightness</a> now clamped to 0-255 (<a href="https://github.com/keatontaylor">@keatontaylor</a>)</li> <li>Light: <a href="/components/light/">Brightness</a> now clamped to 0-255 (<a href="https://github.com/keatontaylor">@keatontaylor</a>)</li>
<li>Thermostat: <a href="/components/thermostat.radiotherm/">Radiotherm</a> HVAC mode now supported (<a href="https://github.com/danieljkemp">@danieljkemp</a>)</li> <li>Thermostat: <a href="/components/thermostat.radiotherm/">Radiotherm</a> HVAC mode now supported (<a href="https://github.com/danieljkemp">@danieljkemp</a>)</li>
@ -157,19 +155,31 @@ $ hass --script db_migrator --config /path/to/config
<ul> <ul>
<li>Migrating existing databases (see above).</li> <li>Migrating existing databases (see above).</li>
<li>The <a href="/components/sensor.apcupsd/">APCUPSd Sensor</a> was updated. This will need that you modify your <code>configuration.yaml</code> file.</li> <li>The <a href="/components/sensor.apcupsd/">APCUPSd Sensor</a> was updated. This will need that you modify your <code class="highlighter-rouge">configuration.yaml</code> file.</li>
<li>Entity IDs of Verisure locks will change. This is a one time change but should improve readability.</li> <li>Entity IDs of Verisure locks will change. This is a one time change but should improve readability.</li>
</ul> </ul>
<p>«««&lt; HEAD<br /> <p>«««&lt; HEAD
=======<br /> =======
[@n8henrie]: https://github.com/n8henrie/<br /> [@n8henrie]: https://github.com/n8henrie/
[@AlucardZero]: https://github.com/AlucardZero/<br /> [@AlucardZero]: https://github.com/AlucardZero/
«««&lt; HEAD<br /> «««&lt; HEAD</p>
»»»&gt; master<br /> <blockquote>
=======<br /> <blockquote>
[@Danielhiversen]: https://github.com/danielhiversen<br /> <blockquote>
»»»&gt; origin/master</p> <blockquote>
<blockquote>
<blockquote>
<blockquote>
<h1>master</h1>
<p>origin/master</p>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</article> </article>
@ -243,7 +253,7 @@ $ hass --script db_migrator --config /path/to/config
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -87,15 +87,15 @@
<div class="meta clearfix"> <div class="meta clearfix">
<time datetime="2016-07-19T16:00:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> July 19, 2016</time> <time datetime="2016-07-19T16:00:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> July 19, 2016</time>
<span class="byline author vcard"><i class='icon-user'></i> Fabian Affolter</span> <span class="byline author vcard"><i class='icon-user'></i> Fabian Affolter</span>
<span><i class='icon-time'></i> four minutes reading time</span> <span><i class='icon-time'></i> five minutes reading time</span>
<span> <span>
<i class="icon-tags"></i> <i class="icon-tags"></i>
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/how-to/'>How-To</a></li> <li>How-To</li>
<li><a class='category' href='/blog/categories/iot-data/'>IoT-Data</a></li> <li>IoT-Data</li>
</ul> </ul>
@ -118,37 +118,33 @@
<a name="read-more"></a> <a name="read-more"></a>
<p>In this blog post I use the temperature of the <a href="https://en.wikipedia.org/wiki/Aare">Aare</a> river close to where I live as a show case. The temperatures were recorded with the <a href="/components/sensor.swiss_hydrological_data/">Swiss Hydrological Data sensor</a> and the name of the sensor is <code>sensor.aare</code>.</p> <p>In this blog post I use the temperature of the <a href="https://en.wikipedia.org/wiki/Aare">Aare</a> river close to where I live as a show case. The temperatures were recorded with the <a href="/components/sensor.swiss_hydrological_data/">Swiss Hydrological Data sensor</a> and the name of the sensor is <code class="highlighter-rouge">sensor.aare</code>.</p>
<p>The database is stored at <code>&lt;path to config dir&gt;/.homeassistant/home-assistant_v2.db</code> as <a href="https://www.sqlite.org/">SQLite database</a>. In all examples we are going to use the path: <code>/home/ha/.homeassistant/home-assistant_v2.db</code></p> <p>The database is stored at <code class="highlighter-rouge">&lt;path to config dir&gt;/.homeassistant/home-assistant_v2.db</code> as <a href="https://www.sqlite.org/">SQLite database</a>. In all examples we are going to use the path: <code class="highlighter-rouge">/home/ha/.homeassistant/home-assistant_v2.db</code></p>
<p>If you are just curious whats stored in your database then you can use the <code>sqlite3</code> command-line tool or a graphical one like <a href="http://sqlitebrowser.org/">DB Browser for SQLite</a>.</p> <p>If you are just curious whats stored in your database then you can use the <code class="highlighter-rouge">sqlite3</code> command-line tool or a graphical one like <a href="http://sqlitebrowser.org/">DB Browser for SQLite</a>.</p>
<p>The table that is holding the states is called <code>states</code>. The <code>events</code> tables is responsible for storing the events which occurred. So, we will first check how many entries there are in the <code>states</code> table. <code>sqlite3</code> needs to know where the databases is located. To work with your database make sure that Home Assistant is not running or create a copy of the existing database. Its recommended to work with a copy.</p> <p>The table that is holding the states is called <code class="highlighter-rouge">states</code>. The <code class="highlighter-rouge">events</code> tables is responsible for storing the events which occurred. So, we will first check how many entries there are in the <code class="highlighter-rouge">states</code> table. <code class="highlighter-rouge">sqlite3</code> needs to know where the databases is located. To work with your database make sure that Home Assistant is not running or create a copy of the existing database. Its recommended to work with a copy.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sqlite3 /home/ha/.homeassistant/home-assistant_v2.db
<div class="code"><pre>$ sqlite3 /home/ha/.homeassistant/home-assistant_v2.db
SQLite version 3.11.0 2016-02-15 17:29:24 SQLite version 3.11.0 2016-02-15 17:29:24
sqlite&gt; SELECT count(*) FROM states; <span class="gp">sqlite&gt; </span>SELECT count<span class="o">(</span><span class="k">*</span><span class="o">)</span> FROM states;
24659 24659
</pre></div> </code></pre>
</div>
</div> </div>
<p>Lets have a look at a sample <a href="https://en.wikipedia.org/wiki/SQL">SQL</a> query. This query will show all states in a period for the sensor <code>sensor.aare</code>.</p> <p>Lets have a look at a sample <a href="https://en.wikipedia.org/wiki/SQL">SQL</a> query. This query will show all states in a period for the sensor <code class="highlighter-rouge">sensor.aare</code>.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-sql highlighter-rouge"><pre class="highlight"><code><span class="k">SELECT</span> <span class="k">state</span><span class="p">,</span> <span class="n">last_changed</span> <span class="k">FROM</span> <span class="n">states</span>
<div class="code"><pre><span class="class">SELECT</span> state, last_changed <span class="keyword">FROM</span> states <span class="k">WHERE</span>
<span class="keyword">WHERE</span> <span class="n">entity_id</span> <span class="o">=</span> <span class="s1">'sensor.aare'</span>
entity_id = <span class="string"><span class="delimiter">'</span><span class="content">sensor.aare</span><span class="delimiter">'</span></span> <span class="k">AND</span>
<span class="keyword">AND</span> <span class="n">last_changed</span> <span class="k">BETWEEN</span>
last_changed <span class="keyword">BETWEEN</span> <span class="s1">'2016-07-05 00:00:00.000000'</span> <span class="k">AND</span> <span class="s1">'2016-07-07 00:00:00.000000'</span><span class="p">;</span>
<span class="string"><span class="delimiter">'</span><span class="content">2016-07-05 00:00:00.000000</span><span class="delimiter">'</span></span> <span class="keyword">AND</span> <span class="string"><span class="delimiter">'</span><span class="content">2016-07-07 00:00:00.000000</span><span class="delimiter">'</span></span>; </code></pre>
</pre></div>
</div>
</div> </div>
<p>The SQL statement can be formed that it fits exactly what you need. This means that you can process the data in any way you want for further use. Often it makes sense to eliminate certain entries like <code>Unknown</code> or peaks.</p> <p>The SQL statement can be formed that it fits exactly what you need. This means that you can process the data in any way you want for further use. Often it makes sense to eliminate certain entries like <code class="highlighter-rouge">Unknown</code> or peaks.</p>
<p>If the above query is executed in DB Browser for SQLite you would be able to save the sensors graph as png.</p> <p>If the above query is executed in DB Browser for SQLite you would be able to save the sensors graph as png.</p>
@ -159,13 +155,11 @@ sqlite&gt; SELECT count(*) FROM states;
<p>You may ask: Why not do this with LibreOffice Calc or another spreadsheet application? As most spreadsheet applications are not able to work directly with SQLite database we are going to export the data from the database to <a href="https://en.wikipedia.org/wiki/Comma-separated_values">CSV</a>.</p> <p>You may ask: Why not do this with LibreOffice Calc or another spreadsheet application? As most spreadsheet applications are not able to work directly with SQLite database we are going to export the data from the database to <a href="https://en.wikipedia.org/wiki/Comma-separated_values">CSV</a>.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sqlite3 -header -csv /home/ha/.homeassistant/home-assistant_v2.db <span class="s2">"SELECT last_changed, state FROM states WHERE entity_id = 'sensor.aare' AND last_changed BETWEEN '2016-07-05 00:00:00.000000' AND '2016-07-07 00:00:00.000000';"</span> &gt; sensor.csv
<div class="code"><pre>$ sqlite3 -header -csv /home/ha/.homeassistant/home-assistant_v2.db &quot;SELECT last_changed, state FROM states WHERE entity_id = 'sensor.aare' AND last_changed BETWEEN '2016-07-05 00:00:00.000000' AND '2016-07-07 00:00:00.000000';&quot; &gt; sensor.csv </code></pre>
</pre></div>
</div>
</div> </div>
<p>The ordering for the <code>SELECT</code> was changed to get the time stamps first and then the state. Now we can import the CSV file into the application of your choice, here its LibreOffice Calc.</p> <p>The ordering for the <code class="highlighter-rouge">SELECT</code> was changed to get the time stamps first and then the state. Now we can import the CSV file into the application of your choice, here its LibreOffice Calc.</p>
<p class="img"> <p class="img">
<img src="/images/blog/2016-07-reporting/libreoffice-import.png" /> <img src="/images/blog/2016-07-reporting/libreoffice-import.png" />
@ -181,33 +175,31 @@ sqlite&gt; SELECT count(*) FROM states;
<p>You can also use <a href="http://matplotlib.org/">matplotlib</a> to generate graphs as an alternative to a spreadsheet application. This is a powerful Python 2D plotting library. With the built-in support for SQLite in Python it will only take a couple lines of code to visualize your data.</p> <p>You can also use <a href="http://matplotlib.org/">matplotlib</a> to generate graphs as an alternative to a spreadsheet application. This is a powerful Python 2D plotting library. With the built-in support for SQLite in Python it will only take a couple lines of code to visualize your data.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-python highlighter-rouge"><pre class="highlight"><code><span class="kn">import</span> <span class="nn">sqlite3</span>
<div class="code"><pre><span class="keyword">import</span> <span class="include">sqlite3</span> <span class="kn">from</span> <span class="nn">matplotlib</span> <span class="kn">import</span> <span class="n">dates</span>
<span class="keyword">from</span> <span class="include">matplotlib</span> <span class="keyword">import</span> <span class="include">dates</span> <span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="kn">as</span> <span class="nn">plt</span>
<span class="keyword">import</span> <span class="include">matplotlib.pyplot</span> <span class="keyword">as</span> plt
<span class="keyword">import</span> <span class="include">homeassistant.util.dt</span> <span class="keyword">as</span> dt <span class="kn">import</span> <span class="nn">homeassistant.util.dt</span> <span class="kn">as</span> <span class="nn">dt</span>
values = [] <span class="n">values</span> <span class="o">=</span> <span class="p">[]</span>
timestamps = [] <span class="n">timestamps</span> <span class="o">=</span> <span class="p">[]</span>
conn = sqlite3.connect(<span class="string"><span class="delimiter">'</span><span class="content">/home/ha/.homeassistant/home-assistant_v2.db</span><span class="delimiter">'</span></span>) <span class="n">conn</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">'/home/ha/.homeassistant/home-assistant_v2.db'</span><span class="p">)</span>
data = conn.execute(<span class="string"><span class="delimiter">&quot;</span><span class="content">SELECT state, last_changed FROM states WHERE </span><span class="delimiter">&quot;</span></span> <span class="n">data</span> <span class="o">=</span> <span class="n">conn</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"SELECT state, last_changed FROM states WHERE "</span>
<span class="string"><span class="delimiter">&quot;</span><span class="content">entity_id = 'sensor.aare' AND last_changed BETWEEN </span><span class="delimiter">&quot;</span></span> <span class="s">"entity_id = 'sensor.aare' AND last_changed BETWEEN "</span>
<span class="string"><span class="delimiter">&quot;</span><span class="content">'2016-07-05 00:00:00.000000' AND </span><span class="delimiter">&quot;</span></span> <span class="s">"'2016-07-05 00:00:00.000000' AND "</span>
<span class="string"><span class="delimiter">&quot;</span><span class="content">'2016-07-07 00:00:00.000000'</span><span class="delimiter">&quot;</span></span>) <span class="s">"'2016-07-07 00:00:00.000000'"</span><span class="p">)</span>
<span class="keyword">for</span> x <span class="keyword">in</span> data: <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">data</span><span class="p">:</span>
timestamps.append(dates.date2num(dt.parse_datetime(x[<span class="integer">1</span>]))) <span class="n">timestamps</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">dates</span><span class="o">.</span><span class="n">date2num</span><span class="p">(</span><span class="n">dt</span><span class="o">.</span><span class="n">parse_datetime</span><span class="p">(</span><span class="n">x</span><span class="p">[</span><span class="mi">1</span><span class="p">])))</span>
values.append(<span class="predefined">float</span>(x[<span class="integer">0</span>])) <span class="n">values</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="nb">float</span><span class="p">(</span><span class="n">x</span><span class="p">[</span><span class="mi">0</span><span class="p">]))</span>
plt.plot_date(x=timestamps, y=values, fmt=<span class="string"><span class="delimiter">&quot;</span><span class="content">r-</span><span class="delimiter">&quot;</span></span>) <span class="n">plt</span><span class="o">.</span><span class="n">plot_date</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="n">timestamps</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="n">values</span><span class="p">,</span> <span class="n">fmt</span><span class="o">=</span><span class="s">"r-"</span><span class="p">)</span>
plt.ylabel(<span class="string"><span class="delimiter">'</span><span class="content">Temperature</span><span class="delimiter">'</span></span>) <span class="n">plt</span><span class="o">.</span><span class="n">ylabel</span><span class="p">(</span><span class="s">'Temperature'</span><span class="p">)</span>
plt.xlabel(<span class="string"><span class="delimiter">'</span><span class="content">Time line</span><span class="delimiter">'</span></span>) <span class="n">plt</span><span class="o">.</span><span class="n">xlabel</span><span class="p">(</span><span class="s">'Time line'</span><span class="p">)</span>
plt.savefig(<span class="string"><span class="delimiter">'</span><span class="content">sensor.png</span><span class="delimiter">'</span></span>) <span class="n">plt</span><span class="o">.</span><span class="n">savefig</span><span class="p">(</span><span class="s">'sensor.png'</span><span class="p">)</span>
</pre></div> </code></pre>
</div>
</div> </div>
<p>Creating a connection to the database and executing a query is similar to the ways already seen. The return values from the query are splitted into two lists. The time stamps must be converted in an value which is accepted by matplotlib and then the graph is generated and saved as image.</p> <p>Creating a connection to the database and executing a query is similar to the ways already seen. The return values from the query are splitted into two lists. The time stamps must be converted in an value which is accepted by matplotlib and then the graph is generated and saved as image.</p>
@ -291,7 +283,7 @@ plt.savefig(<span class="string"><span class="delimiter">'</span><span class="co
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,9 +93,9 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/how-to/'>How-To</a></li> <li>How-To</li>
<li><a class='category' href='/blog/categories/iot-data/'>IoT-Data</a></li> <li>IoT-Data</li>
</ul> </ul>
@ -157,7 +157,7 @@ One of the graphs created with this tutorial.
<li><a href="http://nbviewer.jupyter.org/github/home-assistant/home-assistant-notebooks/blob/master/DataExploration-1/DataExploration-1.ipynb">download the tutorial Jupyter Notebook</a> (leads to preview page, from there click download top-right)</li> <li><a href="http://nbviewer.jupyter.org/github/home-assistant/home-assistant-notebooks/blob/master/DataExploration-1/DataExploration-1.ipynb">download the tutorial Jupyter Notebook</a> (leads to preview page, from there click download top-right)</li>
<li>launch the Jupyter Notebook App</li> <li>launch the Jupyter Notebook App</li>
<li>Click the upload button to add the downloaded notebook to Jupyter</li> <li>Click the upload button to add the downloaded notebook to Jupyter</li>
<li>Adjust the <code>DB_URL</code> at the beginning of the notebook to point at your Home Assistant database</li> <li>Adjust the <code class="highlighter-rouge">DB_URL</code> at the beginning of the notebook to point at your Home Assistant database</li>
<li>Select in top menu: Cell -&gt; Run All</li> <li>Select in top menu: Cell -&gt; Run All</li>
</ul> </ul>
@ -248,7 +248,7 @@ One of the graphs created with this tutorial.
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -87,13 +87,13 @@
<div class="meta clearfix"> <div class="meta clearfix">
<time datetime="2016-07-28T04:00:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> July 28, 2016</time> <time datetime="2016-07-28T04:00:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> July 28, 2016</time>
<span class="byline author vcard"><i class='icon-user'></i> Fabian Affolter</span> <span class="byline author vcard"><i class='icon-user'></i> Fabian Affolter</span>
<span><i class='icon-time'></i> five minutes reading time</span> <span><i class='icon-time'></i> six minutes reading time</span>
<span> <span>
<i class="icon-tags"></i> <i class="icon-tags"></i>
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/how-to/'>How-To</a></li> <li>How-To</li>
</ul> </ul>
@ -108,7 +108,7 @@
</header> </header>
<p><img src="/images/blog/2016-07-micropython/micropython.png" style="clear: right; border:none; box-shadow: none; float: right; margin-bottom: 12px;" width="200" /><br /> <p><img src="/images/blog/2016-07-micropython/micropython.png" style="clear: right; border:none; box-shadow: none; float: right; margin-bottom: 12px;" width="200" />
The first release of Micropython for ESP8266 was delivered a couple of weeks ago. The <a href="http://docs.micropython.org/en/latest/esp8266/esp8266_contents.html">documentation</a> covers a lot of ground. This post is providing only a little summary which should get you started.</p> The first release of Micropython for ESP8266 was delivered a couple of weeks ago. The <a href="http://docs.micropython.org/en/latest/esp8266/esp8266_contents.html">documentation</a> covers a lot of ground. This post is providing only a little summary which should get you started.</p>
<p>Until a couple of weeks ago, the pre-built MicroPython binary for the ESP8266 was only available to backers. This has changed now and it is available to the public for <a href="https://micropython.org/download/#esp8266">download</a>.</p> <p>Until a couple of weeks ago, the pre-built MicroPython binary for the ESP8266 was only available to backers. This has changed now and it is available to the public for <a href="https://micropython.org/download/#esp8266">download</a>.</p>
@ -117,47 +117,41 @@ The first release of Micropython for ESP8266 was delivered a couple of weeks ago
<p>The easiest way is to use <a href="https://github.com/themadinventor/esptool">esptool.py</a> for firmware handling tasks. First erase the flash:</p> <p>The easiest way is to use <a href="https://github.com/themadinventor/esptool">esptool.py</a> for firmware handling tasks. First erase the flash:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sudo python esptool.py --port /dev/ttyUSB0 erase_flash
<div class="code"><pre>$ sudo python esptool.py --port /dev/ttyUSB0 erase_flash
esptool.py v1.0.2-dev esptool.py v1.0.2-dev
Connecting... Connecting...
Erasing flash (this may take a while)... Erasing flash <span class="o">(</span>this may take a <span class="k">while</span><span class="o">)</span>...
</pre></div> </code></pre>
</div>
</div> </div>
<p>and then load the firmware. You may adjust the file name of the firmware binary.</p> <p>and then load the firmware. You may adjust the file name of the firmware binary.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sudo python esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size<span class="o">=</span>8m 0 esp8266-2016-07-10-v1.8.2.bin
<div class="code"><pre>$ sudo python esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=8m 0 esp8266-2016-07-10-v1.8.2.bin
esptool.py v1.2-dev esptool.py v1.2-dev
Connecting... Connecting...
Running Cesanta flasher stub... Running Cesanta flasher stub...
Flash params set to 0x0020 Flash params <span class="nb">set </span>to 0x0020
Writing 540672 @ 0x0... 540672 (100 %) Writing 540672 @ 0x0... 540672 <span class="o">(</span>100 %<span class="o">)</span>
Wrote 540672 bytes at 0x0 in 13.1 seconds (330.8 kbit/s)... Wrote 540672 bytes at 0x0 <span class="k">in </span>13.1 seconds <span class="o">(</span>330.8 kbit/s<span class="o">)</span>...
Leaving... Leaving...
</pre></div> </code></pre>
</div>
</div> </div>
<p>Now reset the device. You should then be able to use the <a href="http://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/repl.html#getting-a-micropython-repl-prompt">REPL (Read Evaluate Print Loop)</a>. On Linux there is <code>minicom</code> or <code>picocom</code>, on a Mac you can use <code>screen</code> (eg. <code>screen /dev/tty.SLAB_USBtoUART 115200</code>), and on Windows there is Putty to open a serial connection and get the REPL prompt.</p> <p>Now reset the device. You should then be able to use the <a href="http://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/repl.html#getting-a-micropython-repl-prompt">REPL (Read Evaluate Print Loop)</a>. On Linux there is <code class="highlighter-rouge">minicom</code> or <code class="highlighter-rouge">picocom</code>, on a Mac you can use <code class="highlighter-rouge">screen</code> (eg. <code class="highlighter-rouge">screen /dev/tty.SLAB_USBtoUART 115200</code>), and on Windows there is Putty to open a serial connection and get the REPL prompt.</p>
<p>The <a href="http://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/repl.html#webrepl-a-prompt-over-wifi">WebREPL</a> work over a wireless connection and allows easy access to a prompt in your browser. An instance of the WebREPL client is hosted at <a href="http://micropython.org/webrepl">http://micropython.org/webrepl</a>. Alternatively, you can create a local clone of their <a href="https://github.com/micropython/webrepl">GitHub repository</a>. This is neccessary if your want to use the command-line tool <code>webrepl_cli.py</code> which is mentionend later in this post.</p> <p>The <a href="http://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/repl.html#webrepl-a-prompt-over-wifi">WebREPL</a> work over a wireless connection and allows easy access to a prompt in your browser. An instance of the WebREPL client is hosted at <a href="http://micropython.org/webrepl">http://micropython.org/webrepl</a>. Alternatively, you can create a local clone of their <a href="https://github.com/micropython/webrepl">GitHub repository</a>. This is neccessary if your want to use the command-line tool <code class="highlighter-rouge">webrepl_cli.py</code> which is mentionend later in this post.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sudo minicom -D /dev/ttyUSB0
<div class="code"><pre>$ sudo minicom -D /dev/ttyUSB0 <span class="c">#4 ets_task(4020e374, 29, 3fff70e8, 10) </span>
#4 ets_task(4020e374, 29, 3fff70e8, 10)
WebREPL daemon started on ws://192.168.4.1:8266 WebREPL daemon started on ws://192.168.4.1:8266
Started webrepl in setup mode Started webrepl <span class="k">in </span>setup mode
could not open file 'main.py' for reading could not open file <span class="s1">'main.py'</span> <span class="k">for </span>reading
#5 ets_task(4010035c, 3, 3fff6360, 4) <span class="c">#5 ets_task(4010035c, 3, 3fff6360, 4)</span>
MicroPython v1.8.2-9-g805c2b9 on 2016-07-10; ESP module with ESP8266 MicroPython v1.8.2-9-g805c2b9 on 2016-07-10; ESP module with ESP8266
Type &quot;help()&quot; for more information. Type <span class="s2">"help()"</span> <span class="k">for </span>more information.
&gt;&gt;&gt; <span class="gp">&gt;&gt;&gt; </span>
</pre></div> </code></pre>
</div>
</div> </div>
<p class="note"> <p class="note">
@ -166,116 +160,104 @@ The public build of the firmware may be different than the firmware distributed
<p>Connect a LED to pin 5 (or another pin of your choosing) to check if the ESP8266 is working as expected.</p> <p>Connect a LED to pin 5 (or another pin of your choosing) to check if the ESP8266 is working as expected.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-python highlighter-rouge"><pre class="highlight"><code><span class="o">&gt;&gt;&gt;</span> <span class="kn">import</span> <span class="nn">machine</span>
<div class="code"><pre>&gt;&gt;&gt; <span class="keyword">import</span> <span class="include">machine</span> <span class="o">&gt;&gt;&gt;</span> <span class="n">pin</span> <span class="o">=</span> <span class="n">machine</span><span class="o">.</span><span class="n">Pin</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="n">machine</span><span class="o">.</span><span class="n">Pin</span><span class="o">.</span><span class="n">OUT</span><span class="p">)</span>
&gt;&gt;&gt; pin = machine.Pin(<span class="integer">5</span>, machine.Pin.OUT) <span class="o">&gt;&gt;&gt;</span> <span class="n">pin</span><span class="o">.</span><span class="n">high</span><span class="p">()</span>
&gt;&gt;&gt; pin.high() </code></pre>
</pre></div>
</div>
</div> </div>
<p>You can toogle the LED by changing its state with <code>pin.high()</code> and <code>pin.low()</code>.</p> <p>You can toogle the LED by changing its state with <code class="highlighter-rouge">pin.high()</code> and <code class="highlighter-rouge">pin.low()</code>.</p>
<p>Various ESP8266 development board are shipped with an onboard photocell or a light dependent resistors (LDR) connected to the analog pin of your ESP8266 check if you are able to obtain a value.</p> <p>Various ESP8266 development board are shipped with an onboard photocell or a light dependent resistors (LDR) connected to the analog pin of your ESP8266 check if you are able to obtain a value.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-python highlighter-rouge"><pre class="highlight"><code><span class="o">&gt;&gt;&gt;</span> <span class="kn">import</span> <span class="nn">machine</span>
<div class="code"><pre>&gt;&gt;&gt; <span class="keyword">import</span> <span class="include">machine</span> <span class="o">&gt;&gt;&gt;</span> <span class="n">brightness</span> <span class="o">=</span> <span class="n">machine</span><span class="o">.</span><span class="n">ADC</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
&gt;&gt;&gt; brightness = machine.ADC(<span class="integer">0</span>) <span class="o">&gt;&gt;&gt;</span> <span class="n">brightness</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
&gt;&gt;&gt; brightness.read() </code></pre>
</pre></div>
</div>
</div> </div>
<p>Make sure that you are familiar with REPL and WebREPL because this will be needed soon. Keep in mind the password for the WebREPL access.</p> <p>Make sure that you are familiar with REPL and WebREPL because this will be needed soon. Keep in mind the password for the WebREPL access.</p>
<p>Read the <a href="http://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/network_basics.html">instructions</a> about how to setup your wireless connection. Basically you need to upload a <code>boot.py</code> file to the microcontroller and this file is taking care of the connection setup. Below you find a sample which is more or less the same as shown in the <a href="http://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/network_basics.html#configuration-of-the-wifi">documentation</a>.</p> <p>Read the <a href="http://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/network_basics.html">instructions</a> about how to setup your wireless connection. Basically you need to upload a <code class="highlighter-rouge">boot.py</code> file to the microcontroller and this file is taking care of the connection setup. Below you find a sample which is more or less the same as shown in the <a href="http://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/network_basics.html#configuration-of-the-wifi">documentation</a>.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-python highlighter-rouge"><pre class="highlight"><code><span class="k">def</span> <span class="nf">do_connect</span><span class="p">():</span>
<div class="code"><pre><span class="keyword">def</span> <span class="function">do_connect</span>(): <span class="kn">import</span> <span class="nn">network</span>
<span class="keyword">import</span> <span class="include">network</span>
SSID = <span class="string"><span class="delimiter">'</span><span class="content">SSID</span><span class="delimiter">'</span></span> <span class="n">SSID</span> <span class="o">=</span> <span class="s">'SSID'</span>
PASSWORD = <span class="string"><span class="delimiter">'</span><span class="content">PASSWORD</span><span class="delimiter">'</span></span> <span class="n">PASSWORD</span> <span class="o">=</span> <span class="s">'PASSWORD'</span>
sta_if = network.WLAN(network.STA_IF) <span class="n">sta_if</span> <span class="o">=</span> <span class="n">network</span><span class="o">.</span><span class="n">WLAN</span><span class="p">(</span><span class="n">network</span><span class="o">.</span><span class="n">STA_IF</span><span class="p">)</span>
ap_if = network.WLAN(network.AP_IF) <span class="n">ap_if</span> <span class="o">=</span> <span class="n">network</span><span class="o">.</span><span class="n">WLAN</span><span class="p">(</span><span class="n">network</span><span class="o">.</span><span class="n">AP_IF</span><span class="p">)</span>
<span class="keyword">if</span> ap_if.active(): <span class="k">if</span> <span class="n">ap_if</span><span class="o">.</span><span class="n">active</span><span class="p">():</span>
ap_if.active(<span class="predefined-constant">False</span>) <span class="n">ap_if</span><span class="o">.</span><span class="n">active</span><span class="p">(</span><span class="bp">False</span><span class="p">)</span>
<span class="keyword">if</span> <span class="keyword">not</span> sta_if.isconnected(): <span class="k">if</span> <span class="ow">not</span> <span class="n">sta_if</span><span class="o">.</span><span class="n">isconnected</span><span class="p">():</span>
print(<span class="string"><span class="delimiter">'</span><span class="content">connecting to network...</span><span class="delimiter">'</span></span>) <span class="k">print</span><span class="p">(</span><span class="s">'connecting to network...'</span><span class="p">)</span>
sta_if.active(<span class="predefined-constant">True</span>) <span class="n">sta_if</span><span class="o">.</span><span class="n">active</span><span class="p">(</span><span class="bp">True</span><span class="p">)</span>
sta_if.connect(SSID, PASSWORD) <span class="n">sta_if</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="n">SSID</span><span class="p">,</span> <span class="n">PASSWORD</span><span class="p">)</span>
<span class="keyword">while</span> <span class="keyword">not</span> sta_if.isconnected(): <span class="k">while</span> <span class="ow">not</span> <span class="n">sta_if</span><span class="o">.</span><span class="n">isconnected</span><span class="p">():</span>
<span class="keyword">pass</span> <span class="k">pass</span>
print(<span class="string"><span class="delimiter">'</span><span class="content">Network configuration:</span><span class="delimiter">'</span></span>, sta_if.ifconfig()) <span class="k">print</span><span class="p">(</span><span class="s">'Network configuration:'</span><span class="p">,</span> <span class="n">sta_if</span><span class="o">.</span><span class="n">ifconfig</span><span class="p">())</span>
</pre></div> </code></pre>
</div>
</div> </div>
<p>Upload this file with <code>webrepl_cli.py</code> or the WebREPL:</p> <p>Upload this file with <code class="highlighter-rouge">webrepl_cli.py</code> or the WebREPL:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>python webrepl_cli.py boot.py 192.168.4.1:/boot.py
<div class="code"><pre>$ python webrepl_cli.py boot.py 192.168.4.1:/boot.py </code></pre>
</pre></div>
</div>
</div> </div>
<p>If you reboot, you should see your current IP address in the terminal.</p> <p>If you reboot, you should see your current IP address in the terminal.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">&gt;&gt;&gt; </span>Network configuration: <span class="o">(</span><span class="s1">'192.168.0.10'</span>, <span class="s1">'255.255.255.0'</span>, <span class="s1">'192.168.0.1'</span>, <span class="s1">'192.168.0.1'</span><span class="o">)</span>
<div class="code"><pre>&gt;&gt;&gt; Network configuration: ('192.168.0.10', '255.255.255.0', '192.168.0.1', '192.168.0.1') </code></pre>
</pre></div>
</div>
</div> </div>
<p>First lets create a little consumer for Home Assistant sensors state. The code to place in <code>main.py</code> is a mixture of code from above and the <a href="/developers/rest_api/">RESTful API</a> of Home Assistant. If the temperature in the kitchen is higher than 20 °C then the LED connected to pin 5 is switched on.</p> <p>First lets create a little consumer for Home Assistant sensors state. The code to place in <code class="highlighter-rouge">main.py</code> is a mixture of code from above and the <a href="/developers/rest_api/">RESTful API</a> of Home Assistant. If the temperature in the kitchen is higher than 20 °C then the LED connected to pin 5 is switched on.</p>
<p class="note"> <p class="note">
If a module is missing then you need to download is it from <a href="https://github.com/micropython/micropython-lib">MicroPython Library overview</a> and upload it to the ESP8266 with <code>webrepl_cli.py</code> manually. If a module is missing then you need to download is it from <a href="https://github.com/micropython/micropython-lib">MicroPython Library overview</a> and upload it to the ESP8266 with <code class="highlighter-rouge">webrepl_cli.py</code> manually.
</p> </p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-python highlighter-rouge"><pre class="highlight"><code><span class="c"># Sample code to request the state of a Home Assistant entity.</span>
<div class="code"><pre><span class="comment"># Sample code to request the state of a Home Assistant entity.</span>
API_PASSWORD = <span class="string"><span class="delimiter">'</span><span class="content">YOUR_PASSWORD</span><span class="delimiter">'</span></span> <span class="n">API_PASSWORD</span> <span class="o">=</span> <span class="s">'YOUR_PASSWORD'</span>
URL = <span class="string"><span class="delimiter">'</span><span class="content">http://192.168.0.5:8123/api/states/</span><span class="delimiter">'</span></span> <span class="n">URL</span> <span class="o">=</span> <span class="s">'http://192.168.0.5:8123/api/states/'</span>
ENTITY = <span class="string"><span class="delimiter">'</span><span class="content">sensor.kitchen_temperature</span><span class="delimiter">'</span></span> <span class="n">ENTITY</span> <span class="o">=</span> <span class="s">'sensor.kitchen_temperature'</span>
TIMEOUT = <span class="integer">30</span> <span class="n">TIMEOUT</span> <span class="o">=</span> <span class="mi">30</span>
PIN = <span class="integer">5</span> <span class="n">PIN</span> <span class="o">=</span> <span class="mi">5</span>
<span class="keyword">def</span> <span class="function">get_data</span>(): <span class="k">def</span> <span class="nf">get_data</span><span class="p">():</span>
<span class="keyword">import</span> <span class="include">urequests</span> <span class="kn">import</span> <span class="nn">urequests</span>
url = <span class="string"><span class="delimiter">'</span><span class="content">{}{}</span><span class="delimiter">'</span></span>.format(URL, ENTITY) <span class="n">url</span> <span class="o">=</span> <span class="s">'{}{}'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">URL</span><span class="p">,</span> <span class="n">ENTITY</span><span class="p">)</span>
headers = {<span class="string"><span class="delimiter">'</span><span class="content">x-ha-access</span><span class="delimiter">'</span></span>: API_PASSWORD, <span class="n">headers</span> <span class="o">=</span> <span class="p">{</span><span class="s">'x-ha-access'</span><span class="p">:</span> <span class="n">API_PASSWORD</span><span class="p">,</span>
<span class="string"><span class="delimiter">'</span><span class="content">content-type</span><span class="delimiter">'</span></span>: <span class="string"><span class="delimiter">'</span><span class="content">application/json</span><span class="delimiter">'</span></span>} <span class="s">'content-type'</span><span class="p">:</span> <span class="s">'application/json'</span><span class="p">}</span>
resp = urequests.get(URL, headers=headers) <span class="n">resp</span> <span class="o">=</span> <span class="n">urequests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">URL</span><span class="p">,</span> <span class="n">headers</span><span class="o">=</span><span class="n">headers</span><span class="p">)</span>
<span class="keyword">return</span> resp.json()[<span class="string"><span class="delimiter">'</span><span class="content">state</span><span class="delimiter">'</span></span>] <span class="k">return</span> <span class="n">resp</span><span class="o">.</span><span class="n">json</span><span class="p">()[</span><span class="s">'state'</span><span class="p">]</span>
<span class="keyword">def</span> <span class="function">main</span>(): <span class="k">def</span> <span class="nf">main</span><span class="p">():</span>
<span class="keyword">import</span> <span class="include">machine</span> <span class="kn">import</span> <span class="nn">machine</span>
<span class="keyword">import</span> <span class="include">time</span> <span class="kn">import</span> <span class="nn">time</span>
pin = machine.Pin(PIN, machine.Pin.OUT) <span class="n">pin</span> <span class="o">=</span> <span class="n">machine</span><span class="o">.</span><span class="n">Pin</span><span class="p">(</span><span class="n">PIN</span><span class="p">,</span> <span class="n">machine</span><span class="o">.</span><span class="n">Pin</span><span class="o">.</span><span class="n">OUT</span><span class="p">)</span>
<span class="keyword">while</span> <span class="predefined-constant">True</span>: <span class="k">while</span> <span class="bp">True</span><span class="p">:</span>
<span class="keyword">try</span>: <span class="k">try</span><span class="p">:</span>
<span class="keyword">if</span> <span class="predefined">int</span>(get_data()) &gt;= <span class="integer">20</span>: <span class="k">if</span> <span class="nb">int</span><span class="p">(</span><span class="n">get_data</span><span class="p">())</span> <span class="o">&gt;=</span> <span class="mi">20</span><span class="p">:</span>
pin.high() <span class="n">pin</span><span class="o">.</span><span class="n">high</span><span class="p">()</span>
<span class="keyword">else</span>: <span class="k">else</span><span class="p">:</span>
pin.low() <span class="n">pin</span><span class="o">.</span><span class="n">low</span><span class="p">()</span>
<span class="keyword">except</span> <span class="exception">TypeError</span>: <span class="k">except</span> <span class="nb">TypeError</span><span class="p">:</span>
<span class="keyword">pass</span> <span class="k">pass</span>
time.sleep(TIMEOUT) <span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="n">TIMEOUT</span><span class="p">)</span>
<span class="keyword">if</span> __name__ == <span class="string"><span class="delimiter">'</span><span class="content">__main__</span><span class="delimiter">'</span></span>: <span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">'__main__'</span><span class="p">:</span>
print(<span class="string"><span class="delimiter">'</span><span class="content">Get the state of {}</span><span class="delimiter">'</span></span>.format(ENTITY)) <span class="k">print</span><span class="p">(</span><span class="s">'Get the state of {}'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">ENTITY</span><span class="p">))</span>
main() <span class="n">main</span><span class="p">()</span>
</pre></div> </code></pre>
</div>
</div> </div>
<p>Upload <code>main.py</code> the same way as <code>boot.py</code>. After a reboot (<code>&gt;&gt;&gt; import machine</code> and <code>&gt;&gt;&gt; machine.reboot()</code>) or power-cycling your physical notifier is ready.</p> <p>Upload <code class="highlighter-rouge">main.py</code> the same way as <code class="highlighter-rouge">boot.py</code>. After a reboot (<code class="highlighter-rouge">&gt;&gt;&gt; import machine</code> and <code class="highlighter-rouge">&gt;&gt;&gt; machine.reboot()</code>) or power-cycling your physical notifier is ready.</p>
<p>If you run into trouble, press “Ctrl+c” in the REPL to stop the execution of the code, enter <code>&gt;&gt;&gt; import webrepl</code> and <code>&gt;&gt;&gt; webrepl.start()</code>, and upload your fixed file.</p> <p>If you run into trouble, press “Ctrl+c” in the REPL to stop the execution of the code, enter <code class="highlighter-rouge">&gt;&gt;&gt; import webrepl</code> and <code class="highlighter-rouge">&gt;&gt;&gt; webrepl.start()</code>, and upload your fixed file.</p>
</article> </article>
@ -349,7 +331,7 @@ PIN = <span class="integer">5</span>
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -134,7 +134,7 @@
<li>Thermostat: Support for HVAC mode of <a href="/components/thermostat.nest/">Nest</a> devices (<a href="https://github.com/vladonemo">@vladonemo</a>)</li> <li>Thermostat: Support for HVAC mode of <a href="/components/thermostat.nest/">Nest</a> devices (<a href="https://github.com/vladonemo">@vladonemo</a>)</li>
<li>InfluxDB: Option to specify additional <a href="/components/influxdb/">tags</a> (<a href="https://github.com/open-homeautomation">@open-homeautomation</a>)</li> <li>InfluxDB: Option to specify additional <a href="/components/influxdb/">tags</a> (<a href="https://github.com/open-homeautomation">@open-homeautomation</a>)</li>
<li>Input slider: Support for float value (<a href="https://github.com/ngraziano">@ngraziano</a>)</li> <li>Input slider: Support for float value (<a href="https://github.com/ngraziano">@ngraziano</a>)</li>
<li>Template: New <a href="/topics/templating/#home-assistant-template-extensions">filters</a> (<code>timestamp_local</code> and <code>timestamp_utc</code>) (<a href="https://github.com/fabaff">@fabaff</a>)</li> <li>Template: New <a href="/topics/templating/#home-assistant-template-extensions">filters</a> (<code class="highlighter-rouge">timestamp_local</code> and <code class="highlighter-rouge">timestamp_utc</code>) (<a href="https://github.com/fabaff">@fabaff</a>)</li>
<li>Binary sensor - Wink: Water leak sensor support added (<a href="https://github.com/w1ll1am23">@w1ll1am23</a>)</li> <li>Binary sensor - Wink: Water leak sensor support added (<a href="https://github.com/w1ll1am23">@w1ll1am23</a>)</li>
<li>Sensor - Tellduslive: Support for luminance of Fibaro Motion Sensor (<a href="https://github.com/PetitCircuitLab">@PetitCircuitLab</a>)</li> <li>Sensor - Tellduslive: Support for luminance of Fibaro Motion Sensor (<a href="https://github.com/PetitCircuitLab">@PetitCircuitLab</a>)</li>
<li>Switch - RPi GPIO: Fix when inverted logic (<a href="https://github.com/zeroDenial">@zeroDenial</a>)</li> <li>Switch - RPi GPIO: Fix when inverted logic (<a href="https://github.com/zeroDenial">@zeroDenial</a>)</li>
@ -147,7 +147,7 @@
<li>Light: New support for <a href="/components/light.x10/">X10</a> lights (<a href="https://github.com/fotoetienne">@fotoetienne</a>)</li> <li>Light: New support for <a href="/components/light.x10/">X10</a> lights (<a href="https://github.com/fotoetienne">@fotoetienne</a>)</li>
<li>Sensor: Support for observing <a href="/components/sensor.imap/">IMAP</a> accounts (<a href="https://github.com/danieljkemp">@danieljkemp</a>)</li> <li>Sensor: Support for observing <a href="/components/sensor.imap/">IMAP</a> accounts (<a href="https://github.com/danieljkemp">@danieljkemp</a>)</li>
<li>Media Player: Integration for <a href="/components/media_player.mpchc/">MPC-HC</a> (Media Player Classic - Home Cinema) mediaplayer (<a href="https://github.com/abcminiuser">@abcminiuser</a>)</li> <li>Media Player: Integration for <a href="/components/media_player.mpchc/">MPC-HC</a> (Media Player Classic - Home Cinema) mediaplayer (<a href="https://github.com/abcminiuser">@abcminiuser</a>)</li>
<li>Notify: <code>location</code> extension for <a href="/components/notify.telegram/">Telegram</a> and photo bug fixed (<a href="https://github.com/keatontaylor">@keatontaylor</a> and <a href="https://github.com/pvizeli">@pvizeli</a>)</li> <li>Notify: <code class="highlighter-rouge">location</code> extension for <a href="/components/notify.telegram/">Telegram</a> and photo bug fixed (<a href="https://github.com/keatontaylor">@keatontaylor</a> and <a href="https://github.com/pvizeli">@pvizeli</a>)</li>
<li>Groups: Lock states will now be properly grouped (<a href="https://github.com/jwl17330536">@jwl17330536</a>)</li> <li>Groups: Lock states will now be properly grouped (<a href="https://github.com/jwl17330536">@jwl17330536</a>)</li>
<li>Media Player: Added tests for Sonos to improve code quality (<a href="https://github.com/americanwookie">@americanwookie</a>)</li> <li>Media Player: Added tests for Sonos to improve code quality (<a href="https://github.com/americanwookie">@americanwookie</a>)</li>
<li>Device Tracker: iCloud stability fixes (<a href="https://github.com/kellerza">@kellerza</a>)</li> <li>Device Tracker: iCloud stability fixes (<a href="https://github.com/kellerza">@kellerza</a>)</li>
@ -250,7 +250,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -87,13 +87,13 @@
<div class="meta clearfix"> <div class="meta clearfix">
<time datetime="2016-08-03T17:22:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> August 2, 2016</time> <time datetime="2016-08-03T17:22:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> August 2, 2016</time>
<span class="byline author vcard"><i class='icon-user'></i> Nolan Gilley</span> <span class="byline author vcard"><i class='icon-user'></i> Nolan Gilley</span>
<span><i class='icon-time'></i> three minutes reading time</span> <span><i class='icon-time'></i> four minutes reading time</span>
<span> <span>
<i class="icon-tags"></i> <i class="icon-tags"></i>
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/user-stories/'>User-Stories</a></li> <li>User-Stories</li>
</ul> </ul>
@ -156,59 +156,57 @@
<p>Home Assistant Configuration:</p> <p>Home Assistant Configuration:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">mqtt</span><span class="pi">:</span>
<div class="code"><pre><span class="key">mqtt</span>: <span class="s">broker</span><span class="pi">:</span> <span class="s">192.168.1.100</span>
<span class="key">broker</span>: <span class="string"><span class="content">192.168.1.100</span></span> <span class="s">port</span><span class="pi">:</span> <span class="s">1883</span>
<span class="key">port</span>: <span class="string"><span class="content">1883</span></span> <span class="s">keepalive</span><span class="pi">:</span> <span class="s">60</span>
<span class="key">keepalive</span>: <span class="string"><span class="content">60</span></span> <span class="s">qos</span><span class="pi">:</span> <span class="s">0</span>
<span class="key">qos</span>: <span class="string"><span class="content">0</span></span>
<span class="key">sensor</span>: <span class="s">sensor</span><span class="pi">:</span>
- <span class="string"><span class="content">platform: mqtt</span></span> <span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">mqtt</span>
<span class="key">name</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Dryer Status</span><span class="delimiter">&quot;</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s2">"</span><span class="s">Dryer</span><span class="nv"> </span><span class="s">Status"</span>
<span class="key">state_topic</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">sensor/dryer</span><span class="delimiter">&quot;</span></span> <span class="s">state_topic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">sensor/dryer"</span>
<span class="key">unit_of_measurement</span>: <span class="string"><span class="delimiter">&quot;</span><span class="delimiter">&quot;</span></span> <span class="s">unit_of_measurement</span><span class="pi">:</span> <span class="s2">"</span><span class="s">"</span>
- <span class="string"><span class="content">platform: mqtt</span></span> <span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">mqtt</span>
<span class="key">name</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Washer Status</span><span class="delimiter">&quot;</span></span> <span class="s">name</span><span class="pi">:</span> <span class="s2">"</span><span class="s">Washer</span><span class="nv"> </span><span class="s">Status"</span>
<span class="key">state_topic</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">sensor/washer</span><span class="delimiter">&quot;</span></span> <span class="s">state_topic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">sensor/washer"</span>
<span class="key">unit_of_measurement</span>: <span class="string"><span class="delimiter">&quot;</span><span class="delimiter">&quot;</span></span> <span class="s">unit_of_measurement</span><span class="pi">:</span> <span class="s2">"</span><span class="s">"</span>
<span class="key">automation</span>: <span class="s">automation</span><span class="pi">:</span>
- <span class="string"><span class="content">alias: Washer complete</span></span> <span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Washer complete</span>
<span class="key">trigger</span>: <span class="s">trigger</span><span class="pi">:</span>
<span class="key">platform</span>: <span class="string"><span class="content">state</span></span> <span class="s">platform</span><span class="pi">:</span> <span class="s">state</span>
<span class="key">entity_id</span>: <span class="string"><span class="content">sensor.washer_status</span></span> <span class="s">entity_id</span><span class="pi">:</span> <span class="s">sensor.washer_status</span>
<span class="key">from</span>: <span class="string"><span class="content">'Running'</span></span> <span class="s">from</span><span class="pi">:</span> <span class="s1">'</span><span class="s">Running'</span>
<span class="key">to</span>: <span class="string"><span class="content">'Complete'</span></span> <span class="s">to</span><span class="pi">:</span> <span class="s1">'</span><span class="s">Complete'</span>
<span class="key">action</span>: <span class="s">action</span><span class="pi">:</span>
<span class="key">service</span>: <span class="string"><span class="content">script.turn_on</span></span> <span class="s">service</span><span class="pi">:</span> <span class="s">script.turn_on</span>
<span class="key">entity_id</span>: <span class="string"><span class="content">script.washer_complete</span></span> <span class="s">entity_id</span><span class="pi">:</span> <span class="s">script.washer_complete</span>
- <span class="string"><span class="content">alias: Washer emptied</span></span> <span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Washer emptied</span>
<span class="key">trigger</span>: <span class="s">trigger</span><span class="pi">:</span>
<span class="key">platform</span>: <span class="string"><span class="content">state</span></span> <span class="s">platform</span><span class="pi">:</span> <span class="s">state</span>
<span class="key">entity_id</span>: <span class="string"><span class="content">sensor.washer_status</span></span> <span class="s">entity_id</span><span class="pi">:</span> <span class="s">sensor.washer_status</span>
<span class="key">from</span>: <span class="string"><span class="content">'Complete'</span></span> <span class="s">from</span><span class="pi">:</span> <span class="s1">'</span><span class="s">Complete'</span>
<span class="key">to</span>: <span class="string"><span class="content">'Empty'</span></span> <span class="s">to</span><span class="pi">:</span> <span class="s1">'</span><span class="s">Empty'</span>
<span class="key">action</span>: <span class="s">action</span><span class="pi">:</span>
<span class="key">service</span>: <span class="string"><span class="content">scene.turn_on</span></span> <span class="s">service</span><span class="pi">:</span> <span class="s">scene.turn_on</span>
<span class="key">entity_id</span>: <span class="string"><span class="content">scene.normal</span></span> <span class="s">entity_id</span><span class="pi">:</span> <span class="s">scene.normal</span>
<span class="key">script</span>: <span class="s">script</span><span class="pi">:</span>
<span class="key">washer_complete</span>: <span class="s">washer_complete</span><span class="pi">:</span>
<span class="key">alias</span>: <span class="string"><span class="content">Washer Complete</span></span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Washer Complete</span>
<span class="key">sequence</span>: <span class="s">sequence</span><span class="pi">:</span>
- <span class="string"><span class="content">alias: Join Notification</span></span> <span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Join Notification</span>
<span class="key">service</span>: <span class="string"><span class="content">notify.join</span></span> <span class="s">service</span><span class="pi">:</span> <span class="s">notify.join</span>
<span class="key">data</span>: <span class="s">data</span><span class="pi">:</span>
<span class="key">message</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">The washing machine has finished its cycle, please empty it!</span><span class="delimiter">&quot;</span></span> <span class="s">message</span><span class="pi">:</span> <span class="s2">"</span><span class="s">The</span><span class="nv"> </span><span class="s">washing</span><span class="nv"> </span><span class="s">machine</span><span class="nv"> </span><span class="s">has</span><span class="nv"> </span><span class="s">finished</span><span class="nv"> </span><span class="s">its</span><span class="nv"> </span><span class="s">cycle,</span><span class="nv"> </span><span class="s">please</span><span class="nv"> </span><span class="s">empty</span><span class="nv"> </span><span class="s">it!"</span>
- <span class="string"><span class="content">alias: Living Room Lights Blue</span></span> <span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Living Room Lights Blue</span>
<span class="key">service</span>: <span class="string"><span class="content">scene.turn_on</span></span> <span class="s">service</span><span class="pi">:</span> <span class="s">scene.turn_on</span>
<span class="key">data</span>: <span class="s">data</span><span class="pi">:</span>
<span class="key">entity_id</span>: <span class="string"><span class="content">scene.blue</span></span> <span class="s">entity_id</span><span class="pi">:</span> <span class="s">scene.blue</span>
</pre></div> </code></pre>
</div>
</div> </div>
<p>Resources used:</p> <p>Resources used:</p>
@ -289,7 +287,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/technology/'>Technology</a></li> <li>Technology</li>
</ul> </ul>
@ -181,13 +181,11 @@
<p>Breaking up an app in JavaScript is complex because each module explicitly imports their dependencies. This has to continue to work in your browser after breaking it up in multiple files. Web components do not have this problem as its part of the platform and thus your browser is the registry! An unregistered web component will be rendered as an empty span element until the element gets registered. Loading order is not important.</p> <p>Breaking up an app in JavaScript is complex because each module explicitly imports their dependencies. This has to continue to work in your browser after breaking it up in multiple files. Web components do not have this problem as its part of the platform and thus your browser is the registry! An unregistered web component will be rendered as an empty span element until the element gets registered. Loading order is not important.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-javascript highlighter-rouge"><pre class="highlight"><code><span class="c1">// Example of the flexibility of web components.</span>
<div class="code"><pre><span class="comment">// Example of the flexibility of web components.</span> <span class="kd">var</span> <span class="nx">spinner</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">'paper-spinner'</span><span class="p">);</span>
<span class="keyword">var</span> spinner = document.createElement(<span class="string"><span class="delimiter">'</span><span class="content">paper-spinner</span><span class="delimiter">'</span></span>); <span class="nx">spinner</span><span class="p">.</span><span class="nx">active</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
spinner.active = <span class="predefined-constant">true</span>; <span class="nb">document</span><span class="p">.</span><span class="nx">body</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">spinner</span><span class="p">);</span>
document.body.appendChild(spinner); </code></pre>
</pre></div>
</div>
</div> </div>
<p>Because the browser tracks your web components, creating standalone bundles for parts of the app is easy:</p> <p>Because the browser tracks your web components, creating standalone bundles for parts of the app is easy:</p>
@ -250,7 +248,7 @@ document.body.appendChild(spinner);
<li>Reduce the number of icons that are loaded.</li> <li>Reduce the number of icons that are loaded.</li>
<li>Embed initial API response in served page if not using a service worker.</li> <li>Embed initial API response in served page if not using a service worker.</li>
<li>Reduce size of initial bundle by moving out all things that are not visible for initial paint. For example the dialogs that show more info about entities.</li> <li>Reduce size of initial bundle by moving out all things that are not visible for initial paint. For example the dialogs that show more info about entities.</li>
<li>Prefetch the other pages using <code>&lt;link rel="preload" …&gt;</code></li> <li>Prefetch the other pages using <code class="highlighter-rouge">&lt;link rel="preload" …&gt;</code></li>
</ul> </ul>
</article> </article>
@ -325,7 +323,7 @@ document.body.appendChild(spinner);
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -12,12 +12,12 @@
<meta name="description" content="Automate based on check ins, slow internet speed or just stream a camera using FFMPEG."> <meta name="description" content="Automate based on check ins, slow internet speed or just stream a camera using FFMPEG.">
<meta name="viewport" content="width=device-width"> <meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/"> <link rel="canonical" href="https://home-assistant.io/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">
<meta property="fb:app_id" content="338291289691179"> <meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="0.26: Foursquare, Fast.com, FFMPEG and GPSD"> <meta property="og:title" content="0.26: Foursquare, Fast.com, FFMPEG and GPSD">
<meta property="og:site_name" content="Home Assistant"> <meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/"> <meta property="og:url" content="https://home-assistant.io/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">
<meta property="og:type" content="article"> <meta property="og:type" content="article">
<meta property="og:description" content="Automate based on check ins, slow internet speed or just stream a camera using FFMPEG."> <meta property="og:description" content="Automate based on check ins, slow internet speed or just stream a camera using FFMPEG.">
<meta property="og:image" content="https://home-assistant.io/images/default-social.png"> <meta property="og:image" content="https://home-assistant.io/images/default-social.png">
@ -93,7 +93,7 @@
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li> <li>Release-Notes</li>
</ul> </ul>
@ -170,13 +170,11 @@
<li>A new unit system has superseded the temperature unit option in the core configuration. For now it is backwards compatible, but you should update soon:</li> <li>A new unit system has superseded the temperature unit option in the core configuration. For now it is backwards compatible, but you should update soon:</li>
</ul> </ul>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Configuration.yaml example</span>
<div class="code"><pre><span class="comment"># Configuration.yaml example</span> <span class="s">homeassistant</span><span class="pi">:</span>
<span class="key">homeassistant</span>: <span class="c1"># 'metric' for the metric system, 'imperial' for the imperial system</span>
<span class="comment"># 'metric' for the metric system, 'imperial' for the imperial system</span> <span class="s">unit_system</span><span class="pi">:</span> <span class="s">metric</span>
<span class="key">unit_system</span>: <span class="string"><span class="content">metric</span></span> </code></pre>
</pre></div>
</div>
</div> </div>
</article> </article>
@ -218,12 +216,12 @@
class="twitter-share-button" class="twitter-share-button"
data-via="home_assistant" data-via="home_assistant"
data-related="home_assistant" data-related="home_assistant"
data-url="https://home-assistant.io/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/" data-url="https://home-assistant.io/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/"
data-counturl="https://home-assistant.io/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/" >Tweet</a> data-counturl="https://home-assistant.io/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/" >Tweet</a>
<div class="fb-share-button" style='top: -6px;' <div class="fb-share-button" style='top: -6px;'
data-href="https://home-assistant.io/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/" data-href="https://home-assistant.io/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/"
data-layout="button_count"> data-layout="button_count">
</div> </div>
@ -305,8 +303,8 @@
// var disqus_developer = 1; // var disqus_developer = 1;
var disqus_identifier = 'https://home-assistant.io/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/'; var disqus_identifier = 'https://home-assistant.io/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/';
var disqus_url = 'https://home-assistant.io/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/'; var disqus_url = 'https://home-assistant.io/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/';
var disqus_script = 'embed.js'; var disqus_script = 'embed.js';
(function () { (function () {

View file

@ -87,13 +87,13 @@
<div class="meta clearfix"> <div class="meta clearfix">
<time datetime="2016-08-16T10:00:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> August 16, 2016</time> <time datetime="2016-08-16T10:00:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> August 16, 2016</time>
<span class="byline author vcard"><i class='icon-user'></i> Andrew Cockburn</span> <span class="byline author vcard"><i class='icon-user'></i> Andrew Cockburn</span>
<span><i class='icon-time'></i> 10 minutes reading time</span> <span><i class='icon-time'></i> 11 minutes reading time</span>
<span> <span>
<i class="icon-tags"></i> <i class="icon-tags"></i>
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/how-to/'>How-To</a></li> <li>How-To</li>
</ul> </ul>
@ -108,7 +108,7 @@
</header> </header>
<p>I have been working on a new subsystem to complement Home Assistants Automation and Scripting components. <code>AppDaemon</code> is a python daemon that consumes events from Home Assistant and feeds them to snippets of python code called “Apps”. An App is a Python class that is instantiated possibly multiple times from <code>AppDaemon</code> and registers callbacks for various system events. It is also able to inspect and set state and call services. The API provides a rich environment suited to home automation tasks that can also leverage all the power of Python.</p> <p>I have been working on a new subsystem to complement Home Assistants Automation and Scripting components. <code class="highlighter-rouge">AppDaemon</code> is a python daemon that consumes events from Home Assistant and feeds them to snippets of python code called “Apps”. An App is a Python class that is instantiated possibly multiple times from <code class="highlighter-rouge">AppDaemon</code> and registers callbacks for various system events. It is also able to inspect and set state and call services. The API provides a rich environment suited to home automation tasks that can also leverage all the power of Python.</p>
<a name="read-more"></a> <a name="read-more"></a>
@ -129,108 +129,101 @@
<p>In my opinion, Home Assistant accomplishes the majority of these very well with a combination of Automations, Scripts and Templates, and its Restful API.</p> <p>In my opinion, Home Assistant accomplishes the majority of these very well with a combination of Automations, Scripts and Templates, and its Restful API.</p>
<p>So why <code>AppDaemon</code>? <code>AppDaemon</code> is not meant to replace Home Assistant Automations and Scripts, rather complement them. For a lot of things, automations work well and can be very succinct. However, there is a class of more complex automations for which they become harder to use, and appdeamon then comes into its own. It brings quite a few things to the table:</p> <p>So why <code class="highlighter-rouge">AppDaemon</code>? <code class="highlighter-rouge">AppDaemon</code> is not meant to replace Home Assistant Automations and Scripts, rather complement them. For a lot of things, automations work well and can be very succinct. However, there is a class of more complex automations for which they become harder to use, and appdeamon then comes into its own. It brings quite a few things to the table:</p>
<ul> <ul>
<li>New paradigm - some problems require a procedural and/or iterative approach, and <code>AppDaemon</code> Apps are a much more natural fit for this. Recent enhancements to Home Assistant scripts and templates have made huge strides, but for the most complex scenarios, Apps can do things that Automations cant</li> <li>New paradigm - some problems require a procedural and/or iterative approach, and <code class="highlighter-rouge">AppDaemon</code> Apps are a much more natural fit for this. Recent enhancements to Home Assistant scripts and templates have made huge strides, but for the most complex scenarios, Apps can do things that Automations cant</li>
<li>Ease of use - <code>AppDaemon</code>s API is full of helper functions that make programming as easy and natural as possible. The functions and their operation are as “Pythonic” as possible, experienced Python programmers should feel right at home.</li> <li>Ease of use - <code class="highlighter-rouge">AppDaemon</code>s API is full of helper functions that make programming as easy and natural as possible. The functions and their operation are as “Pythonic” as possible, experienced Python programmers should feel right at home.</li>
<li>Reuse - write a piece of code once and instantiate it as an app as many times as you need with different parameters e.g. a motion light program that you can use in 5 different places around your home. The code stays the same, you just dynamically add new instances of it in the config file</li> <li>Reuse - write a piece of code once and instantiate it as an app as many times as you need with different parameters e.g. a motion light program that you can use in 5 different places around your home. The code stays the same, you just dynamically add new instances of it in the config file</li>
<li>Dynamic - <code>AppDaemon</code> has been designed from the start to enable the user to make changes without requiring a restart of Home Assistant, thanks to its loose coupling. However, it is better than that - the user can make changes to code and <code>AppDaemon</code> will automatically reload the code, figure out which Apps were using it and restart them to use the new code without the need to restart <code>AppDaemon</code> itself. It is also possible to change parameters for an individual or multiple apps and have them picked up dynamically, and for a final trick, removing or adding apps is also picked up dynamically. Testing cycles become a lot more efficient as a result.</li> <li>Dynamic - <code class="highlighter-rouge">AppDaemon</code> has been designed from the start to enable the user to make changes without requiring a restart of Home Assistant, thanks to its loose coupling. However, it is better than that - the user can make changes to code and <code class="highlighter-rouge">AppDaemon</code> will automatically reload the code, figure out which Apps were using it and restart them to use the new code without the need to restart <code class="highlighter-rouge">AppDaemon</code> itself. It is also possible to change parameters for an individual or multiple apps and have them picked up dynamically, and for a final trick, removing or adding apps is also picked up dynamically. Testing cycles become a lot more efficient as a result.</li>
<li>Complex logic - Pythons If/Else constructs are clearer and easier to code for arbitrarily complex nested logic</li> <li>Complex logic - Pythons If/Else constructs are clearer and easier to code for arbitrarily complex nested logic</li>
<li>Durable variables and state - variables can be kept between events to keep track of things like the number of times a motion sensor has been activated, or how long it has been since a door opened</li> <li>Durable variables and state - variables can be kept between events to keep track of things like the number of times a motion sensor has been activated, or how long it has been since a door opened</li>
<li>All the power of Python - use any of Pythons libraries, create your own modules, share variables, refactor and re-use code, create a single app to do everything, or multiple apps for individual tasks - nothing is off limits!</li> <li>All the power of Python - use any of Pythons libraries, create your own modules, share variables, refactor and re-use code, create a single app to do everything, or multiple apps for individual tasks - nothing is off limits!</li>
</ul> </ul>
<p>It is in fact a testament to Home Assistants open nature that a component like <code>AppDaemon</code> can be integrated so neatly and closely that it acts in all ways like an extension of the system, not a second class citizen. Part of the strength of Home Assistants underlying design is that it makes no assumptions whatever about what it is controlling or reacting to, or reporting state on. This is made achievable in part by the great flexibility of Python as a programming environment for Home Assistant, and carrying that forward has enabled me to use the same philosophy for <code>AppDaemon</code> - it took surprisingly little code to be able to respond to basic events and call services in a completely open ended manner - the bulk of the work after that was adding additonal functions to make things that were already possible easier.</p> <p>It is in fact a testament to Home Assistants open nature that a component like <code class="highlighter-rouge">AppDaemon</code> can be integrated so neatly and closely that it acts in all ways like an extension of the system, not a second class citizen. Part of the strength of Home Assistants underlying design is that it makes no assumptions whatever about what it is controlling or reacting to, or reporting state on. This is made achievable in part by the great flexibility of Python as a programming environment for Home Assistant, and carrying that forward has enabled me to use the same philosophy for <code class="highlighter-rouge">AppDaemon</code> - it took surprisingly little code to be able to respond to basic events and call services in a completely open ended manner - the bulk of the work after that was adding additonal functions to make things that were already possible easier.</p>
<h2><a class="title-link" name="how-it-works" href="#how-it-works"></a> How it Works</h2> <h2><a class="title-link" name="how-it-works" href="#how-it-works"></a> How it Works</h2>
<p>The best way to show what <code>AppDaemon</code> does is through a few simple examples.</p> <p>The best way to show what <code class="highlighter-rouge">AppDaemon</code> does is through a few simple examples.</p>
<h3><a class="title-link" name="sunrisesunset-lighting" href="#sunrisesunset-lighting"></a> Sunrise/Sunset Lighting</h3> <h3><a class="title-link" name="sunrisesunset-lighting" href="#sunrisesunset-lighting"></a> Sunrise/Sunset Lighting</h3>
<p>Lets start with a simple App to turn a light on every night at sunset and off every morning at sunrise. Every App when first started will have its <code>initialize()</code> function called which gives it a chance to register a callback for <code>AppDaemons</code>s scheduler for a specific time. In this case we are using <code>run_at_sunrise()</code> and <code>run_at_sunset()</code> to register 2 separate callbacks. The argument <code>0</code> is the number of seconds offset from sunrise or sunset and can be negative or positive. For complex intervals it can be convenient to use Pythons <code>datetime.timedelta</code> class for calculations. When sunrise or sunset occurs, the appropriate callback function, <code>sunrise_cb()</code> or <code>sunset_cb()</code> is called which then makes a call to Home Assistant to turn the porch light on or off by activating a scene. The variables <code>args["on_scene"]</code> and <code>args["off_scene"]</code> are passed through from the configuration of this particular App, and the same code could be reused to activate completely different scenes in a different version of the App.</p> <p>Lets start with a simple App to turn a light on every night at sunset and off every morning at sunrise. Every App when first started will have its <code class="highlighter-rouge">initialize()</code> function called which gives it a chance to register a callback for <code class="highlighter-rouge">AppDaemons</code>s scheduler for a specific time. In this case we are using <code class="highlighter-rouge">run_at_sunrise()</code> and <code class="highlighter-rouge">run_at_sunset()</code> to register 2 separate callbacks. The argument <code class="highlighter-rouge">0</code> is the number of seconds offset from sunrise or sunset and can be negative or positive. For complex intervals it can be convenient to use Pythons <code class="highlighter-rouge">datetime.timedelta</code> class for calculations. When sunrise or sunset occurs, the appropriate callback function, <code class="highlighter-rouge">sunrise_cb()</code> or <code class="highlighter-rouge">sunset_cb()</code> is called which then makes a call to Home Assistant to turn the porch light on or off by activating a scene. The variables <code class="highlighter-rouge">args["on_scene"]</code> and <code class="highlighter-rouge">args["off_scene"]</code> are passed through from the configuration of this particular App, and the same code could be reused to activate completely different scenes in a different version of the App.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-python highlighter-rouge"><pre class="highlight"><code><span class="kn">import</span> <span class="nn">appapi</span>
<div class="code"><pre><span class="keyword">import</span> <span class="include">appapi</span>
<span class="keyword">class</span> <span class="class">OutsideLights</span>(appapi.AppDaemon): <span class="k">class</span> <span class="nc">OutsideLights</span><span class="p">(</span><span class="n">appapi</span><span class="o">.</span><span class="n">AppDaemon</span><span class="p">):</span>
<span class="keyword">def</span> <span class="function">initialize</span>(<span class="predefined-constant">self</span>): <span class="k">def</span> <span class="nf">initialize</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="predefined-constant">self</span>.run_at_sunrise(<span class="predefined-constant">self</span>.sunrise_cb, <span class="integer">0</span>) <span class="bp">self</span><span class="o">.</span><span class="n">run_at_sunrise</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sunrise_cb</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="predefined-constant">self</span>.run_at_sunset(<span class="predefined-constant">self</span>.sunset_cb, <span class="integer">0</span>) <span class="bp">self</span><span class="o">.</span><span class="n">run_at_sunset</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sunset_cb</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="keyword">def</span> <span class="function">sunrise_cb</span>(<span class="predefined-constant">self</span>, args, kwargs):
<span class="predefined-constant">self</span>.turn_on(<span class="predefined-constant">self</span>.args[<span class="string"><span class="delimiter">&quot;</span><span class="content">off_scene</span><span class="delimiter">&quot;</span></span>])
<span class="keyword">def</span> <span class="function">sunset_cb</span>(<span class="predefined-constant">self</span>, args, kwargs): <span class="k">def</span> <span class="nf">sunrise_cb</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">kwargs</span><span class="p">):</span>
<span class="predefined-constant">self</span>.turn_on(<span class="predefined-constant">self</span>.args[<span class="string"><span class="delimiter">&quot;</span><span class="content">on_scene</span><span class="delimiter">&quot;</span></span>]) <span class="bp">self</span><span class="o">.</span><span class="n">turn_on</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s">"off_scene"</span><span class="p">])</span>
</pre></div> <span class="k">def</span> <span class="nf">sunset_cb</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">kwargs</span><span class="p">):</span>
</div> <span class="bp">self</span><span class="o">.</span><span class="n">turn_on</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s">"on_scene"</span><span class="p">])</span>
</code></pre>
</div> </div>
<p>This is also fairly easy to achieve with Home Assistant automations, but we are just getting started.</p> <p>This is also fairly easy to achieve with Home Assistant automations, but we are just getting started.</p>
<h3><a class="title-link" name="motion-light" href="#motion-light"></a> Motion Light</h3> <h3><a class="title-link" name="motion-light" href="#motion-light"></a> Motion Light</h3>
<p>Our next example is to turn on a light when motion is detected and it is dark, and turn it off after a period of time. This time, the <code>initialize()</code> function registers a callback on a state change (of the motion sensor) rather than a specific time. We tell <code>AppDaemon</code> that we are only interested in state changes where the motion detector comes on by adding an additional parameter to the callback registration - <code>new = "on"</code>. When the motion is detected, the callack function <code>motion()</code> is called, and we check whether or not the sun has set using a built-in convenience function: <code>sun_down()</code>. Next, we turn the light on with <code>turn_on()</code>, then set a timer using <code>run_in()</code> to turn the light off after 60 seconds, which is another call to the scheduler to execute in a set time from now, which results in <code>AppDaemon</code> calling <code>light_off()</code> 60 seconds later using the <code>turn_off()</code> call to actually turn the light off. This is still pretty simple in code terms:</p> <p>Our next example is to turn on a light when motion is detected and it is dark, and turn it off after a period of time. This time, the <code class="highlighter-rouge">initialize()</code> function registers a callback on a state change (of the motion sensor) rather than a specific time. We tell <code class="highlighter-rouge">AppDaemon</code> that we are only interested in state changes where the motion detector comes on by adding an additional parameter to the callback registration - <code class="highlighter-rouge">new = "on"</code>. When the motion is detected, the callack function <code class="highlighter-rouge">motion()</code> is called, and we check whether or not the sun has set using a built-in convenience function: <code class="highlighter-rouge">sun_down()</code>. Next, we turn the light on with <code class="highlighter-rouge">turn_on()</code>, then set a timer using <code class="highlighter-rouge">run_in()</code> to turn the light off after 60 seconds, which is another call to the scheduler to execute in a set time from now, which results in <code class="highlighter-rouge">AppDaemon</code> calling <code class="highlighter-rouge">light_off()</code> 60 seconds later using the <code class="highlighter-rouge">turn_off()</code> call to actually turn the light off. This is still pretty simple in code terms:</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-python highlighter-rouge"><pre class="highlight"><code><span class="kn">import</span> <span class="nn">appapi</span>
<div class="code"><pre><span class="keyword">import</span> <span class="include">appapi</span>
<span class="keyword">class</span> <span class="class">MotionLights</span>(appapi.AppDaemon): <span class="k">class</span> <span class="nc">MotionLights</span><span class="p">(</span><span class="n">appapi</span><span class="o">.</span><span class="n">AppDaemon</span><span class="p">):</span>
<span class="keyword">def</span> <span class="function">initialize</span>(<span class="predefined-constant">self</span>): <span class="k">def</span> <span class="nf">initialize</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="predefined-constant">self</span>.listen_state(<span class="predefined-constant">self</span>.motion, <span class="string"><span class="delimiter">&quot;</span><span class="content">binary_sensor.drive</span><span class="delimiter">&quot;</span></span>, new = <span class="string"><span class="delimiter">&quot;</span><span class="content">on</span><span class="delimiter">&quot;</span></span>) <span class="bp">self</span><span class="o">.</span><span class="n">listen_state</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">motion</span><span class="p">,</span> <span class="s">"binary_sensor.drive"</span><span class="p">,</span> <span class="n">new</span> <span class="o">=</span> <span class="s">"on"</span><span class="p">)</span>
<span class="keyword">def</span> <span class="function">motion</span>(<span class="predefined-constant">self</span>, entity, attribute, old, new, kwargs): <span class="k">def</span> <span class="nf">motion</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">entity</span><span class="p">,</span> <span class="n">attribute</span><span class="p">,</span> <span class="n">old</span><span class="p">,</span> <span class="n">new</span><span class="p">,</span> <span class="n">kwargs</span><span class="p">):</span>
<span class="keyword">if</span> <span class="predefined-constant">self</span>.sun_down(): <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">sun_down</span><span class="p">():</span>
<span class="predefined-constant">self</span>.turn_on(<span class="string"><span class="delimiter">&quot;</span><span class="content">light.drive</span><span class="delimiter">&quot;</span></span>) <span class="bp">self</span><span class="o">.</span><span class="n">turn_on</span><span class="p">(</span><span class="s">"light.drive"</span><span class="p">)</span>
<span class="predefined-constant">self</span>.run_in(<span class="predefined-constant">self</span>.light_off, <span class="integer">60</span>) <span class="bp">self</span><span class="o">.</span><span class="n">run_in</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">light_off</span><span class="p">,</span> <span class="mi">60</span><span class="p">)</span>
<span class="keyword">def</span> <span class="function">light_off</span>(<span class="predefined-constant">self</span>, kwargs): <span class="k">def</span> <span class="nf">light_off</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">kwargs</span><span class="p">):</span>
<span class="predefined-constant">self</span>.turn_off(<span class="string"><span class="delimiter">&quot;</span><span class="content">light.drive</span><span class="delimiter">&quot;</span></span>) <span class="bp">self</span><span class="o">.</span><span class="n">turn_off</span><span class="p">(</span><span class="s">"light.drive"</span><span class="p">)</span>
</pre></div> </code></pre>
</div>
</div> </div>
<p>This is starting to get a little more complex in Home Assistant automations requiring an Automation rule and two separate scripts.</p> <p>This is starting to get a little more complex in Home Assistant automations requiring an Automation rule and two separate scripts.</p>
<p>Now lets extend this with a somewhat artificial example to show something that is simple in <code>AppDaemon</code> but very difficult if not impossible using automations. Lets warn someone inside the house that there has been motion outside by flashing a lamp on and off 10 times. We are reacting to the motion as before by turning on the light and setting a timer to turn it off again, but in addition, we set a 1 second timer to run <code>flash_warning()</code> which when called, toggles the inside light and sets another timer to call itself a second later. To avoid re-triggering forever, it keeps a count of how many times it has been activated and bales out after 10 iterations.</p> <p>Now lets extend this with a somewhat artificial example to show something that is simple in <code class="highlighter-rouge">AppDaemon</code> but very difficult if not impossible using automations. Lets warn someone inside the house that there has been motion outside by flashing a lamp on and off 10 times. We are reacting to the motion as before by turning on the light and setting a timer to turn it off again, but in addition, we set a 1 second timer to run <code class="highlighter-rouge">flash_warning()</code> which when called, toggles the inside light and sets another timer to call itself a second later. To avoid re-triggering forever, it keeps a count of how many times it has been activated and bales out after 10 iterations.</p>
<div class="highlighter-coderay"><div class="CodeRay"> <div class="language-python highlighter-rouge"><pre class="highlight"><code><span class="kn">import</span> <span class="nn">appapi</span>
<div class="code"><pre><span class="keyword">import</span> <span class="include">appapi</span>
<span class="keyword">class</span> <span class="class">FlashyMotionLights</span>(appapi.AppDaemon): <span class="k">class</span> <span class="nc">FlashyMotionLights</span><span class="p">(</span><span class="n">appapi</span><span class="o">.</span><span class="n">AppDaemon</span><span class="p">):</span>
<span class="keyword">def</span> <span class="function">initialize</span>(<span class="predefined-constant">self</span>): <span class="k">def</span> <span class="nf">initialize</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="predefined-constant">self</span>.listen_state(<span class="predefined-constant">self</span>.motion, <span class="string"><span class="delimiter">&quot;</span><span class="content">binary_sensor.drive</span><span class="delimiter">&quot;</span></span>, new = <span class="string"><span class="delimiter">&quot;</span><span class="content">on</span><span class="delimiter">&quot;</span></span>) <span class="bp">self</span><span class="o">.</span><span class="n">listen_state</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">motion</span><span class="p">,</span> <span class="s">"binary_sensor.drive"</span><span class="p">,</span> <span class="n">new</span> <span class="o">=</span> <span class="s">"on"</span><span class="p">)</span>
<span class="keyword">def</span> <span class="function">motion</span>(<span class="predefined-constant">self</span>, entity, attribute, old, new, kwargs): <span class="k">def</span> <span class="nf">motion</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">entity</span><span class="p">,</span> <span class="n">attribute</span><span class="p">,</span> <span class="n">old</span><span class="p">,</span> <span class="n">new</span><span class="p">,</span> <span class="n">kwargs</span><span class="p">):</span>
<span class="keyword">if</span> <span class="predefined-constant">self</span>.self.sun_down(): <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="bp">self</span><span class="o">.</span><span class="n">sun_down</span><span class="p">():</span>
<span class="predefined-constant">self</span>.turn_on(<span class="string"><span class="delimiter">&quot;</span><span class="content">light.drive</span><span class="delimiter">&quot;</span></span>) <span class="bp">self</span><span class="o">.</span><span class="n">turn_on</span><span class="p">(</span><span class="s">"light.drive"</span><span class="p">)</span>
<span class="predefined-constant">self</span>.run_in(<span class="predefined-constant">self</span>.light_off, <span class="integer">60</span>) <span class="bp">self</span><span class="o">.</span><span class="n">run_in</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">light_off</span><span class="p">,</span> <span class="mi">60</span><span class="p">)</span>
<span class="predefined-constant">self</span>.flashcount = <span class="integer">0</span> <span class="bp">self</span><span class="o">.</span><span class="n">flashcount</span> <span class="o">=</span> <span class="mi">0</span>
<span class="predefined-constant">self</span>.run_in(<span class="predefined-constant">self</span>.flash_warning, <span class="integer">1</span>) <span class="bp">self</span><span class="o">.</span><span class="n">run_in</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">flash_warning</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="keyword">def</span> <span class="function">light_off</span>(<span class="predefined-constant">self</span>, kwargs): <span class="k">def</span> <span class="nf">light_off</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">kwargs</span><span class="p">):</span>
<span class="predefined-constant">self</span>.turn_off(<span class="string"><span class="delimiter">&quot;</span><span class="content">light.drive</span><span class="delimiter">&quot;</span></span>) <span class="bp">self</span><span class="o">.</span><span class="n">turn_off</span><span class="p">(</span><span class="s">"light.drive"</span><span class="p">)</span>
<span class="keyword">def</span> <span class="function">flash_warning</span>(<span class="predefined-constant">self</span>, kwargs): <span class="k">def</span> <span class="nf">flash_warning</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">kwargs</span><span class="p">):</span>
<span class="predefined-constant">self</span>.toggle(<span class="string"><span class="delimiter">&quot;</span><span class="content">light.living_room</span><span class="delimiter">&quot;</span></span>) <span class="bp">self</span><span class="o">.</span><span class="n">toggle</span><span class="p">(</span><span class="s">"light.living_room"</span><span class="p">)</span>
<span class="predefined-constant">self</span>.flashcount += <span class="integer">1</span> <span class="bp">self</span><span class="o">.</span><span class="n">flashcount</span> <span class="o">+=</span> <span class="mi">1</span>
<span class="keyword">if</span> <span class="predefined-constant">self</span>.flashcount &lt; <span class="integer">10</span>: <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">flashcount</span> <span class="o">&lt;</span> <span class="mi">10</span><span class="p">:</span>
<span class="predefined-constant">self</span>.run_in(<span class="predefined-constant">self</span>.flash_warning, <span class="integer">1</span>) <span class="bp">self</span><span class="o">.</span><span class="n">run_in</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">flash_warning</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
</pre></div> </code></pre>
</div>
</div> </div>
<p>Of course if I wanted to make this App or its predecessor reusable I would have provided parameters for the sensor, the light to activate on motion, the warning light and even the number of flashes and delay between flashes.</p> <p>Of course if I wanted to make this App or its predecessor reusable I would have provided parameters for the sensor, the light to activate on motion, the warning light and even the number of flashes and delay between flashes.</p>
<p>In addition, Apps can write to <code>AppDaemon</code>s logfiles, and there is a system of constraints that allows yout to control when and under what circumstances Apps and callbacks are active to keep the logic clean and simple.</p> <p>In addition, Apps can write to <code class="highlighter-rouge">AppDaemon</code>s logfiles, and there is a system of constraints that allows yout to control when and under what circumstances Apps and callbacks are active to keep the logic clean and simple.</p>
<p>I have spent the last few weeks moving all of my (fairly complex) automations over to <code>APPDaemon</code> and so far it is working very reliably.</p> <p>I have spent the last few weeks moving all of my (fairly complex) automations over to <code class="highlighter-rouge">APPDaemon</code> and so far it is working very reliably.</p>
<p>Some people will maybe look at all of this and say “what use is this, I can already do all of this”, and that is fine, as I said this is an alternative not a replacement, but I am hopeful that for some users this will seem a more natural, powerful and nimble way of building potentially very complex automations.</p> <p>Some people will maybe look at all of this and say “what use is this, I can already do all of this”, and that is fine, as I said this is an alternative not a replacement, but I am hopeful that for some users this will seem a more natural, powerful and nimble way of building potentially very complex automations.</p>
@ -306,7 +299,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -87,15 +87,15 @@
<div class="meta clearfix"> <div class="meta clearfix">
<time datetime="2016-08-19T06:00:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> August 19, 2016</time> <time datetime="2016-08-19T06:00:00+00:00" pubdate data-updated="true"><i class="icon-calendar"></i> August 19, 2016</time>
<span class="byline author vcard"><i class='icon-user'></i> Fabian Affolter</span> <span class="byline author vcard"><i class='icon-user'></i> Fabian Affolter</span>
<span><i class='icon-time'></i> less than one minute reading time</span> <span><i class='icon-time'></i> Less than one minute reading time</span>
<span> <span>
<i class="icon-tags"></i> <i class="icon-tags"></i>
<ul class="tags unstyled"> <ul class="tags unstyled">
<li><a class='category' href='/blog/categories/how-to/'>How-To</a></li> <li>How-To</li>
<li><a class='category' href='/blog/categories/iot-data/'>IoT-Data</a></li> <li>IoT-Data</li>
</ul> </ul>
@ -185,7 +185,7 @@ Heatmap
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

File diff suppressed because it is too large Load diff

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Community | Home Assistant]]></title> <title><![CDATA[Category: Community | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/community/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/community/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2016-08-22T07:26:42+00:00</updated> <updated>2016-08-22T08:20:27+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>
@ -18,32 +18,38 @@
<link href="https://home-assistant.io/blog/2016/06/01/community-highlights/"/> <link href="https://home-assistant.io/blog/2016/06/01/community-highlights/"/>
<updated>2016-06-01T18:34:00+00:00</updated> <updated>2016-06-01T18:34:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/06/01/community-highlights</id> <id>https://home-assistant.io/blog/2016/06/01/community-highlights</id>
<content type="html"><![CDATA[<p>Our community is amazingly helpful and creative. If you havent been there yet, make sure to stop by our <a href="https://gitter.im/home-assistant/home-assistant">chat room</a> and come hang out with us. In this blog post I want to highlight a few recent awesome projects and videos from the community.</p> <content type="html"><![CDATA[Our community is amazingly helpful and creative. If you haven't been there yet, make sure to stop by our [chat room] and come hang out with us. In this blog post I want to highlight a few recent awesome projects and videos from the community.
<h3><a class='title-link' name='scenegen---cli-for-making-scenes' href='#scenegen---cli-for-making-scenes'></a> SceneGen - cli for making scenes </h3> ### <a class='title-link' name='scenegen---cli-for-making-scenes' href='#scenegen---cli-for-making-scenes'></a> SceneGen - cli for making scenes
<p><a href="https://github.com/acockburn/scenegen">SceneGen</a> is a new command line utility developed by <a href="https://github.com/acockburn">Andrew Cockburn</a> that helps with creating scene configurations for Home Assistant. To use it, you put your house in the preferred state, run SceneGen and it will print the scene configuration for your current states.</p> [SceneGen] is a new command line utility developed by [Andrew Cockburn] that helps with creating scene configurations for Home Assistant. To use it, you put your house in the preferred state, run SceneGen and it will print the scene configuration for your current states.
<h3><a class='title-link' name='videos' href='#videos'></a> Videos </h3> ### <a class='title-link' name='videos' href='#videos'></a> Videos
<p><a href="https://partofthething.com">Nick Touran</a> has been working on integrating IR remotes with Home Assistant. He made it into a component which should be available in the next release which should arrive in a couple of days. In the meanwhile, he wrote up <a href="https://partofthething.com/thoughts/?p=1010">a blog post</a> and has put out a video showing the new integration, very cool!</p> [Nick Touran] has been working on integrating IR remotes with Home Assistant. He made it into a component which should be available in the next release which should arrive in a couple of days. In the meanwhile, he wrote up [a blog post] and has put out a video showing the new integration, very cool!
<div class="videoWrapper"> <div class='videoWrapper'>
<iframe width="560" height="315" src="https://www.youtube.com/embed/6I_Lfpda0hc" frameborder="0" allowfullscreen=""></iframe> <iframe width="560" height="315" src="https://www.youtube.com/embed/6I_Lfpda0hc" frameborder="0" allowfullscreen></iframe>
</div> </div>
<p>Ben from <a href="http://www.bruhautomation.com/">BRUH Automation</a> has put out another great video how to get started tracking your location in Home Assistant using MQTT and OwnTracks.</p> Ben from [BRUH Automation] has put out another great video how to get started tracking your location in Home Assistant using MQTT and OwnTracks.
<div class="videoWrapper"> <div class='videoWrapper'>
<iframe width="560" height="315" src="https://www.youtube.com/embed/VaWdvVVYU3A" frameborder="0" allowfullscreen=""></iframe> <iframe width="560" height="315" src="https://www.youtube.com/embed/VaWdvVVYU3A" frameborder="0" allowfullscreen></iframe>
</div> </div>
<p>Muhammed Kilic has created a video how to make your Home Assistant instance accessible from the internet using the free dynamic DNS service DuckDNS.</p> Muhammed Kilic has created a video how to make your Home Assistant instance accessible from the internet using the free dynamic DNS service DuckDNS.
<div class="videoWrapper"> <div class='videoWrapper'>
<iframe width="560" height="315" src="https://www.youtube.com/embed/UM15pRk56h8" frameborder="0" allowfullscreen=""></iframe> <iframe width="560" height="315" src="https://www.youtube.com/embed/UM15pRk56h8" frameborder="0" allowfullscreen></iframe>
</div> </div>
[chat room]: https://gitter.im/home-assistant/home-assistant
[SceneGen]: https://github.com/acockburn/scenegen
[Andrew Cockburn]: https://github.com/acockburn
[BRUH Automation]: http://www.bruhautomation.com/
[Nick Touran]: https://partofthething.com
[a blog post]: https://partofthething.com/thoughts/?p=1010
]]></content> ]]></content>
</entry> </entry>
@ -52,55 +58,51 @@
<link href="https://home-assistant.io/blog/2016/02/20/community-highlights/"/> <link href="https://home-assistant.io/blog/2016/02/20/community-highlights/"/>
<updated>2016-02-20T09:06:00+00:00</updated> <updated>2016-02-20T09:06:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/02/20/community-highlights</id> <id>https://home-assistant.io/blog/2016/02/20/community-highlights</id>
<content type="html"><![CDATA[<p>Home Assistant land has been busy and a lot of people have been creating awesome stuff. Weve added <a href="/cookbook/">a cookbook section</a> to the website full of examples how you can automate different things. Make sure you take a look and share your own recipes too!</p> <content type="html"><![CDATA[Home Assistant land has been busy and a lot of people have been creating awesome stuff. We've added [a cookbook section](/cookbook/) to the website full of examples how you can automate different things. Make sure you take a look and share your own recipes too!
<h3><a class='title-link' name='home-automation-demo-by-part-of-the-thing' href='#home-automation-demo-by-part-of-the-thing'></a> Home automation demo by Part of the Thing </h3> ### <a class='title-link' name='home-automation-demo-by-part-of-the-thing' href='#home-automation-demo-by-part-of-the-thing'></a> Home automation demo by Part of the Thing
<div class="videoWrapper"> <div class='videoWrapper'>
<iframe width="560" height="315" src="https://www.youtube.com/embed/Mc_29EC3aZw" frameborder="0" allowfullscreen=""></iframe> <iframe width="560" height="315" src="https://www.youtube.com/embed/Mc_29EC3aZw" frameborder="0" allowfullscreen></iframe>
</div> </div>
<h3><a class='title-link' name='haaska---alexa-skill-adapter-for-home-assistant' href='#haaska---alexa-skill-adapter-for-home-assistant'></a> Haaska - Alexa Skill Adapter for Home Assistant </h3> ### <a class='title-link' name='haaska---alexa-skill-adapter-for-home-assistant' href='#haaska---alexa-skill-adapter-for-home-assistant'></a> Haaska - Alexa Skill Adapter for Home Assistant
<p>Haaska allows you to control lights, switches, and scenes exposed by your Home Assistant instance using an Amazon Echo. This is different from our own <a href="/components/alexa/">Alexa</a> component because it will teach the Amazon Echo directly about the devices instead of teaching it to talk to Home Assistant. It will not allow you to use custom sentences but it will allow you to skip the Ask Home Assistant part when giving commands:</p> Haaska allows you to control lights, switches, and scenes exposed by your Home Assistant instance using an Amazon Echo. This is different from our own [Alexa](/components/alexa/) component because it will teach the Amazon Echo directly about the devices instead of teaching it to talk to Home Assistant. It will not allow you to use custom sentences but it will allow you to skip the 'Ask Home Assistant' part when giving commands:
<ul> - "Alexa, set kitchen to twenty percent"
<li>“Alexa, set kitchen to twenty percent”</li> - "Alexa, turn on evening scene"
<li>“Alexa, turn on evening scene”</li> - "Alexa, turn off bedroom light"
<li>“Alexa, turn off bedroom light”</li>
</ul>
<p><a href="https://github.com/auchter/haaska">Haaska on GitHub</a></p> [Haaska on GitHub](https://github.com/auchter/haaska)
<h3><a class='title-link' name='integrating-home-assistant-with-homekit' href='#integrating-home-assistant-with-homekit'></a> Integrating Home Assistant with HomeKit </h3> ### <a class='title-link' name='integrating-home-assistant-with-homekit' href='#integrating-home-assistant-with-homekit'></a> Integrating Home Assistant with HomeKit
<p>Contributor Maddox has created a plugin for HomeBridge, an open-source HomeKit bridge. This will allow you to control your home using Siri on your Apple devices. HomeBridge has recently restructured so youll have to install the plugin separately with the homebridge-homeassistant npm package.</p> Contributor Maddox has created a plugin for HomeBridge, an open-source HomeKit bridge. This will allow you to control your home using Siri on your Apple devices. HomeBridge has recently restructured so you'll have to install the plugin separately with the homebridge-homeassistant npm package.
<p>Example config.json entry to load Home Assistant:</p> Example config.json entry to load Home Assistant:
<div class="highlighter-coderay"><div class="CodeRay"> ```json
<div class="code"><pre><span class="key"><span class="delimiter">&quot;</span><span class="content">platforms</span><span class="delimiter">&quot;</span></span>: [ "platforms": [
{ {
<span class="key"><span class="delimiter">&quot;</span><span class="content">platform</span><span class="delimiter">&quot;</span></span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">HomeAssistant</span><span class="delimiter">&quot;</span></span>, "platform": "HomeAssistant",
<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">HomeAssistant</span><span class="delimiter">&quot;</span></span>, "name": "HomeAssistant",
<span class="key"><span class="delimiter">&quot;</span><span class="content">host</span><span class="delimiter">&quot;</span></span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">http://192.168.1.50:8123</span><span class="delimiter">&quot;</span></span>, "host": "http://192.168.1.50:8123",
<span class="key"><span class="delimiter">&quot;</span><span class="content">password</span><span class="delimiter">&quot;</span></span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">xxx</span><span class="delimiter">&quot;</span></span>, "password": "xxx",
<span class="key"><span class="delimiter">&quot;</span><span class="content">supported_types</span><span class="delimiter">&quot;</span></span>: [<span class="string"><span class="delimiter">&quot;</span><span class="content">light</span><span class="delimiter">&quot;</span></span>, <span class="string"><span class="delimiter">&quot;</span><span class="content">switch</span><span class="delimiter">&quot;</span></span>, <span class="string"><span class="delimiter">&quot;</span><span class="content">media_player</span><span class="delimiter">&quot;</span></span>, <span class="string"><span class="delimiter">&quot;</span><span class="content">scene</span><span class="delimiter">&quot;</span></span>] "supported_types": ["light", "switch", "media_player", "scene"]
} }
] ]
</pre></div> ```
</div>
</div>
<p><a href="https://github.com/nfarina/homebridge">HomeBridge on GitHub</a><br /> [HomeBridge on GitHub](https://github.com/nfarina/homebridge)
<a href="https://github.com/maddox/homebridge-homeassistant">HomeBridge Home Assistant Plugin</a></p> [HomeBridge Home Assistant Plugin](https://github.com/maddox/homebridge-homeassistant)
<h3><a class='title-link' name='custom-alarm-system-with-home-assistant' href='#custom-alarm-system-with-home-assistant'></a> Custom alarm system with Home Assistant </h3> ### <a class='title-link' name='custom-alarm-system-with-home-assistant' href='#custom-alarm-system-with-home-assistant'></a> Custom alarm system with Home Assistant
<p>User thaijames <a href="https://community.home-assistant.io/t/controlling-house-alarm-from-ha/67">describes in the Home Assistant forums</a> how he has created his own NFC-based alarm system using Home Assistant, DIY components and Garfield dolls.</p> User thaijames [describes in the Home Assistant forums](https://community.home-assistant.io/t/controlling-house-alarm-from-ha/67) how he has created his own NFC-based alarm system using Home Assistant, DIY components and Garfield dolls.
<p class="img"> <p class='img'>
<img src="https://home-assistant.io/images/blog/2016-02-community-highlights/garfield-nfc.png" /> <img src='https://home-assistant.io/images/blog/2016-02-community-highlights/garfield-nfc.png'>
Hold your NFC tag against the belly of Garfield to unlock the alarm. Hold your NFC tag against the belly of Garfield to unlock the alarm.
</p> </p>
]]></content> ]]></content>
@ -111,17 +113,17 @@ Hold your NFC tag against the belly of Garfield to unlock the alarm.
<link href="https://home-assistant.io/blog/2015/12/05/community-highlights/"/> <link href="https://home-assistant.io/blog/2015/12/05/community-highlights/"/>
<updated>2015-12-05T23:39:00+00:00</updated> <updated>2015-12-05T23:39:00+00:00</updated>
<id>https://home-assistant.io/blog/2015/12/05/community-highlights</id> <id>https://home-assistant.io/blog/2015/12/05/community-highlights</id>
<content type="html"><![CDATA[<p>From time to time we come along things that are worth sharing with fellow Home Assisters. Here a list of some cool stuff from last week:</p> <content type="html"><![CDATA[From time to time we come along things that are worth sharing with fellow Home Assisters. Here a list of some cool stuff from last week:
<p>First is the public beta of <a href="https://letsencrypt.org/">Lets Encrypt</a>. Lets Encrypt is a new certificate authority that is free, automated and open. This means that it will now be very easy to secure your connection to Home Assistant while you are away from home. W1ll1am23 has written up <a href="https://community.home-assistant.io/t/homeassistant-nginx-ssl-proxy-setup/53">a guide how to get started</a>.</p> First is the public beta of [Let's Encrypt](https://letsencrypt.org/). Let's Encrypt is a new certificate authority that is free, automated and open. This means that it will now be very easy to secure your connection to Home Assistant while you are away from home. W1ll1am23 has written up [a guide how to get started](https://community.home-assistant.io/t/homeassistant-nginx-ssl-proxy-setup/53).
<p>The next thing is a show-off of some of the cool stuff people do with Home Assistant. This is miniconfig talking to Home Assistant using the Amazon Echo!</p> The next thing is a show-off of some of the cool stuff people do with Home Assistant. This is miniconfig talking to Home Assistant using the Amazon Echo!
<div class="videoWrapper"> <div class='videoWrapper'>
<iframe width="560" height="315" src="https://www.youtube.com/embed/9QQjklnSQKY" frameborder="0" allowfullscreen=""></iframe> <iframe width="560" height="315" src="https://www.youtube.com/embed/9QQjklnSQKY" frameborder="0" allowfullscreen></iframe>
</div> </div>
<p>And last but not least, Midwestern Mac did a <a href="http://www.midwesternmac.com/blogs/jeff-geerling/raspberry-pi-microsd-card">microSD card performance comparison</a> for the Raspberry Pi. If youre using a Pi, make sure to check it out!</p> And last but not least, Midwestern Mac did a [microSD card performance comparison](http://www.midwesternmac.com/blogs/jeff-geerling/raspberry-pi-microsd-card) for the Raspberry Pi. If you're using a Pi, make sure to check it out!
]]></content> ]]></content>
</entry> </entry>

View file

@ -271,7 +271,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Device-Tracking | Home Assistant]]></title> <title><![CDATA[Category: Device-Tracking | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/device-tracking/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/device-tracking/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2016-08-22T07:26:42+00:00</updated> <updated>2016-08-22T08:20:27+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>
@ -18,153 +18,152 @@
<link href="https://home-assistant.io/blog/2016/05/26/ibeacons-how-to-track-things-that-cant-track-themselves-part-ii/"/> <link href="https://home-assistant.io/blog/2016/05/26/ibeacons-how-to-track-things-that-cant-track-themselves-part-ii/"/>
<updated>2016-05-26T11:06:12+00:00</updated> <updated>2016-05-26T11:06:12+00:00</updated>
<id>https://home-assistant.io/blog/2016/05/26/ibeacons-how-to-track-things-that-cant-track-themselves-part-ii</id> <id>https://home-assistant.io/blog/2016/05/26/ibeacons-how-to-track-things-that-cant-track-themselves-part-ii</id>
<content type="html"><![CDATA[<p><em>This post is by Home Assistant contributor <a href="https://github.com/pavoni">Greg Dowling</a>.</em></p> <content type="html"><![CDATA[_This post is by Home Assistant contributor [Greg Dowling](https://github.com/pavoni)._
<p>In <a href="/blog/2016/04/30/ibeacons-part-1-making-presence-detection-work-better">Part 1</a> I talked about using iBeacons to improve presence tracking. In part 2 Ill talk about how to track things like keys that cant track themselves by using iBeacons.</p>
<h3><a class='title-link' name='tracking-things-using-ibeacons' href='#tracking-things-using-ibeacons'></a> Tracking things using iBeacons </h3> In [Part 1](/blog/2016/04/30/ibeacons-part-1-making-presence-detection-work-better) I talked about using iBeacons to improve presence tracking. In part 2 Ill talk about how to track things like keys that cant track themselves by using iBeacons.
<p>In the first part I mentioned that iBeacons just send out <em>Im here</em> packets, and we used this to trigger an update when your phone came close to a fixed beacon.</p>
<p>But beacons dont have to be fixed.</p> ### <a class='title-link' name='tracking-things-using-ibeacons' href='#tracking-things-using-ibeacons'></a> Tracking things using iBeacons
In the first part I mentioned that iBeacons just send out *Im here* packets, and we used this to trigger an update when your phone came close to a fixed beacon.
<p>Your phone knows roughly where it is located (based on mobile phone masts, Wi-Fi networks or GPS). If your phone sees an <em>Im here</em> message then it knows the beacon is close.</p> But beacons dont have to be fixed.
<p>If your phone can remember (or tell a server) where it was when it last saw the iBeacon - then it knows where the beacon was. So the result of this is that you can track where an iBeacon was - even though the iBeacon doesnt have any tracking technology itself.</p> Your phone knows roughly where it is located (based on mobile phone masts, Wi-Fi networks or GPS). If your phone sees an *Im here* message then it knows the beacon is close.
<p>So if you put an iBeacon on your keys or in your car - then you can track them.</p> If your phone can remember (or tell a server) where it was when it last saw the iBeacon - then it knows where the beacon was. So the result of this is that you can track where an iBeacon was - even though the iBeacon doesn't have any tracking technology itself.
<p class="img"> So if you put an iBeacon on your keys or in your car - then you can track them.
<img width="200" src="https://home-assistant.io/images/blog/2016-05-ibeacons/keys_with_beacon.jpg" />
<p class='img'>
<img width='200' src='https://home-assistant.io/images/blog/2016-05-ibeacons/keys_with_beacon.jpg'>
Here are my keys - with a Estimote Nearable iBeacon stuck to them. Ugly but effective! Here are my keys - with a Estimote Nearable iBeacon stuck to them. Ugly but effective!
</p> </p>
<!--more--> <!--more-->
<p>Its easier to set up OwnTracks and HA to track a mobile beacon than the fixed beacon I discussed in Part 1, because you only need to tell OwnTracks about your iBeacon. You dont need to configure HA at all.</p> Its easier to set up OwnTracks and HA to track a mobile beacon than the fixed beacon I discussed in Part 1, because you only need to tell OwnTracks about your iBeacon. You dont need to configure HA at all.
<p class="note warning">OwnTracks currently only supports mobile beacons on iOS.</p> <p class='note warning'>OwnTracks currently only supports mobile beacons on iOS.</p>
<p>You set up the beacon the same way as we discussed in part 1. The only difference is that instead of calling the region the name of a location (eg -drive) you call it the name of the device you want to track (eg -keys). Remember the leading - that makes the connection more reliable.</p> You set up the beacon the same way as we discussed in part 1. The only difference is that instead of calling the region the name of a location (eg -drive) you call it the name of the device you want to track (eg -keys). Remember the leading - that makes the connection more reliable.
<p class="img"> <p class='img'>
<img width="200" src="https://home-assistant.io/images/blog/2016-04-ibeacons/owntracks_beacon_setup.png" /> <img width='200' src='https://home-assistant.io/images/blog/2016-04-ibeacons/owntracks_beacon_setup.png'>
</p> </p>
<p>Once youve added the iBeacon - you should be able to see it on the OwnTracks region screen. If your phone can see the packets from that beacon, OwnTracks will turn the relevant Region red.</p> Once youve added the iBeacon - you should be able to see it on the OwnTracks region screen. If your phone can see the packets from that beacon, OwnTracks will turn the relevant Region red.
<p>Because you turned <em>Share</em> on for the region, when OwnTracks sees the beacon it will send HA a message. HA will use this message to add the beacon as a tracked device if it hasnt seen it before. So you should see a new device appear in HA called device_tracker.beacon_[name] - and its location will be where your phone thought it was when it last saw the beacon.</p> Because you turned *Share* on for the region, when OwnTracks sees the beacon it will send HA a message. HA will use this message to add the beacon as a tracked device if it hasnt seen it before. So you should see a new device appear in HA called device_tracker.beacon_[name] - and its location will be where your phone thought it was when it last saw the beacon.
<p class="img"> <p class='img'>
<img width="200" src="https://home-assistant.io/images/blog/2016-05-ibeacons/keys_device.png" /> <img width='200' src='https://home-assistant.io/images/blog/2016-05-ibeacons/keys_device.png'>
</p> </p>
<p>If your phone moves and sends HA a new location while it is still in range of the beacon - HA will update the location of the beacon. So if go for a drive in your car - you will see both your phone and the <em>device_tracker.beacon_car</em> move together.</p> If your phone moves and sends HA a new location while it is still in range of the beacon - HA will update the location of the beacon. So if go for a drive in your car - you will see both your phone and the *device_tracker.beacon_car* move together.
<p>If you park your car and go shopping - <em>device_tracker.beacon_car</em> will stop moving.</p> If you park your car and go shopping - *device_tracker.beacon_car* will stop moving.
<p>With the basic tracking working - you can use automation to do things like open your gates if your car comes home</p> With the basic tracking working - you can use automation to do things like open your gates if your car comes home
<div class="highlighter-coderay"><div class="CodeRay"> ```yaml
<div class="code"><pre><span class="key">automation</span>: automation:
- <span class="string"><span class="content">alias: 'Open gate'</span></span> - alias: 'Open gate'
<span class="key">trigger</span>: trigger:
- <span class="string"><span class="content">platform: state</span></span> - platform: state
<span class="key">entity_id</span>: <span class="string"><span class="content">device_tracker.beacon_car</span></span> entity_id: device_tracker.beacon_car
<span class="key">from</span>: <span class="string"><span class="content">'not_home'</span></span> from: 'not_home'
<span class="key">to</span>: <span class="string"><span class="content">'home'</span></span> to: 'home'
<span class="key">condition</span>: condition:
- <span class="string"><span class="content">condition: state</span></span> - condition: state
<span class="key">entity_id</span>: <span class="string"><span class="content">switch.gate</span></span> entity_id: switch.gate
<span class="key">state</span>: <span class="string"><span class="content">'off'</span></span> state: 'off'
<span class="key">action</span>: action:
<span class="key">service</span>: <span class="string"><span class="content">switch.turn_on</span></span> service: switch.turn_on
<span class="key">entity_id</span>: <span class="string"><span class="content">switch.gate</span></span> entity_id: switch.gate
</pre></div> ```
</div>
</div>
<p>Or warn you if you leave your keys behind</p> Or warn you if you leave your keys behind
<div class="highlighter-coderay"><div class="CodeRay"> ```yaml
<div class="code"><pre><span class="key">automation</span>: automation:
- <span class="string"><span class="content">alias: 'Forgotten keys'</span></span> - alias: 'Forgotten keys'
<span class="key">trigger</span>: trigger:
<span class="key">platform</span>: <span class="string"><span class="content">template</span></span> platform: template
<span class="key">value_template</span>: <span class="string"><span class="content">'{{states.device_tracker.greg_gregphone.state != states.device_tracker.beacon_keys.state}}'</span></span> value_template: '{{ states.device_tracker.greg_gregphone.state != states.device_tracker.beacon_keys.state}}'
<span class="key">condition</span>: condition:
<span class="key">condition</span>: <span class="string"><span class="content">template</span></span> condition: template
<span class="key">value_template</span>: <span class="string"><span class="content">'{{ states.device_tracker.greg_gregphone.state != &quot;home&quot; }}'</span></span> value_template: '{{ states.device_tracker.greg_gregphone.state != "home" }}'
<span class="key">action</span>: action:
<span class="key">service</span>: <span class="string"><span class="content">script.turn_on</span></span> service: script.turn_on
<span class="key">entity_id</span>: <span class="string"><span class="content">script.send_key_alert</span></span> entity_id: script.send_key_alert
- <span class="string"><span class="content">alias: 'Forgotten keys - cancel'</span></span> - alias: 'Forgotten keys - cancel'
<span class="key">trigger</span>: trigger:
<span class="key">platform</span>: <span class="string"><span class="content">template</span></span> platform: template
<span class="key">value_template</span>: <span class="string"><span class="content">'{{states.device_tracker.greg_gregphone.state == states.device_tracker.beacon_keys.state}}'</span></span> value_template: '{{ states.device_tracker.greg_gregphone.state == states.device_tracker.beacon_keys.state }}'
<span class="key">condition</span>: condition:
- <span class="string"><span class="content">condition: state</span></span> - condition: state
<span class="key">entity_id</span>: <span class="string"><span class="content">script.send_key_alert</span></span> entity_id: script.send_key_alert
<span class="key">state</span>: <span class="string"><span class="content">'on'</span></span> state: 'on'
<span class="key">action</span>: action:
<span class="key">service</span>: <span class="string"><span class="content">script.turn_off</span></span> service: script.turn_off
<span class="key">entity_id</span>: <span class="string"><span class="content">script.send_key_alert</span></span> entity_id: script.send_key_alert
</pre></div> ```
</div>
</div>
<div class="highlighter-coderay"><div class="CodeRay"> ```yaml
<div class="code"><pre><span class="key">script</span>: script:
<span class="key">send_key_alert</span>: send_key_alert:
<span class="key">sequence</span>: sequence:
- <span class="string"><span class="content">delay:</span><span class="content"> - delay:
minutes: 2</span></span> minutes: 2
- <span class="string"><span class="content">service: notify.notify</span></span> - service: notify.notify
<span class="key">data</span>: data:
<span class="key">message</span>: <span class="string"><span class="content">'You forgot your keys'</span></span> message: 'You forgot your keys'
<span class="key">target</span>: <span class="string"><span class="content">'device/gregs_iphone'</span></span> target: 'device/gregs_iphone'
</pre></div> ```
</div>
</div>
<p>(The delay is needed for two reasons: -<br />
1. HA updates the beacon and phone locations at slightly different times - so you dont want the automation to trigger in the gap between the updates<br />
2. Ive found that beacons (especially the low power Estimote Nearables) can get disconnected for a few seconds so its best to wait a minute or so before deciding that youve left your keys behind)</p>
<h3><a class='title-link' name='using-both-types-of-ibeacons-at-the-same-time' href='#using-both-types-of-ibeacons-at-the-same-time'></a> Using both types of iBeacons at the same time </h3> (The delay is needed for two reasons: -
<p>Of course you can use both fixed and mobile beacons at the same time. I want my gates to open when I arrive home in the car - so I use an iBeacon in the car so that I can track the car, and a iBeacon on my drive so that a location update is triggered when I arrive. Ive been experimenting with a high power beacon in a waterproof box on my drive which seems to work well to notice when I get home.</p> 1. HA updates the beacon and phone locations at slightly different times - so you dont want the automation to trigger in the gap between the updates
2. Ive found that beacons (especially the low power Estimote Nearables) can get disconnected for a few seconds so its best to wait a minute or so before deciding that youve left your keys behind)
<p class="img">
<img width="300" src="http://bluesensenetworks.com/wp-content/uploads/2015/02/BlueBar-Beacon-Long-Range.jpg" /> ### <a class='title-link' name='using-both-types-of-ibeacons-at-the-same-time' href='#using-both-types-of-ibeacons-at-the-same-time'></a> Using both types of iBeacons at the same time
Of course you can use both fixed and mobile beacons at the same time. I want my gates to open when I arrive home in the car - so I use an iBeacon in the car so that I can track the car, and a iBeacon on my drive so that a location update is triggered when I arrive. I've been experimenting with a high power beacon in a waterproof box on my drive which seems to work well to notice when I get home.
<p class='img'>
<img width='300' src='http://bluesensenetworks.com/wp-content/uploads/2015/02/BlueBar-Beacon-Long-Range.jpg'>
</p> </p>
<p>Long range / High power beacon</p> Long range / High power beacon
<p class="img"> <p class='img'>
<img width="400" src="http://bluesensenetworks.com/wp-content/uploads/2015/02/BlueBar-Beacon-Weatherproof.jpg" /> <img width='400' src='http://bluesensenetworks.com/wp-content/uploads/2015/02/BlueBar-Beacon-Weatherproof.jpg'>
</p> </p>
<p>Waterproof beacon</p> Waterproof beacon
<h3><a class='title-link' name='buying-beacons' href='#buying-beacons'></a> Buying Beacons </h3>
<p>This isnt a buyers guide, but I just wanted to mention the iBeacons Ive been using. I think you should be able to use any iBeacon with HA and OwnTracks. You generally cant buy beacons in your local electronics shop - so I just wanted to briefly mention the two suppliers Ive used so far.</p>
<p>Ive bought quite a few iBeacons from a company called <a href="http://bluesensenetworks.com/">Blue Sense Networks</a>. I work in the tech startup sector in the UK so I partly chose them because they are a local start-up who seemed worth supporting. The products, support and software all seem good. I use a number of their beacons - from a simple USB dongle, to a long range beacon. All their products have batteries that can be changed (or no batteries in the case of the externally powered USB device) - and you can configure all the parameters youd want to using their software. I had one software issue, support got back to me at a weekend(!) - and the issue was resolved with a software release two days later.</p> ### <a class='title-link' name='buying-beacons' href='#buying-beacons'></a> Buying Beacons
This isnt a buyer's guide, but I just wanted to mention the iBeacons Ive been using. I think you should be able to use any iBeacon with HA and OwnTracks. You generally cant buy beacons in your local electronics shop - so I just wanted to briefly mention the two suppliers Ive used so far.
<p>All the beacons seem fine - and the long range unit does work over a longer range than my other beacons.</p> Ive bought quite a few iBeacons from a company called [Blue Sense Networks](http://bluesensenetworks.com/). I work in the tech startup sector in the UK so I partly chose them because they are a local start-up who seemed worth supporting. The products, support and software all seem good. I use a number of their beacons - from a simple USB dongle, to a long range beacon. All their products have batteries that can be changed (or no batteries in the case of the externally powered USB device) - and you can configure all the parameters youd want to using their software. I had one software issue, support got back to me at a weekend(!) - and the issue was resolved with a software release two days later.
<p>I bought some other beacons from a US/Polish startup called <a href="http://estimote.com/">Estimote</a>, who I think are better known. I bought a developer pack of 10 of their <em>nearables</em> which as well as being iBeacons also send out other data (orientation and motion) using their own protocol. This is interesting if youre developing your own application, but for OwnTracks and HA they are just regular beacons. They are small and self adhesive - so you can stick them to things (like your keys). You cant change all the parameters on these devices (UUID/Major/Minor are fixed) - and the batteries cant be replaced. I also killed one of the estimote beacons (I assume the battery died) after I carried it around for a few months and dropped it many times! On the other hand they are well priced, small and waterproof!</p> All the beacons seem fine - and the long range unit does work over a longer range than my other beacons.
<p>Ive mainly used these as <em>devices to track</em> rather that <em>location</em> beacons. Estimote also sell some slightly larger iBeacons with replaceable batteries. Estimote support responded quickly and were helpful when I couldnt work out how to edit their beacons parameters (although the answer was <em>you cant yet</em>).</p> I bought some other beacons from a US/Polish startup called [Estimote](http://estimote.com/), who I think are better known. I bought a developer pack of 10 of their *nearables* which as well as being iBeacons also send out other data (orientation and motion) using their own protocol. This is interesting if youre developing your own application, but for OwnTracks and HA they are just regular beacons. They are small and self adhesive - so you can stick them to things (like your keys). You cant change all the parameters on these devices (UUID/Major/Minor are fixed) - and the batteries cant be replaced. I also killed one of the estimote beacons (I assume the battery died) after I carried it around for a few months and dropped it many times! On the other hand they are well priced, small and waterproof!
<p>The larger Blue Sense Network beacons seem to be better at maintaining a connection that the Estimotes - although that might be because Im reluctant to turn the power to maximum and reduce the gap between sending packets on the Estimotes where I cant replace the batteries!</p> Ive mainly used these as *devices to track* rather that *location* beacons. Estimote also sell some slightly larger iBeacons with replaceable batteries. Estimote support responded quickly and were helpful when I couldnt work out how to edit their beacons parameters (although the answer was *you cant yet*).
<h3><a class='title-link' name='conclusion' href='#conclusion'></a> Conclusion </h3> The larger Blue Sense Network beacons seem to be better at maintaining a connection that the Estimotes - although that might be because Im reluctant to turn the power to maximum and reduce the gap between sending packets on the Estimotes where I cant replace the batteries!
<p>As I said in <a href="/blog/2016/04/30/ibeacons-part-1-making-presence-detection-work-better">part 1</a>, Ive found iBeacons to be a good way of improving presence detection. I also used them to track devices like my car and my keys that cant track themselves.</p>
<p>Im still experimenting, so I hope I can do more with iBeacons. I hope Ive encouraged you do so the same. If you do please share your experiences.</p> ### <a class='title-link' name='conclusion' href='#conclusion'></a> Conclusion
As I said in [part 1](/blog/2016/04/30/ibeacons-part-1-making-presence-detection-work-better), Ive found iBeacons to be a good way of improving presence detection. I also used them to track devices like my car and my keys that cant track themselves.
<h3><a class='title-link' name='notes' href='#notes'></a> Notes </h3> I'm still experimenting, so I hope I can do more with iBeacons. I hope I've encouraged you do so the same. If you do please share your experiences.
### <a class='title-link' name='notes' href='#notes'></a> Notes
Please see the [notes at the end of Part 1](/blog/2016/04/30/ibeacons-part-1-making-presence-detection-work-better/#tips) for documentation information.
<p>Please see the <a href="/blog/2016/04/30/ibeacons-part-1-making-presence-detection-work-better/#tips">notes at the end of Part 1</a> for documentation information.</p>
]]></content> ]]></content>
</entry> </entry>

View file

@ -202,7 +202,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: ESP8266 | Home Assistant]]></title> <title><![CDATA[Category: ESP8266 | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/esp8266/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/esp8266/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2016-08-22T07:26:42+00:00</updated> <updated>2016-08-22T08:20:27+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>
@ -18,377 +18,215 @@
<link href="https://home-assistant.io/blog/2015/10/11/measure-temperature-with-esp8266-and-report-to-mqtt/"/> <link href="https://home-assistant.io/blog/2015/10/11/measure-temperature-with-esp8266-and-report-to-mqtt/"/>
<updated>2015-10-11T19:10:00+00:00</updated> <updated>2015-10-11T19:10:00+00:00</updated>
<id>https://home-assistant.io/blog/2015/10/11/measure-temperature-with-esp8266-and-report-to-mqtt</id> <id>https://home-assistant.io/blog/2015/10/11/measure-temperature-with-esp8266-and-report-to-mqtt</id>
<content type="html"><![CDATA[ <content type="html"><![CDATA[{::options coderay_line_numbers="table" /}
<p>I recently learned about the ESP8266, a $5 chip that includes WiFi and is Arduino compatible. This means that all your DIY projects can now be done for a fraction of the price.</p>
<p>For this tutorial, Ill walk through how to get going with ESP8266, get the temperature and humidity and report it to MQTT where Home Asssistant can pick it up.</p> I recently learned about the ESP8266, a $5 chip that includes WiFi and is Arduino compatible. This means that all your DIY projects can now be done for a fraction of the price.
<p class="img"> For this tutorial, I'll walk through how to get going with ESP8266, get the temperature and humidity and report it to MQTT where Home Asssistant can pick it up.
<img src="https://home-assistant.io/images/blog/2015-10-esp8266-temp/setup.png" />
<p class='img'>
<img src='https://home-assistant.io/images/blog/2015-10-esp8266-temp/setup.png' />
Picture of the final setup (+ 2 LED for decoration) Picture of the final setup (+ 2 LED for decoration)
</p> </p>
<p class="img"> <p class='img'>
<img src="https://home-assistant.io/images/blog/2015-10-esp8266-temp/ha-sensor.png" /> <img src='https://home-assistant.io/images/blog/2015-10-esp8266-temp/ha-sensor.png' />
Home Assistant will keep track of historical values and allow you to integrate it into automation. Home Assistant will keep track of historical values and allow you to integrate it into automation.
</p> </p>
<!--more--> <!--more-->
<h3><a class='title-link' name='components' href='#components'></a> Components </h3> ### <a class='title-link' name='components' href='#components'></a> Components
<p>Ive been using Adafruit for my shopping:</p> I've been using Adafruit for my shopping:
<ul> - [Adafruit HUZZAH ESP8266 Breakout](http://www.adafruit.com/product/2471) ([assembly instructions](https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout/assembly))
<li><a href="http://www.adafruit.com/product/2471">Adafruit HUZZAH ESP8266 Breakout</a> (<a href="https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout/assembly">assembly instructions</a>)</li> - [Adafruit HDC1008 Temperature & Humidity Sensor Breakout Board](http://www.adafruit.com/product/2635) ([assembly instructions](https://learn.adafruit.com/adafruit-hdc1008-temperature-and-humidity-sensor-breakout/assembly))
<li><a href="http://www.adafruit.com/product/2635">Adafruit HDC1008 Temperature &amp; Humidity Sensor Breakout Board</a> (<a href="https://learn.adafruit.com/adafruit-hdc1008-temperature-and-humidity-sensor-breakout/assembly">assembly instructions</a>)</li> - [MQTT server](/components/mqtt/#picking-a-broker)
<li><a href="/components/mqtt/#picking-a-broker">MQTT server</a></li>
</ul>
<p><em>Besides this, you will need the usual hardware prototype equipment: a breadboard, some wires, soldering iron + wire, Serial USB cable.</em></p> _Besides this, you will need the usual hardware prototype equipment: a breadboard, some wires, soldering iron + wire, Serial USB cable._
<h3><a class='title-link' name='alternatives' href='#alternatives'></a> Alternatives </h3> ### <a class='title-link' name='alternatives' href='#alternatives'></a> Alternatives
<p>Since this article has been published the HDC1008 has been discontinued. Updated sketches are available for the following alternatives:</p> Since this article has been published the HDC1008 has been discontinued. Updated sketches are available for the following alternatives:
<ul> - [DHT22 sensor](https://www.adafruit.com/product/385) and [updated sketch](https://gist.github.com/balloob/1176b6d87c2816bd07919ce6e29a19e9).
<li><a href="https://www.adafruit.com/product/385">DHT22 sensor</a> and <a href="https://gist.github.com/balloob/1176b6d87c2816bd07919ce6e29a19e9">updated sketch</a>.</li> - [BME280 sensor](https://www.adafruit.com/product/2652) and [updated sketch](https://gist.github.com/mtl010957/9ee85fb404f65e15c440b08c659c0419).
<li><a href="https://www.adafruit.com/product/2652">BME280 sensor</a> and <a href="https://gist.github.com/mtl010957/9ee85fb404f65e15c440b08c659c0419">updated sketch</a>.</li>
</ul>
<h3><a class='title-link' name='connections' href='#connections'></a> Connections </h3> ### <a class='title-link' name='connections' href='#connections'></a> Connections
<p>On your breadboard, make the following connections from your ESP8266 to the HDC1008:</p> On your breadboard, make the following connections from your ESP8266 to the HDC1008:
<table> | ESP8266 | HDC1008 |
<thead> | ------- | ------- |
<tr> | GND | GND
<th>ESP8266</th> | 3V | Vin
<th>HDC1008</th> | 14 | SCL
</tr> | #2 | SDA
</thead>
<tbody>
<tr>
<td>GND</td>
<td>GND</td>
</tr>
<tr>
<td>3V</td>
<td>Vin</td>
</tr>
<tr>
<td>14</td>
<td>SCL</td>
</tr>
<tr>
<td>#2</td>
<td>SDA</td>
</tr>
</tbody>
</table>
<p><em>I picked <code>#2</code> and <code>14</code> myself, you can configure them in the sketch.</em></p> _I picked `#2` and `14` myself, you can configure them in the sketch._
<h3><a class='title-link' name='preparing-your-ide' href='#preparing-your-ide'></a> Preparing your IDE </h3> ### <a class='title-link' name='preparing-your-ide' href='#preparing-your-ide'></a> Preparing your IDE
<p>Follow <a href="https://github.com/esp8266/Arduino#installing-with-boards-manager">these instructions</a> on how to install and prepare the Arduino IDE for ESP8266 development.</p> Follow [these instructions](https://github.com/esp8266/Arduino#installing-with-boards-manager) on how to install and prepare the Arduino IDE for ESP8266 development.
<p>After youre done installing, open the Arduino IDE, in the menu click on <code>sketch</code> -&gt; <code>include library</code> -&gt; <code>manage libraries</code> and install the following libraries:</p> After you're done installing, open the Arduino IDE, in the menu click on `sketch` -> `include library` -> `manage libraries` and install the following libraries:
<ul> - PubSubClient by Nick 'O Leary
<li>PubSubClient by Nick O Leary</li> - Adafruit HDC1000
<li>Adafruit HDC1000</li>
</ul>
<h3><a class='title-link' name='sketch' href='#sketch'></a> Sketch </h3> ### <a class='title-link' name='sketch' href='#sketch'></a> Sketch
<p>If you have followed the previous steps, youre all set.</p> If you have followed the previous steps, you're all set.
<ul> - Open Arduino IDE and create a new sketch (`File` -> `New`)
<li>Open Arduino IDE and create a new sketch (<code>File</code> -&gt; <code>New</code>)</li> - Copy and paste the below sketch to the Arduino IDE
<li>Copy and paste the below sketch to the Arduino IDE</li> - Adjust the values line 6 - 14 to match your setup
<li>Adjust the values line 6 - 14 to match your setup</li> - Optional: If you want to connect to an MQTT server without a username or password, adjust line 62.
<li>Optional: If you want to connect to an MQTT server without a username or password, adjust line 62.</li> - To have the ESP8266 accept our new sketch, we have to put it in upload mode. On the ESP8266 device keep the GPIO0 button pressed while pressing the reset button. The red led will glow half bright to indicate it is in upload mode.
<li>To have the ESP8266 accept our new sketch, we have to put it in upload mode. On the ESP8266 device keep the GPIO0 button pressed while pressing the reset button. The red led will glow half bright to indicate it is in upload mode.</li> - Press the upload button in Arduino IDE
<li>Press the upload button in Arduino IDE</li> - Open the serial monitor (`Tools` -> `Serial Monitor`) to see the output from your device
<li>Open the serial monitor (<code>Tools</code> -&gt; <code>Serial Monitor</code>) to see the output from your device</li>
</ul>
<p>This sketch will connect to your WiFi network and MQTT broker. It will read the temperature and humidity from the sensor every second. It will report it to the MQTT server if the difference is &gt; 1 since last reported value. Reports to the MQTT broker are sent with retain set to <code>True</code>. This means that anyone connecting to the MQTT topic will automatically be notified of the last reported value.</p> This sketch will connect to your WiFi network and MQTT broker. It will read the temperature and humidity from the sensor every second. It will report it to the MQTT server if the difference is > 1 since last reported value. Reports to the MQTT broker are sent with retain set to `True`. This means that anyone connecting to the MQTT topic will automatically be notified of the last reported value.
<div class="highlighter-coderay"><table class="CodeRay"><tr> ```cpp
<td class="line-numbers"><pre><a href="#n1" name="n1">1</a> #include <ESP8266WiFi.h>
<a href="#n2" name="n2">2</a> #include <Wire.h>
<a href="#n3" name="n3">3</a> #include <PubSubClient.h>
<a href="#n4" name="n4">4</a> #include <Adafruit_HDC1000.h>
<a href="#n5" name="n5">5</a>
<a href="#n6" name="n6">6</a>
<a href="#n7" name="n7">7</a>
<a href="#n8" name="n8">8</a>
<a href="#n9" name="n9">9</a>
<strong><a href="#n10" name="n10">10</a></strong>
<a href="#n11" name="n11">11</a>
<a href="#n12" name="n12">12</a>
<a href="#n13" name="n13">13</a>
<a href="#n14" name="n14">14</a>
<a href="#n15" name="n15">15</a>
<a href="#n16" name="n16">16</a>
<a href="#n17" name="n17">17</a>
<a href="#n18" name="n18">18</a>
<a href="#n19" name="n19">19</a>
<strong><a href="#n20" name="n20">20</a></strong>
<a href="#n21" name="n21">21</a>
<a href="#n22" name="n22">22</a>
<a href="#n23" name="n23">23</a>
<a href="#n24" name="n24">24</a>
<a href="#n25" name="n25">25</a>
<a href="#n26" name="n26">26</a>
<a href="#n27" name="n27">27</a>
<a href="#n28" name="n28">28</a>
<a href="#n29" name="n29">29</a>
<strong><a href="#n30" name="n30">30</a></strong>
<a href="#n31" name="n31">31</a>
<a href="#n32" name="n32">32</a>
<a href="#n33" name="n33">33</a>
<a href="#n34" name="n34">34</a>
<a href="#n35" name="n35">35</a>
<a href="#n36" name="n36">36</a>
<a href="#n37" name="n37">37</a>
<a href="#n38" name="n38">38</a>
<a href="#n39" name="n39">39</a>
<strong><a href="#n40" name="n40">40</a></strong>
<a href="#n41" name="n41">41</a>
<a href="#n42" name="n42">42</a>
<a href="#n43" name="n43">43</a>
<a href="#n44" name="n44">44</a>
<a href="#n45" name="n45">45</a>
<a href="#n46" name="n46">46</a>
<a href="#n47" name="n47">47</a>
<a href="#n48" name="n48">48</a>
<a href="#n49" name="n49">49</a>
<strong><a href="#n50" name="n50">50</a></strong>
<a href="#n51" name="n51">51</a>
<a href="#n52" name="n52">52</a>
<a href="#n53" name="n53">53</a>
<a href="#n54" name="n54">54</a>
<a href="#n55" name="n55">55</a>
<a href="#n56" name="n56">56</a>
<a href="#n57" name="n57">57</a>
<a href="#n58" name="n58">58</a>
<a href="#n59" name="n59">59</a>
<strong><a href="#n60" name="n60">60</a></strong>
<a href="#n61" name="n61">61</a>
<a href="#n62" name="n62">62</a>
<a href="#n63" name="n63">63</a>
<a href="#n64" name="n64">64</a>
<a href="#n65" name="n65">65</a>
<a href="#n66" name="n66">66</a>
<a href="#n67" name="n67">67</a>
<a href="#n68" name="n68">68</a>
<a href="#n69" name="n69">69</a>
<strong><a href="#n70" name="n70">70</a></strong>
<a href="#n71" name="n71">71</a>
<a href="#n72" name="n72">72</a>
<a href="#n73" name="n73">73</a>
<a href="#n74" name="n74">74</a>
<a href="#n75" name="n75">75</a>
<a href="#n76" name="n76">76</a>
<a href="#n77" name="n77">77</a>
<a href="#n78" name="n78">78</a>
<a href="#n79" name="n79">79</a>
<strong><a href="#n80" name="n80">80</a></strong>
<a href="#n81" name="n81">81</a>
<a href="#n82" name="n82">82</a>
<a href="#n83" name="n83">83</a>
<a href="#n84" name="n84">84</a>
<a href="#n85" name="n85">85</a>
<a href="#n86" name="n86">86</a>
<a href="#n87" name="n87">87</a>
<a href="#n88" name="n88">88</a>
<a href="#n89" name="n89">89</a>
<strong><a href="#n90" name="n90">90</a></strong>
<a href="#n91" name="n91">91</a>
<a href="#n92" name="n92">92</a>
<a href="#n93" name="n93">93</a>
<a href="#n94" name="n94">94</a>
<a href="#n95" name="n95">95</a>
<a href="#n96" name="n96">96</a>
<a href="#n97" name="n97">97</a>
<a href="#n98" name="n98">98</a>
<a href="#n99" name="n99">99</a>
<strong><a href="#n100" name="n100">100</a></strong>
<a href="#n101" name="n101">101</a>
<a href="#n102" name="n102">102</a>
<a href="#n103" name="n103">103</a>
<a href="#n104" name="n104">104</a>
<a href="#n105" name="n105">105</a>
<a href="#n106" name="n106">106</a>
<a href="#n107" name="n107">107</a>
<a href="#n108" name="n108">108</a>
<a href="#n109" name="n109">109</a>
<strong><a href="#n110" name="n110">110</a></strong>
<a href="#n111" name="n111">111</a>
</pre></td>
<td class="code"><pre><span class="preprocessor">#include</span> <span class="include">&lt;ESP8266WiFi.h&gt;</span>
<span class="preprocessor">#include</span> <span class="include">&lt;Wire.h&gt;</span>
<span class="preprocessor">#include</span> <span class="include">&lt;PubSubClient.h&gt;</span>
<span class="preprocessor">#include</span> <span class="include">&lt;Adafruit_HDC1000.h&gt;</span>
<span class="preprocessor">#define</span> wifi_ssid <span class="string"><span class="delimiter">&quot;</span><span class="content">YOUR WIFI SSID</span><span class="delimiter">&quot;</span></span> #define wifi_ssid "YOUR WIFI SSID"
<span class="preprocessor">#define</span> wifi_password <span class="string"><span class="delimiter">&quot;</span><span class="content">WIFI PASSWORD</span><span class="delimiter">&quot;</span></span> #define wifi_password "WIFI PASSWORD"
<span class="preprocessor">#define</span> mqtt_server <span class="string"><span class="delimiter">&quot;</span><span class="content">YOUR_MQTT_SERVER_HOST</span><span class="delimiter">&quot;</span></span> #define mqtt_server "YOUR_MQTT_SERVER_HOST"
<span class="preprocessor">#define</span> mqtt_user <span class="string"><span class="delimiter">&quot;</span><span class="content">your_username</span><span class="delimiter">&quot;</span></span> #define mqtt_user "your_username"
<span class="preprocessor">#define</span> mqtt_password <span class="string"><span class="delimiter">&quot;</span><span class="content">your_password</span><span class="delimiter">&quot;</span></span> #define mqtt_password "your_password"
<span class="preprocessor">#define</span> humidity_topic <span class="string"><span class="delimiter">&quot;</span><span class="content">sensor/humidity</span><span class="delimiter">&quot;</span></span> #define humidity_topic "sensor/humidity"
<span class="preprocessor">#define</span> temperature_topic <span class="string"><span class="delimiter">&quot;</span><span class="content">sensor/temperature</span><span class="delimiter">&quot;</span></span> #define temperature_topic "sensor/temperature"
WiFiClient espClient; WiFiClient espClient;
PubSubClient client(espClient); PubSubClient client(espClient);
Adafruit_HDC1000 hdc = Adafruit_HDC1000(); Adafruit_HDC1000 hdc = Adafruit_HDC1000();
<span class="directive">void</span> setup() { void setup() {
Serial.begin(<span class="integer">115200</span>); Serial.begin(115200);
setup_wifi(); setup_wifi();
client.setServer(mqtt_server, <span class="integer">1883</span>); client.setServer(mqtt_server, 1883);
<span class="comment">// Set SDA and SDL ports</span> // Set SDA and SDL ports
Wire.begin(<span class="integer">2</span>, <span class="integer">14</span>); Wire.begin(2, 14);
<span class="comment">// Start sensor</span> // Start sensor
<span class="keyword">if</span> (!hdc.begin()) { if (!hdc.begin()) {
Serial.println(<span class="string"><span class="delimiter">&quot;</span><span class="content">Couldn't find sensor!</span><span class="delimiter">&quot;</span></span>); Serial.println("Couldn't find sensor!");
<span class="keyword">while</span> (<span class="integer">1</span>); while (1);
} }
} }
<span class="directive">void</span> setup_wifi() { void setup_wifi() {
delay(<span class="integer">10</span>); delay(10);
<span class="comment">// We start by connecting to a WiFi network</span> // We start by connecting to a WiFi network
Serial.println(); Serial.println();
Serial.print(<span class="string"><span class="delimiter">&quot;</span><span class="content">Connecting to </span><span class="delimiter">&quot;</span></span>); Serial.print("Connecting to ");
Serial.println(wifi_ssid); Serial.println(wifi_ssid);
WiFi.begin(wifi_ssid, wifi_password); WiFi.begin(wifi_ssid, wifi_password);
<span class="keyword">while</span> (WiFi.status() != WL_CONNECTED) { while (WiFi.status() != WL_CONNECTED) {
delay(<span class="integer">500</span>); delay(500);
Serial.print(<span class="string"><span class="delimiter">&quot;</span><span class="content">.</span><span class="delimiter">&quot;</span></span>); Serial.print(".");
} }
Serial.println(<span class="string"><span class="delimiter">&quot;</span><span class="delimiter">&quot;</span></span>); Serial.println("");
Serial.println(<span class="string"><span class="delimiter">&quot;</span><span class="content">WiFi connected</span><span class="delimiter">&quot;</span></span>); Serial.println("WiFi connected");
Serial.println(<span class="string"><span class="delimiter">&quot;</span><span class="content">IP address: </span><span class="delimiter">&quot;</span></span>); Serial.println("IP address: ");
Serial.println(WiFi.localIP()); Serial.println(WiFi.localIP());
} }
<span class="directive">void</span> reconnect() { void reconnect() {
<span class="comment">// Loop until we're reconnected</span> // Loop until we're reconnected
<span class="keyword">while</span> (!client.connected()) { while (!client.connected()) {
Serial.print(<span class="string"><span class="delimiter">&quot;</span><span class="content">Attempting MQTT connection...</span><span class="delimiter">&quot;</span></span>); Serial.print("Attempting MQTT connection...");
<span class="comment">// Attempt to connect</span> // Attempt to connect
<span class="comment">// If you do not want to use a username and password, change next line to</span> // If you do not want to use a username and password, change next line to
<span class="comment">// if (client.connect(&quot;ESP8266Client&quot;)) {</span> // if (client.connect("ESP8266Client")) {
<span class="keyword">if</span> (client.connect(<span class="string"><span class="delimiter">&quot;</span><span class="content">ESP8266Client</span><span class="delimiter">&quot;</span></span>, mqtt_user, mqtt_password)) { if (client.connect("ESP8266Client", mqtt_user, mqtt_password)) {
Serial.println(<span class="string"><span class="delimiter">&quot;</span><span class="content">connected</span><span class="delimiter">&quot;</span></span>); Serial.println("connected");
} <span class="keyword">else</span> { } else {
Serial.print(<span class="string"><span class="delimiter">&quot;</span><span class="content">failed, rc=</span><span class="delimiter">&quot;</span></span>); Serial.print("failed, rc=");
Serial.print(client.state()); Serial.print(client.state());
Serial.println(<span class="string"><span class="delimiter">&quot;</span><span class="content"> try again in 5 seconds</span><span class="delimiter">&quot;</span></span>); Serial.println(" try again in 5 seconds");
<span class="comment">// Wait 5 seconds before retrying</span> // Wait 5 seconds before retrying
delay(<span class="integer">5000</span>); delay(5000);
} }
} }
} }
<span class="predefined-type">bool</span> checkBound(<span class="predefined-type">float</span> newValue, <span class="predefined-type">float</span> prevValue, <span class="predefined-type">float</span> maxDiff) { bool checkBound(float newValue, float prevValue, float maxDiff) {
<span class="keyword">return</span> !isnan(newValue) &amp;&amp; return !isnan(newValue) &&
(newValue &lt; prevValue - maxDiff || newValue &gt; prevValue + maxDiff); (newValue < prevValue - maxDiff || newValue > prevValue + maxDiff);
} }
<span class="predefined-type">long</span> lastMsg = <span class="integer">0</span>; long lastMsg = 0;
<span class="predefined-type">float</span> temp = <span class="float">0</span><span class="float">.0</span>; float temp = 0.0;
<span class="predefined-type">float</span> hum = <span class="float">0</span><span class="float">.0</span>; float hum = 0.0;
<span class="predefined-type">float</span> diff = <span class="float">1</span><span class="float">.0</span>; float diff = 1.0;
<span class="directive">void</span> loop() { void loop() {
<span class="keyword">if</span> (!client.connected()) { if (!client.connected()) {
reconnect(); reconnect();
} }
client.loop(); client.loop();
<span class="predefined-type">long</span> now = millis(); long now = millis();
<span class="keyword">if</span> (now - lastMsg &gt; <span class="integer">1000</span>) { if (now - lastMsg > 1000) {
lastMsg = now; lastMsg = now;
<span class="predefined-type">float</span> newTemp = hdc.readTemperature(); float newTemp = hdc.readTemperature();
<span class="predefined-type">float</span> newHum = hdc.readHumidity(); float newHum = hdc.readHumidity();
<span class="keyword">if</span> (checkBound(newTemp, temp, diff)) { if (checkBound(newTemp, temp, diff)) {
temp = newTemp; temp = newTemp;
Serial.print(<span class="string"><span class="delimiter">&quot;</span><span class="content">New temperature:</span><span class="delimiter">&quot;</span></span>); Serial.print("New temperature:");
Serial.println(String(temp).c_str()); Serial.println(String(temp).c_str());
client.publish(temperature_topic, String(temp).c_str(), <span class="predefined-constant">true</span>); client.publish(temperature_topic, String(temp).c_str(), true);
} }
<span class="keyword">if</span> (checkBound(newHum, hum, diff)) { if (checkBound(newHum, hum, diff)) {
hum = newHum; hum = newHum;
Serial.print(<span class="string"><span class="delimiter">&quot;</span><span class="content">New humidity:</span><span class="delimiter">&quot;</span></span>); Serial.print("New humidity:");
Serial.println(String(hum).c_str()); Serial.println(String(hum).c_str());
client.publish(humidity_topic, String(hum).c_str(), <span class="predefined-constant">true</span>); client.publish(humidity_topic, String(hum).c_str(), true);
} }
} }
} }
</pre></td> ```
</tr></table>
</div>
<h3><a class='title-link' name='configuring-home-assistant' href='#configuring-home-assistant'></a> Configuring Home Assistant </h3> ### <a class='title-link' name='configuring-home-assistant' href='#configuring-home-assistant'></a> Configuring Home Assistant
<p>The last step is to integrate the sensor values into Home Assistant. This can be done by setting up Home Assistant to connect to the MQTT broker and subscribe to the sensor topics.</p> The last step is to integrate the sensor values into Home Assistant. This can be done by setting up Home Assistant to connect to the MQTT broker and subscribe to the sensor topics.
<div class="highlighter-coderay"><table class="CodeRay"><tr> ```yaml
<td class="line-numbers"><pre><a href="#n1" name="n1">1</a> mqtt:
<a href="#n2" name="n2">2</a> broker: YOUR_MQTT_SERVER_HOST
<a href="#n3" name="n3">3</a> username: your_username
<a href="#n4" name="n4">4</a> password: your_password
<a href="#n5" name="n5">5</a>
<a href="#n6" name="n6">6</a>
<a href="#n7" name="n7">7</a>
<a href="#n8" name="n8">8</a>
<a href="#n9" name="n9">9</a>
<strong><a href="#n10" name="n10">10</a></strong>
<a href="#n11" name="n11">11</a>
<a href="#n12" name="n12">12</a>
<a href="#n13" name="n13">13</a>
<a href="#n14" name="n14">14</a>
<a href="#n15" name="n15">15</a>
<a href="#n16" name="n16">16</a>
<a href="#n17" name="n17">17</a>
<a href="#n18" name="n18">18</a>
</pre></td>
<td class="code"><pre><span class="key">mqtt</span>:
<span class="key">broker</span>: <span class="string"><span class="content">YOUR_MQTT_SERVER_HOST</span></span>
<span class="key">username</span>: <span class="string"><span class="content">your_username</span></span>
<span class="key">password</span>: <span class="string"><span class="content">your_password</span></span>
<span class="key">sensor</span>: sensor:
<span class="key">platform</span>: <span class="string"><span class="content">mqtt</span></span> platform: mqtt
<span class="key">name</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Temperature</span><span class="delimiter">&quot;</span></span> name: "Temperature"
<span class="key">state_topic</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">sensor/temperature</span><span class="delimiter">&quot;</span></span> state_topic: "sensor/temperature"
<span class="key">qos</span>: <span class="string"><span class="content">0</span></span> qos: 0
<span class="key">unit_of_measurement</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">ºC</span><span class="delimiter">&quot;</span></span> unit_of_measurement: "ºC"
<span class="key">sensor 2</span>: sensor 2:
<span class="key">platform</span>: <span class="string"><span class="content">mqtt</span></span> platform: mqtt
<span class="key">name</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">Humidity</span><span class="delimiter">&quot;</span></span> name: "Humidity"
<span class="key">state_topic</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">sensor/humidity</span><span class="delimiter">&quot;</span></span> state_topic: "sensor/humidity"
<span class="key">qos</span>: <span class="string"><span class="content">0</span></span> qos: 0
<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> unit_of_measurement: "%"
</pre></td> ```
</tr></table>
</div>
]]></content> ]]></content>
</entry> </entry>

View file

@ -202,7 +202,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: How-To | Home Assistant]]></title> <title><![CDATA[Category: How-To | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/how-to/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/how-to/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2016-08-22T07:26:42+00:00</updated> <updated>2016-08-22T08:20:27+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>
@ -18,13 +18,17 @@
<link href="https://home-assistant.io/blog/2016/08/19/github-style-calendar-heatmap-of-device-data/"/> <link href="https://home-assistant.io/blog/2016/08/19/github-style-calendar-heatmap-of-device-data/"/>
<updated>2016-08-19T06:00:00+00:00</updated> <updated>2016-08-19T06:00:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/08/19/github-style-calendar-heatmap-of-device-data</id> <id>https://home-assistant.io/blog/2016/08/19/github-style-calendar-heatmap-of-device-data</id>
<content type="html"><![CDATA[<p>Thanks to <a href="https://github.com/kireyeu">Anton Kireyeu</a> we are able to present another awesome <a href="https://jupyter.org/">Jupyter notebook</a>. I guess that you all know the graph which Github is using to visualize your commits per day over a time-line. Its a so-called <a href="https://en.wikipedia.org/wiki/Heat_map">heatmap</a>. If there are more commits, its getting hotter. The latest <a href="http://nbviewer.jupyter.org/github/home-assistant/home-assistant-notebooks/blob/master/DataExploration-2/DataExploration-2.ipynb">notebook</a> is capable to do the same thing for your devices. To be more precise, for the hours your devices are home.</p> <content type="html"><![CDATA[Thanks to [Anton Kireyeu](https://github.com/kireyeu) we are able to present another awesome [Jupyter notebook]. I guess that you all know the graph which Github is using to visualize your commits per day over a time-line. It's a so-called [heatmap]. If there are more commits, it's getting hotter. The latest [notebook][nb-prev] is capable to do the same thing for your devices. To be more precise, for the hours your devices are home.
<p class="img"> <p class='img'>
<img src="https://home-assistant.io/images/blog/2016-08-data-exploration/heatmap.png" /> <img src='https://home-assistant.io/images/blog/2016-08-data-exploration/heatmap.png'>
Heatmap Heatmap
</p> </p>
[heatmap]: https://en.wikipedia.org/wiki/Heat_map
[Jupyter notebook]: https://jupyter.org/
[nb-prev]: http://nbviewer.jupyter.org/github/home-assistant/home-assistant-notebooks/blob/master/DataExploration-2/DataExploration-2.ipynb
]]></content> ]]></content>
</entry> </entry>
@ -33,135 +37,124 @@ Heatmap
<link href="https://home-assistant.io/blog/2016/08/16/we-have-apps-now/"/> <link href="https://home-assistant.io/blog/2016/08/16/we-have-apps-now/"/>
<updated>2016-08-16T10:00:00+00:00</updated> <updated>2016-08-16T10:00:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/08/16/we-have-apps-now</id> <id>https://home-assistant.io/blog/2016/08/16/we-have-apps-now</id>
<content type="html"><![CDATA[<p>I have been working on a new subsystem to complement Home Assistants Automation and Scripting components. <code>AppDaemon</code> is a python daemon that consumes events from Home Assistant and feeds them to snippets of python code called “Apps”. An App is a Python class that is instantiated possibly multiple times from <code>AppDaemon</code> and registers callbacks for various system events. It is also able to inspect and set state and call services. The API provides a rich environment suited to home automation tasks that can also leverage all the power of Python.</p> <content type="html"><![CDATA[I have been working on a new subsystem to complement Home Assistant's Automation and Scripting components. `AppDaemon` is a python daemon that consumes events from Home Assistant and feeds them to snippets of python code called "Apps". An App is a Python class that is instantiated possibly multiple times from `AppDaemon` and registers callbacks for various system events. It is also able to inspect and set state and call services. The API provides a rich environment suited to home automation tasks that can also leverage all the power of Python.
<!--more--> <!--more-->
<h2><a class='title-link' name='another-take-on-automation' href='#another-take-on-automation'></a> Another Take on Automation </h2> ## <a class='title-link' name='another-take-on-automation' href='#another-take-on-automation'></a> Another Take on Automation
<p>If you havent yet read Paulus excellent Blog entry on <a href="https://home-assistant.io/blog/2016/01/19/perfect-home-automation/">Perfect Home Automation</a> I would encourage you to take a look. As a veteran of several Home Automation systems with varying degrees success, it was this article more than anything else that convinced me that Home Assistant had the right philosophy behind it and was on the right track. One of the most important points made is that being able to control your lights from your phone, 9 times out of 10 is harder than using a lightswitch - where Home Automation really comes into its own is when you start removing the need to use a phone or the switch - the “Automation” in Home Automation. A surprisingly large number of systems out there miss this essential point and have limited abilities to automate anything which is why a robust and open system such as Home Assistant is such an important part of the equation to bring this all together in the vast and chaotic ecosystem that is the “Internet of Things”.</p> If you haven't yet read Paulus' excellent Blog entry on [Perfect Home Automation](https://home-assistant.io/blog/2016/01/19/perfect-home-automation/) I would encourage you to take a look. As a veteran of several Home Automation systems with varying degrees success, it was this article more than anything else that convinced me that Home Assistant had the right philosophy behind it and was on the right track. One of the most important points made is that being able to control your lights from your phone, 9 times out of 10 is harder than using a lightswitch - where Home Automation really comes into its own is when you start removing the need to use a phone or the switch - the "Automation" in Home Automation. A surprisingly large number of systems out there miss this essential point and have limited abilities to automate anything which is why a robust and open system such as Home Assistant is such an important part of the equation to bring this all together in the vast and chaotic ecosystem that is the "Internet of Things".
<p>So given the importance of Automation, what should Automation allow us to do? I am a pragmatist at heart so I judge individual systems by the ease of accomplishing a few basic but representative tasks:</p> So given the importance of Automation, what should Automation allow us to do? I am a pragmatist at heart so I judge individual systems by the ease of accomplishing a few basic but representative tasks:
<ul> - Can the system respond to presence or absence of people?
<li>Can the system respond to presence or absence of people?</li> - Can I turn a light on at Sunset +/- a certain amount of time?
<li>Can I turn a light on at Sunset +/- a certain amount of time?</li> - Can I arrive home in light or dark and have the lights figure out if they should be on or off?
<li>Can I arrive home in light or dark and have the lights figure out if they should be on or off?</li> - As I build my system out, can I get the individual pieces to co-operate and use and re-use (potentially complex) logic to make sure everything works smoothly?
<li>As I build my system out, can I get the individual pieces to co-operate and use and re-use (potentially complex) logic to make sure everything works smoothly?</li> - Is it open and expandable?
<li>Is it open and expandable?</li> - Does it run locally without any reliance on the cloud?
<li>Does it run locally without any reliance on the cloud?</li>
</ul>
<p>In my opinion, Home Assistant accomplishes the majority of these very well with a combination of Automations, Scripts and Templates, and its Restful API.</p> In my opinion, Home Assistant accomplishes the majority of these very well with a combination of Automations, Scripts and Templates, and it's Restful API.
<p>So why <code>AppDaemon</code>? <code>AppDaemon</code> is not meant to replace Home Assistant Automations and Scripts, rather complement them. For a lot of things, automations work well and can be very succinct. However, there is a class of more complex automations for which they become harder to use, and appdeamon then comes into its own. It brings quite a few things to the table:</p> So why `AppDaemon`? `AppDaemon` is not meant to replace Home Assistant Automations and Scripts, rather complement them. For a lot of things, automations work well and can be very succinct. However, there is a class of more complex automations for which they become harder to use, and appdeamon then comes into its own. It brings quite a few things to the table:
<ul> - New paradigm - some problems require a procedural and/or iterative approach, and `AppDaemon` Apps are a much more natural fit for this. Recent enhancements to Home Assistant scripts and templates have made huge strides, but for the most complex scenarios, Apps can do things that Automations can't
<li>New paradigm - some problems require a procedural and/or iterative approach, and <code>AppDaemon</code> Apps are a much more natural fit for this. Recent enhancements to Home Assistant scripts and templates have made huge strides, but for the most complex scenarios, Apps can do things that Automations cant</li> - Ease of use - `AppDaemon`'s API is full of helper functions that make programming as easy and natural as possible. The functions and their operation are as "Pythonic" as possible, experienced Python programmers should feel right at home.
<li>Ease of use - <code>AppDaemon</code>s API is full of helper functions that make programming as easy and natural as possible. The functions and their operation are as “Pythonic” as possible, experienced Python programmers should feel right at home.</li> - Reuse - write a piece of code once and instantiate it as an app as many times as you need with different parameters e.g. a motion light program that you can use in 5 different places around your home. The code stays the same, you just dynamically add new instances of it in the config file
<li>Reuse - write a piece of code once and instantiate it as an app as many times as you need with different parameters e.g. a motion light program that you can use in 5 different places around your home. The code stays the same, you just dynamically add new instances of it in the config file</li> - Dynamic - `AppDaemon` has been designed from the start to enable the user to make changes without requiring a restart of Home Assistant, thanks to it's loose coupling. However, it is better than that - the user can make changes to code and `AppDaemon` will automatically reload the code, figure out which Apps were using it and restart them to use the new code without the need to restart `AppDaemon` itself. It is also possible to change parameters for an individual or multiple apps and have them picked up dynamically, and for a final trick, removing or adding apps is also picked up dynamically. Testing cycles become a lot more efficient as a result.
<li>Dynamic - <code>AppDaemon</code> has been designed from the start to enable the user to make changes without requiring a restart of Home Assistant, thanks to its loose coupling. However, it is better than that - the user can make changes to code and <code>AppDaemon</code> will automatically reload the code, figure out which Apps were using it and restart them to use the new code without the need to restart <code>AppDaemon</code> itself. It is also possible to change parameters for an individual or multiple apps and have them picked up dynamically, and for a final trick, removing or adding apps is also picked up dynamically. Testing cycles become a lot more efficient as a result.</li> - Complex logic - Python's If/Else constructs are clearer and easier to code for arbitrarily complex nested logic
<li>Complex logic - Pythons If/Else constructs are clearer and easier to code for arbitrarily complex nested logic</li> - Durable variables and state - variables can be kept between events to keep track of things like the number of times a motion sensor has been activated, or how long it has been since a door opened
<li>Durable variables and state - variables can be kept between events to keep track of things like the number of times a motion sensor has been activated, or how long it has been since a door opened</li> - All the power of Python - use any of Python's libraries, create your own modules, share variables, refactor and re-use code, create a single app to do everything, or multiple apps for individual tasks - nothing is off limits!
<li>All the power of Python - use any of Pythons libraries, create your own modules, share variables, refactor and re-use code, create a single app to do everything, or multiple apps for individual tasks - nothing is off limits!</li>
</ul>
<p>It is in fact a testament to Home Assistants open nature that a component like <code>AppDaemon</code> can be integrated so neatly and closely that it acts in all ways like an extension of the system, not a second class citizen. Part of the strength of Home Assistants underlying design is that it makes no assumptions whatever about what it is controlling or reacting to, or reporting state on. This is made achievable in part by the great flexibility of Python as a programming environment for Home Assistant, and carrying that forward has enabled me to use the same philosophy for <code>AppDaemon</code> - it took surprisingly little code to be able to respond to basic events and call services in a completely open ended manner - the bulk of the work after that was adding additonal functions to make things that were already possible easier.</p> It is in fact a testament to Home Assistant's open nature that a component like `AppDaemon` can be integrated so neatly and closely that it acts in all ways like an extension of the system, not a second class citizen. Part of the strength of Home Assistant's underlying design is that it makes no assumptions whatever about what it is controlling or reacting to, or reporting state on. This is made achievable in part by the great flexibility of Python as a programming environment for Home Assistant, and carrying that forward has enabled me to use the same philosophy for `AppDaemon` - it took surprisingly little code to be able to respond to basic events and call services in a completely open ended manner - the bulk of the work after that was adding additonal functions to make things that were already possible easier.
<h2><a class='title-link' name='how-it-works' href='#how-it-works'></a> How it Works </h2> ## <a class='title-link' name='how-it-works' href='#how-it-works'></a> How it Works
<p>The best way to show what <code>AppDaemon</code> does is through a few simple examples.</p> The best way to show what `AppDaemon` does is through a few simple examples.
<h3><a class='title-link' name='sunrisesunset-lighting' href='#sunrisesunset-lighting'></a> Sunrise/Sunset Lighting </h3> ### <a class='title-link' name='sunrisesunset-lighting' href='#sunrisesunset-lighting'></a> Sunrise/Sunset Lighting
<p>Lets start with a simple App to turn a light on every night at sunset and off every morning at sunrise. Every App when first started will have its <code>initialize()</code> function called which gives it a chance to register a callback for <code>AppDaemons</code>s scheduler for a specific time. In this case we are using <code>run_at_sunrise()</code> and <code>run_at_sunset()</code> to register 2 separate callbacks. The argument <code>0</code> is the number of seconds offset from sunrise or sunset and can be negative or positive. For complex intervals it can be convenient to use Pythons <code>datetime.timedelta</code> class for calculations. When sunrise or sunset occurs, the appropriate callback function, <code>sunrise_cb()</code> or <code>sunset_cb()</code> is called which then makes a call to Home Assistant to turn the porch light on or off by activating a scene. The variables <code>args["on_scene"]</code> and <code>args["off_scene"]</code> are passed through from the configuration of this particular App, and the same code could be reused to activate completely different scenes in a different version of the App.</p> Lets start with a simple App to turn a light on every night at sunset and off every morning at sunrise. Every App when first started will have its `initialize()` function called which gives it a chance to register a callback for `AppDaemons`'s scheduler for a specific time. In this case we are using `run_at_sunrise()` and `run_at_sunset()` to register 2 separate callbacks. The argument `0` is the number of seconds offset from sunrise or sunset and can be negative or positive. For complex intervals it can be convenient to use Python's `datetime.timedelta` class for calculations. When sunrise or sunset occurs, the appropriate callback function, `sunrise_cb()` or `sunset_cb()` is called which then makes a call to Home Assistant to turn the porch light on or off by activating a scene. The variables `args["on_scene"]` and `args["off_scene"]` are passed through from the configuration of this particular App, and the same code could be reused to activate completely different scenes in a different version of the App.
<div class="highlighter-coderay"><div class="CodeRay"> ```python
<div class="code"><pre><span class="keyword">import</span> <span class="include">appapi</span> import appapi
<span class="keyword">class</span> <span class="class">OutsideLights</span>(appapi.AppDaemon): class OutsideLights(appapi.AppDaemon):
<span class="keyword">def</span> <span class="function">initialize</span>(<span class="predefined-constant">self</span>): def initialize(self):
<span class="predefined-constant">self</span>.run_at_sunrise(<span class="predefined-constant">self</span>.sunrise_cb, <span class="integer">0</span>) self.run_at_sunrise(self.sunrise_cb, 0)
<span class="predefined-constant">self</span>.run_at_sunset(<span class="predefined-constant">self</span>.sunset_cb, <span class="integer">0</span>) self.run_at_sunset(self.sunset_cb, 0)
def sunrise_cb(self, args, kwargs):
self.turn_on(self.args["off_scene"])
def sunset_cb(self, args, kwargs):
self.turn_on(self.args["on_scene"])
```
This is also fairly easy to achieve with Home Assistant automations, but we are just getting started.
### <a class='title-link' name='motion-light' href='#motion-light'></a> Motion Light
Our next example is to turn on a light when motion is detected and it is dark, and turn it off after a period of time. This time, the `initialize()` function registers a callback on a state change (of the motion sensor) rather than a specific time. We tell `AppDaemon` that we are only interested in state changes where the motion detector comes on by adding an additional parameter to the callback registration - `new = "on"`. When the motion is detected, the callack function `motion()` is called, and we check whether or not the sun has set using a built-in convenience function: `sun_down()`. Next, we turn the light on with `turn_on()`, then set a timer using `run_in()` to turn the light off after 60 seconds, which is another call to the scheduler to execute in a set time from now, which results in `AppDaemon` calling `light_off()` 60 seconds later using the `turn_off()` call to actually turn the light off. This is still pretty simple in code terms:
```python
import appapi
class MotionLights(appapi.AppDaemon):
def initialize(self):
self.listen_state(self.motion, "binary_sensor.drive", new = "on")
def motion(self, entity, attribute, old, new, kwargs):
if self.sun_down():
self.turn_on("light.drive")
self.run_in(self.light_off, 60)
def light_off(self, kwargs):
self.turn_off("light.drive")
```
This is starting to get a little more complex in Home Assistant automations requiring an Automation rule and two separate scripts.
Now lets extend this with a somewhat artificial example to show something that is simple in `AppDaemon` but very difficult if not impossible using automations. Lets warn someone inside the house that there has been motion outside by flashing a lamp on and off 10 times. We are reacting to the motion as before by turning on the light and setting a timer to turn it off again, but in addition, we set a 1 second timer to run `flash_warning()` which when called, toggles the inside light and sets another timer to call itself a second later. To avoid re-triggering forever, it keeps a count of how many times it has been activated and bales out after 10 iterations.
```python
import appapi
class FlashyMotionLights(appapi.AppDaemon):
def initialize(self):
self.listen_state(self.motion, "binary_sensor.drive", new = "on")
def motion(self, entity, attribute, old, new, kwargs):
if self.self.sun_down():
self.turn_on("light.drive")
self.run_in(self.light_off, 60)
self.flashcount = 0
self.run_in(self.flash_warning, 1)
def light_off(self, kwargs):
self.turn_off("light.drive")
<span class="keyword">def</span> <span class="function">sunrise_cb</span>(<span class="predefined-constant">self</span>, args, kwargs): def flash_warning(self, kwargs):
<span class="predefined-constant">self</span>.turn_on(<span class="predefined-constant">self</span>.args[<span class="string"><span class="delimiter">&quot;</span><span class="content">off_scene</span><span class="delimiter">&quot;</span></span>]) self.toggle("light.living_room")
self.flashcount += 1
if self.flashcount < 10:
self.run_in(self.flash_warning, 1)
```
<span class="keyword">def</span> <span class="function">sunset_cb</span>(<span class="predefined-constant">self</span>, args, kwargs): Of course if I wanted to make this App or its predecessor reusable I would have provided parameters for the sensor, the light to activate on motion, the warning light and even the number of flashes and delay between flashes.
<span class="predefined-constant">self</span>.turn_on(<span class="predefined-constant">self</span>.args[<span class="string"><span class="delimiter">&quot;</span><span class="content">on_scene</span><span class="delimiter">&quot;</span></span>])
</pre></div> In addition, Apps can write to `AppDaemon`'s logfiles, and there is a system of constraints that allows yout to control when and under what circumstances Apps and callbacks are active to keep the logic clean and simple.
</div>
</div>
<p>This is also fairly easy to achieve with Home Assistant automations, but we are just getting started.</p> I have spent the last few weeks moving all of my (fairly complex) automations over to `APPDaemon` and so far it is working very reliably.
<h3><a class='title-link' name='motion-light' href='#motion-light'></a> Motion Light </h3> Some people will maybe look at all of this and say "what use is this, I can already do all of this", and that is fine, as I said this is an alternative not a replacement, but I am hopeful that for some users this will seem a more natural, powerful and nimble way of building potentially very complex automations.
<p>Our next example is to turn on a light when motion is detected and it is dark, and turn it off after a period of time. This time, the <code>initialize()</code> function registers a callback on a state change (of the motion sensor) rather than a specific time. We tell <code>AppDaemon</code> that we are only interested in state changes where the motion detector comes on by adding an additional parameter to the callback registration - <code>new = "on"</code>. When the motion is detected, the callack function <code>motion()</code> is called, and we check whether or not the sun has set using a built-in convenience function: <code>sun_down()</code>. Next, we turn the light on with <code>turn_on()</code>, then set a timer using <code>run_in()</code> to turn the light off after 60 seconds, which is another call to the scheduler to execute in a set time from now, which results in <code>AppDaemon</code> calling <code>light_off()</code> 60 seconds later using the <code>turn_off()</code> call to actually turn the light off. This is still pretty simple in code terms:</p> If this has whet your appetite, feel free to give it a try. You can find it, [here](https://github.com/acockburn/appdaemon), including full installation instructions, an API reference, and a number of fully fleshed out examples.
<div class="highlighter-coderay"><div class="CodeRay"> Happy Automating!
<div class="code"><pre><span class="keyword">import</span> <span class="include">appapi</span>
<span class="keyword">class</span> <span class="class">MotionLights</span>(appapi.AppDaemon):
<span class="keyword">def</span> <span class="function">initialize</span>(<span class="predefined-constant">self</span>):
<span class="predefined-constant">self</span>.listen_state(<span class="predefined-constant">self</span>.motion, <span class="string"><span class="delimiter">&quot;</span><span class="content">binary_sensor.drive</span><span class="delimiter">&quot;</span></span>, new = <span class="string"><span class="delimiter">&quot;</span><span class="content">on</span><span class="delimiter">&quot;</span></span>)
<span class="keyword">def</span> <span class="function">motion</span>(<span class="predefined-constant">self</span>, entity, attribute, old, new, kwargs):
<span class="keyword">if</span> <span class="predefined-constant">self</span>.sun_down():
<span class="predefined-constant">self</span>.turn_on(<span class="string"><span class="delimiter">&quot;</span><span class="content">light.drive</span><span class="delimiter">&quot;</span></span>)
<span class="predefined-constant">self</span>.run_in(<span class="predefined-constant">self</span>.light_off, <span class="integer">60</span>)
<span class="keyword">def</span> <span class="function">light_off</span>(<span class="predefined-constant">self</span>, kwargs):
<span class="predefined-constant">self</span>.turn_off(<span class="string"><span class="delimiter">&quot;</span><span class="content">light.drive</span><span class="delimiter">&quot;</span></span>)
</pre></div>
</div>
</div>
<p>This is starting to get a little more complex in Home Assistant automations requiring an Automation rule and two separate scripts.</p>
<p>Now lets extend this with a somewhat artificial example to show something that is simple in <code>AppDaemon</code> but very difficult if not impossible using automations. Lets warn someone inside the house that there has been motion outside by flashing a lamp on and off 10 times. We are reacting to the motion as before by turning on the light and setting a timer to turn it off again, but in addition, we set a 1 second timer to run <code>flash_warning()</code> which when called, toggles the inside light and sets another timer to call itself a second later. To avoid re-triggering forever, it keeps a count of how many times it has been activated and bales out after 10 iterations.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="keyword">import</span> <span class="include">appapi</span>
<span class="keyword">class</span> <span class="class">FlashyMotionLights</span>(appapi.AppDaemon):
<span class="keyword">def</span> <span class="function">initialize</span>(<span class="predefined-constant">self</span>):
<span class="predefined-constant">self</span>.listen_state(<span class="predefined-constant">self</span>.motion, <span class="string"><span class="delimiter">&quot;</span><span class="content">binary_sensor.drive</span><span class="delimiter">&quot;</span></span>, new = <span class="string"><span class="delimiter">&quot;</span><span class="content">on</span><span class="delimiter">&quot;</span></span>)
<span class="keyword">def</span> <span class="function">motion</span>(<span class="predefined-constant">self</span>, entity, attribute, old, new, kwargs):
<span class="keyword">if</span> <span class="predefined-constant">self</span>.self.sun_down():
<span class="predefined-constant">self</span>.turn_on(<span class="string"><span class="delimiter">&quot;</span><span class="content">light.drive</span><span class="delimiter">&quot;</span></span>)
<span class="predefined-constant">self</span>.run_in(<span class="predefined-constant">self</span>.light_off, <span class="integer">60</span>)
<span class="predefined-constant">self</span>.flashcount = <span class="integer">0</span>
<span class="predefined-constant">self</span>.run_in(<span class="predefined-constant">self</span>.flash_warning, <span class="integer">1</span>)
<span class="keyword">def</span> <span class="function">light_off</span>(<span class="predefined-constant">self</span>, kwargs):
<span class="predefined-constant">self</span>.turn_off(<span class="string"><span class="delimiter">&quot;</span><span class="content">light.drive</span><span class="delimiter">&quot;</span></span>)
<span class="keyword">def</span> <span class="function">flash_warning</span>(<span class="predefined-constant">self</span>, kwargs):
<span class="predefined-constant">self</span>.toggle(<span class="string"><span class="delimiter">&quot;</span><span class="content">light.living_room</span><span class="delimiter">&quot;</span></span>)
<span class="predefined-constant">self</span>.flashcount += <span class="integer">1</span>
<span class="keyword">if</span> <span class="predefined-constant">self</span>.flashcount &lt; <span class="integer">10</span>:
<span class="predefined-constant">self</span>.run_in(<span class="predefined-constant">self</span>.flash_warning, <span class="integer">1</span>)
</pre></div>
</div>
</div>
<p>Of course if I wanted to make this App or its predecessor reusable I would have provided parameters for the sensor, the light to activate on motion, the warning light and even the number of flashes and delay between flashes.</p>
<p>In addition, Apps can write to <code>AppDaemon</code>s logfiles, and there is a system of constraints that allows yout to control when and under what circumstances Apps and callbacks are active to keep the logic clean and simple.</p>
<p>I have spent the last few weeks moving all of my (fairly complex) automations over to <code>APPDaemon</code> and so far it is working very reliably.</p>
<p>Some people will maybe look at all of this and say “what use is this, I can already do all of this”, and that is fine, as I said this is an alternative not a replacement, but I am hopeful that for some users this will seem a more natural, powerful and nimble way of building potentially very complex automations.</p>
<p>If this has whet your appetite, feel free to give it a try. You can find it, <a href="https://github.com/acockburn/appdaemon">here</a>, including full installation instructions, an API reference, and a number of fully fleshed out examples.</p>
<p>Happy Automating!</p>
]]></content> ]]></content>
</entry> </entry>
@ -170,28 +163,26 @@ Heatmap
<link href="https://home-assistant.io/blog/2016/07/28/esp8266-and-micropython-part1/"/> <link href="https://home-assistant.io/blog/2016/07/28/esp8266-and-micropython-part1/"/>
<updated>2016-07-28T04:00:00+00:00</updated> <updated>2016-07-28T04:00:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/07/28/esp8266-and-micropython-part1</id> <id>https://home-assistant.io/blog/2016/07/28/esp8266-and-micropython-part1</id>
<content type="html"><![CDATA[<p><img src="https://home-assistant.io/images/blog/2016-07-micropython/micropython.png" style="clear: right; border:none; box-shadow: none; float: right; margin-bottom: 12px;" width="200" /><br /> <content type="html"><![CDATA[<img src='https://home-assistant.io/images/blog/2016-07-micropython/micropython.png' style='clear: right; border:none; box-shadow: none; float: right; margin-bottom: 12px;' width='200' />
The first release of Micropython for ESP8266 was delivered a couple of weeks ago. The <a href="http://docs.micropython.org/en/latest/esp8266/esp8266_contents.html">documentation</a> covers a lot of ground. This post is providing only a little summary which should get you started.</p> The first release of Micropython for ESP8266 was delivered a couple of weeks ago. The [documentation](http://docs.micropython.org/en/latest/esp8266/esp8266_contents.html) covers a lot of ground. This post is providing only a little summary which should get you started.
<p>Until a couple of weeks ago, the pre-built MicroPython binary for the ESP8266 was only available to backers. This has changed now and it is available to the public for <a href="https://micropython.org/download/#esp8266">download</a>.</p> Until a couple of weeks ago, the pre-built MicroPython binary for the ESP8266 was only available to backers. This has changed now and it is available to the public for [download](https://micropython.org/download/#esp8266).
<!--more--> <!--more-->
<p>The easiest way is to use <a href="https://github.com/themadinventor/esptool">esptool.py</a> for firmware handling tasks. First erase the flash:</p> The easiest way is to use [esptool.py](https://github.com/themadinventor/esptool) for firmware handling tasks. First erase the flash:
<div class="highlighter-coderay"><div class="CodeRay"> ```bash
<div class="code"><pre>$ sudo python esptool.py --port /dev/ttyUSB0 erase_flash $ sudo python esptool.py --port /dev/ttyUSB0 erase_flash
esptool.py v1.0.2-dev esptool.py v1.0.2-dev
Connecting... Connecting...
Erasing flash (this may take a while)... Erasing flash (this may take a while)...
</pre></div> ```
</div>
</div>
<p>and then load the firmware. You may adjust the file name of the firmware binary.</p> and then load the firmware. You may adjust the file name of the firmware binary.
<div class="highlighter-coderay"><div class="CodeRay"> ```bash
<div class="code"><pre>$ sudo python esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=8m 0 esp8266-2016-07-10-v1.8.2.bin $ sudo python esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=8m 0 esp8266-2016-07-10-v1.8.2.bin
esptool.py v1.2-dev esptool.py v1.2-dev
Connecting... Connecting...
Running Cesanta flasher stub... Running Cesanta flasher stub...
@ -199,16 +190,14 @@ Flash params set to 0x0020
Writing 540672 @ 0x0... 540672 (100 %) Writing 540672 @ 0x0... 540672 (100 %)
Wrote 540672 bytes at 0x0 in 13.1 seconds (330.8 kbit/s)... Wrote 540672 bytes at 0x0 in 13.1 seconds (330.8 kbit/s)...
Leaving... Leaving...
</pre></div> ```
</div>
</div>
<p>Now reset the device. You should then be able to use the <a href="http://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/repl.html#getting-a-micropython-repl-prompt">REPL (Read Evaluate Print Loop)</a>. On Linux there is <code>minicom</code> or <code>picocom</code>, on a Mac you can use <code>screen</code> (eg. <code>screen /dev/tty.SLAB_USBtoUART 115200</code>), and on Windows there is Putty to open a serial connection and get the REPL prompt.</p> Now reset the device. You should then be able to use the [REPL (Read Evaluate Print Loop)](http://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/repl.html#getting-a-micropython-repl-prompt). On Linux there is `minicom` or `picocom`, on a Mac you can use `screen` (eg. `screen /dev/tty.SLAB_USBtoUART 115200`), and on Windows there is Putty to open a serial connection and get the REPL prompt.
<p>The <a href="http://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/repl.html#webrepl-a-prompt-over-wifi">WebREPL</a> work over a wireless connection and allows easy access to a prompt in your browser. An instance of the WebREPL client is hosted at <a href="http://micropython.org/webrepl">http://micropython.org/webrepl</a>. Alternatively, you can create a local clone of their <a href="https://github.com/micropython/webrepl">GitHub repository</a>. This is neccessary if your want to use the command-line tool <code>webrepl_cli.py</code> which is mentionend later in this post.</p> The [WebREPL](http://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/repl.html#webrepl-a-prompt-over-wifi) work over a wireless connection and allows easy access to a prompt in your browser. An instance of the WebREPL client is hosted at [http://micropython.org/webrepl](http://micropython.org/webrepl). Alternatively, you can create a local clone of their [GitHub repository](https://github.com/micropython/webrepl). This is neccessary if your want to use the command-line tool `webrepl_cli.py` which is mentionend later in this post.
<div class="highlighter-coderay"><div class="CodeRay"> ```bash
<div class="code"><pre>$ sudo minicom -D /dev/ttyUSB0 $ sudo minicom -D /dev/ttyUSB0
#4 ets_task(4020e374, 29, 3fff70e8, 10) #4 ets_task(4020e374, 29, 3fff70e8, 10)
WebREPL daemon started on ws://192.168.4.1:8266 WebREPL daemon started on ws://192.168.4.1:8266
Started webrepl in setup mode Started webrepl in setup mode
@ -216,128 +205,114 @@ could not open file 'main.py' for reading
#5 ets_task(4010035c, 3, 3fff6360, 4) #5 ets_task(4010035c, 3, 3fff6360, 4)
MicroPython v1.8.2-9-g805c2b9 on 2016-07-10; ESP module with ESP8266 MicroPython v1.8.2-9-g805c2b9 on 2016-07-10; ESP module with ESP8266
Type &quot;help()&quot; for more information. Type "help()" for more information.
&gt;&gt;&gt; >>>
</pre></div> ```
</div>
</div>
<p class="note"> <p class='note'>
The public build of the firmware may be different than the firmware distributed to the backers of the campaign. Especially in regard of the <a href="http://docs.micropython.org/en/latest/esp8266/py-modindex.html">available modules</a>, turned on debug messages, and alike. Also, the WebREPL may not be started by default. The public build of the firmware may be different than the firmware distributed to the backers of the campaign. Especially in regard of the [available modules](http://docs.micropython.org/en/latest/esp8266/py-modindex.html), turned on debug messages, and alike. Also, the WebREPL may not be started by default.
</p> </p>
<p>Connect a LED to pin 5 (or another pin of your choosing) to check if the ESP8266 is working as expected.</p> Connect a LED to pin 5 (or another pin of your choosing) to check if the ESP8266 is working as expected.
<div class="highlighter-coderay"><div class="CodeRay"> ```python
<div class="code"><pre>&gt;&gt;&gt; <span class="keyword">import</span> <span class="include">machine</span> >>> import machine
&gt;&gt;&gt; pin = machine.Pin(<span class="integer">5</span>, machine.Pin.OUT) >>> pin = machine.Pin(5, machine.Pin.OUT)
&gt;&gt;&gt; pin.high() >>> pin.high()
</pre></div> ```
</div>
</div>
<p>You can toogle the LED by changing its state with <code>pin.high()</code> and <code>pin.low()</code>.</p> You can toogle the LED by changing its state with `pin.high()` and `pin.low()`.
<p>Various ESP8266 development board are shipped with an onboard photocell or a light dependent resistors (LDR) connected to the analog pin of your ESP8266 check if you are able to obtain a value.</p> Various ESP8266 development board are shipped with an onboard photocell or a light dependent resistors (LDR) connected to the analog pin of your ESP8266 check if you are able to obtain a value.
<div class="highlighter-coderay"><div class="CodeRay"> ```python
<div class="code"><pre>&gt;&gt;&gt; <span class="keyword">import</span> <span class="include">machine</span> >>> import machine
&gt;&gt;&gt; brightness = machine.ADC(<span class="integer">0</span>) >>> brightness = machine.ADC(0)
&gt;&gt;&gt; brightness.read() >>> brightness.read()
</pre></div> ```
</div>
</div>
<p>Make sure that you are familiar with REPL and WebREPL because this will be needed soon. Keep in mind the password for the WebREPL access.</p> Make sure that you are familiar with REPL and WebREPL because this will be needed soon. Keep in mind the password for the WebREPL access.
<p>Read the <a href="http://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/network_basics.html">instructions</a> about how to setup your wireless connection. Basically you need to upload a <code>boot.py</code> file to the microcontroller and this file is taking care of the connection setup. Below you find a sample which is more or less the same as shown in the <a href="http://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/network_basics.html#configuration-of-the-wifi">documentation</a>.</p> Read the [instructions](http://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/network_basics.html) about how to setup your wireless connection. Basically you need to upload a `boot.py` file to the microcontroller and this file is taking care of the connection setup. Below you find a sample which is more or less the same as shown in the [documentation](http://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/network_basics.html#configuration-of-the-wifi).
<div class="highlighter-coderay"><div class="CodeRay"> ```python
<div class="code"><pre><span class="keyword">def</span> <span class="function">do_connect</span>(): def do_connect():
<span class="keyword">import</span> <span class="include">network</span> import network
SSID = <span class="string"><span class="delimiter">'</span><span class="content">SSID</span><span class="delimiter">'</span></span> SSID = 'SSID'
PASSWORD = <span class="string"><span class="delimiter">'</span><span class="content">PASSWORD</span><span class="delimiter">'</span></span> PASSWORD = 'PASSWORD'
sta_if = network.WLAN(network.STA_IF) sta_if = network.WLAN(network.STA_IF)
ap_if = network.WLAN(network.AP_IF) ap_if = network.WLAN(network.AP_IF)
<span class="keyword">if</span> ap_if.active(): if ap_if.active():
ap_if.active(<span class="predefined-constant">False</span>) ap_if.active(False)
<span class="keyword">if</span> <span class="keyword">not</span> sta_if.isconnected(): if not sta_if.isconnected():
print(<span class="string"><span class="delimiter">'</span><span class="content">connecting to network...</span><span class="delimiter">'</span></span>) print('connecting to network...')
sta_if.active(<span class="predefined-constant">True</span>) sta_if.active(True)
sta_if.connect(SSID, PASSWORD) sta_if.connect(SSID, PASSWORD)
<span class="keyword">while</span> <span class="keyword">not</span> sta_if.isconnected(): while not sta_if.isconnected():
<span class="keyword">pass</span> pass
print(<span class="string"><span class="delimiter">'</span><span class="content">Network configuration:</span><span class="delimiter">'</span></span>, sta_if.ifconfig()) print('Network configuration:', sta_if.ifconfig())
</pre></div> ```
</div>
</div>
<p>Upload this file with <code>webrepl_cli.py</code> or the WebREPL:</p> Upload this file with `webrepl_cli.py` or the WebREPL:
<div class="highlighter-coderay"><div class="CodeRay"> ```bash
<div class="code"><pre>$ python webrepl_cli.py boot.py 192.168.4.1:/boot.py $ python webrepl_cli.py boot.py 192.168.4.1:/boot.py
</pre></div> ```
</div>
</div>
<p>If you reboot, you should see your current IP address in the terminal.</p> If you reboot, you should see your current IP address in the terminal.
<div class="highlighter-coderay"><div class="CodeRay"> ```bash
<div class="code"><pre>&gt;&gt;&gt; Network configuration: ('192.168.0.10', '255.255.255.0', '192.168.0.1', '192.168.0.1') >>> Network configuration: ('192.168.0.10', '255.255.255.0', '192.168.0.1', '192.168.0.1')
</pre></div> ```
</div>
</div>
<p>First lets create a little consumer for Home Assistant sensors state. The code to place in <code>main.py</code> is a mixture of code from above and the <a href="/developers/rest_api/">RESTful API</a> of Home Assistant. If the temperature in the kitchen is higher than 20 °C then the LED connected to pin 5 is switched on.</p> First let's create a little consumer for Home Assistant sensor's state. The code to place in `main.py` is a mixture of code from above and the [RESTful API](/developers/rest_api/) of Home Assistant. If the temperature in the kitchen is higher than 20 °C then the LED connected to pin 5 is switched on.
<p class="note"> <p class='note'>
If a module is missing then you need to download is it from <a href="https://github.com/micropython/micropython-lib">MicroPython Library overview</a> and upload it to the ESP8266 with <code>webrepl_cli.py</code> manually. If a module is missing then you need to download is it from [MicroPython Library overview](https://github.com/micropython/micropython-lib) and upload it to the ESP8266 with `webrepl_cli.py` manually.
</p> </p>
<div class="highlighter-coderay"><div class="CodeRay"> ```python
<div class="code"><pre><span class="comment"># Sample code to request the state of a Home Assistant entity.</span> # Sample code to request the state of a Home Assistant entity.
API_PASSWORD = <span class="string"><span class="delimiter">'</span><span class="content">YOUR_PASSWORD</span><span class="delimiter">'</span></span> API_PASSWORD = 'YOUR_PASSWORD'
URL = <span class="string"><span class="delimiter">'</span><span class="content">http://192.168.0.5:8123/api/states/</span><span class="delimiter">'</span></span> URL = 'http://192.168.0.5:8123/api/states/'
ENTITY = <span class="string"><span class="delimiter">'</span><span class="content">sensor.kitchen_temperature</span><span class="delimiter">'</span></span> ENTITY = 'sensor.kitchen_temperature'
TIMEOUT = <span class="integer">30</span> TIMEOUT = 30
PIN = <span class="integer">5</span> PIN = 5
<span class="keyword">def</span> <span class="function">get_data</span>(): def get_data():
<span class="keyword">import</span> <span class="include">urequests</span> import urequests
url = <span class="string"><span class="delimiter">'</span><span class="content">{}{}</span><span class="delimiter">'</span></span>.format(URL, ENTITY) url = '{}{}'.format(URL, ENTITY)
headers = {<span class="string"><span class="delimiter">'</span><span class="content">x-ha-access</span><span class="delimiter">'</span></span>: API_PASSWORD, headers = {'x-ha-access': API_PASSWORD,
<span class="string"><span class="delimiter">'</span><span class="content">content-type</span><span class="delimiter">'</span></span>: <span class="string"><span class="delimiter">'</span><span class="content">application/json</span><span class="delimiter">'</span></span>} 'content-type': 'application/json'}
resp = urequests.get(URL, headers=headers) resp = urequests.get(URL, headers=headers)
<span class="keyword">return</span> resp.json()[<span class="string"><span class="delimiter">'</span><span class="content">state</span><span class="delimiter">'</span></span>] return resp.json()['state']
<span class="keyword">def</span> <span class="function">main</span>(): def main():
<span class="keyword">import</span> <span class="include">machine</span> import machine
<span class="keyword">import</span> <span class="include">time</span> import time
pin = machine.Pin(PIN, machine.Pin.OUT) pin = machine.Pin(PIN, machine.Pin.OUT)
<span class="keyword">while</span> <span class="predefined-constant">True</span>: while True:
<span class="keyword">try</span>: try:
<span class="keyword">if</span> <span class="predefined">int</span>(get_data()) &gt;= <span class="integer">20</span>: if int(get_data()) >= 20:
pin.high() pin.high()
<span class="keyword">else</span>: else:
pin.low() pin.low()
<span class="keyword">except</span> <span class="exception">TypeError</span>: except TypeError:
<span class="keyword">pass</span> pass
time.sleep(TIMEOUT) time.sleep(TIMEOUT)
<span class="keyword">if</span> __name__ == <span class="string"><span class="delimiter">'</span><span class="content">__main__</span><span class="delimiter">'</span></span>: if __name__ == '__main__':
print(<span class="string"><span class="delimiter">'</span><span class="content">Get the state of {}</span><span class="delimiter">'</span></span>.format(ENTITY)) print('Get the state of {}'.format(ENTITY))
main() main()
</pre></div> ```
</div>
</div>
<p>Upload <code>main.py</code> the same way as <code>boot.py</code>. After a reboot (<code>&gt;&gt;&gt; import machine</code> and <code>&gt;&gt;&gt; machine.reboot()</code>) or power-cycling your physical notifier is ready.</p> Upload `main.py` the same way as `boot.py`. After a reboot (`>>> import machine` and `>>> machine.reboot()`) or power-cycling your physical notifier is ready.
<p>If you run into trouble, press “Ctrl+c” in the REPL to stop the execution of the code, enter <code>&gt;&gt;&gt; import webrepl</code> and <code>&gt;&gt;&gt; webrepl.start()</code>, and upload your fixed file.</p> If you run into trouble, press "Ctrl+c" in the REPL to stop the execution of the code, enter `>>> import webrepl` and `>>> webrepl.start()`, and upload your fixed file.
]]></content> ]]></content>
</entry> </entry>
@ -347,71 +322,74 @@ PIN = <span class="integer">5</span>
<link href="https://home-assistant.io/blog/2016/07/23/internet-of-things-data-exploration-with-jupyter-notebooks/"/> <link href="https://home-assistant.io/blog/2016/07/23/internet-of-things-data-exploration-with-jupyter-notebooks/"/>
<updated>2016-07-23T18:00:00+00:00</updated> <updated>2016-07-23T18:00:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/07/23/internet-of-things-data-exploration-with-jupyter-notebooks</id> <id>https://home-assistant.io/blog/2016/07/23/internet-of-things-data-exploration-with-jupyter-notebooks</id>
<content type="html"><![CDATA[<p><em>This is the first blog post by Anton Kireyeu. A new contributor to Home Assistant who will focus on exploring and visualizing Home Assistant data.</em></p> <content type="html"><![CDATA[_This is the first blog post by Anton Kireyeu. A new contributor to Home Assistant who will focus on exploring and visualizing Home Assistant data._
<p>As we learned in the recent <a href="https://home-assistant.io/blog/2016/07/19/visualizing-your-iot-data/">blog post by Fabian</a>, all operational data of your Home Assistant application is stored locally and is available for exploration. Our first steps were querying data with the <a href="http://sqlitebrowser.org/">DB Browser for SQLite</a>, exporting the data extract as a CSV file and graphing in LibreOffice. But what else can be done with this data and what tools are there available?</p> As we learned in the recent [blog post by Fabian], all operational data of your Home Assistant application is stored locally and is available for exploration. Our first steps were querying data with the [DB Browser for SQLite], exporting the data extract as a CSV file and graphing in LibreOffice. But what else can be done with this data and what tools are there available?
<p>This post will help you get set up using a few popular data scientist tools to allow you to locally process your data:</p> This post will help you get set up using a few popular data scientist tools to allow you to locally process your data:
<ul> - &nbsp;[Pandas]: an open source tool for data analysis for Python
<li> <a href="http://pandas.pydata.org/">Pandas</a>: an open source tool for data analysis for Python</li> - &nbsp;[matplotlib]: a Python plotting library
<li> <a href="http://matplotlib.org/">matplotlib</a>: a Python plotting library</li> - &nbsp;[Jupyter notebook]: application for creation and sharing of documents containing live code, visualizations and explanatory text
<li> <a href="https://jupyter.org/">Jupyter notebook</a>: application for creation and sharing of documents containing live code, visualizations and explanatory text</li>
</ul>
<p class="img"> <p class='img'>
<img src="https://home-assistant.io/images/blog/2016-07-data-exploration/graph.png" /> <img src='https://home-assistant.io/images/blog/2016-07-data-exploration/graph.png'>
One of the graphs created with this tutorial. One of the graphs created with this tutorial.
</p> </p>
<p><em>TL; DR: Use <a href="http://nbviewer.jupyter.org/github/home-assistant/home-assistant-notebooks/blob/master/DataExploration-1/DataExploration-1.ipynb">this Jupyter Notebook</a> to visualize of your data</em></p> _TL; DR: Use [this Jupyter Notebook][nb-prev] to visualize of your data_
[blog post by Fabian]: https://home-assistant.io/blog/2016/07/19/visualizing-your-iot-data/
[DB Browser for SQLite]: http://sqlitebrowser.org/
[Pandas]: http://pandas.pydata.org/
[matplotlib]: http://matplotlib.org/
[Jupyter notebook]: https://jupyter.org/
[nb-prev]: http://nbviewer.jupyter.org/github/home-assistant/home-assistant-notebooks/blob/master/DataExploration-1/DataExploration-1.ipynb
<!--more--> <!--more-->
<h3><a class='title-link' name='dependencies' href='#dependencies'></a> Dependencies </h3> ### <a class='title-link' name='dependencies' href='#dependencies'></a> Dependencies
<p>In order to run the provided Jupyter notebook, please make sure you have the following applications/libraries installed on your computer:</p> In order to run the provided Jupyter notebook, please make sure you have the following applications/libraries installed on your computer:
<ul> - Pandas
<li>Pandas</li> - NumPy
<li>NumPy</li> - Matplotlib
<li>Matplotlib</li> - SQLAlchemy
<li>SQLAlchemy</li> - Jupyter
<li>Jupyter</li>
</ul>
<p>As a Windows user myself, I find the easiest, quickest and most hassle-free way of installing all of these dependencies is to use <a href="https://winpython.github.io/">WinPython</a>. This free open-source portable distribution includes all of the dependencies required for this notebook, as well as a few other essential Python libraries you may require for data exploration in the future.</p> As a Windows user myself, I find the easiest, quickest and most hassle-free way of installing all of these dependencies is to use [WinPython]. This free open-source portable distribution includes all of the dependencies required for this notebook, as well as a few other essential Python libraries you may require for data exploration in the future.
<h4><a class='title-link' name='why-jupyter' href='#why-jupyter'></a> Why Jupyter? </h4> [WinPython]: https://winpython.github.io/
<p>While all Home Assistant implementations can have varying setup, components and scripts, the underlying data structure is standardized and well-defined. This allows us to write Python code that is environmentally agnostic. Wrapping it in a Jupyter notebook ensures the code, visualizations and directions/explanations are kept digestible and neatly-packaged. One of the amazing features of Jupyter is the ability to change code as you go along, customizing all outputs and visualizations on the fly!</p> #### <a class='title-link' name='why-jupyter' href='#why-jupyter'></a> Why Jupyter?
<h4><a class='title-link' name='where-do-i-start' href='#where-do-i-start'></a> Where do I start? </h4> While all Home Assistant implementations can have varying setup, components and scripts, the underlying data structure is standardized and well-defined. This allows us to write Python code that is environmentally agnostic. Wrapping it in a Jupyter notebook ensures the code, visualizations and directions/explanations are kept digestible and neatly-packaged. One of the amazing features of Jupyter is the ability to change code as you go along, customizing all outputs and visualizations on the fly!
<p>This tutorial is based around a heavily commented Jupyter Notebook that we created. So to get started, you will have to open that:</p> #### <a class='title-link' name='where-do-i-start' href='#where-do-i-start'></a> Where do I start?
<ul> This tutorial is based around a heavily commented Jupyter Notebook that we created. So to get started, you will have to open that:
<li><a href="http://nbviewer.jupyter.org/github/home-assistant/home-assistant-notebooks/blob/master/DataExploration-1/DataExploration-1.ipynb">download the tutorial Jupyter Notebook</a> (leads to preview page, from there click download top-right)</li>
<li>launch the Jupyter Notebook App</li>
<li>Click the upload button to add the downloaded notebook to Jupyter</li>
<li>Adjust the <code>DB_URL</code> at the beginning of the notebook to point at your Home Assistant database</li>
<li>Select in top menu: Cell -&gt; Run All</li>
</ul>
<p>Thats it! The included code will walk you through importing the required libraries, show running raw SQL against your local database, plotting basic data from the states table, and in the end output a few plots of changes for every entity in your system as well as the mean daily value for the past 20 days.</p> - [download the tutorial Jupyter Notebook][nb-prev] (leads to preview page, from there click download top-right)
- launch the Jupyter Notebook App
- Click the 'upload' button to add the downloaded notebook to Jupyter
- Adjust the `DB_URL` at the beginning of the notebook to point at your Home Assistant database
- Select in top menu: Cell -> Run All
<p>After just those few steps, you will be greeted with beautiful formatted data like this:</p> Thats it! The included code will walk you through importing the required libraries, show running raw SQL against your local database, plotting basic data from the states table, and in the end output a few plots of changes for every entity in your system as well as the mean daily value for the past 20 days.
<p class="img"> After just those few steps, you will be greeted with beautiful formatted data like this:
<img src="https://home-assistant.io/images/blog/2016-07-data-exploration/graph.png" />
<p class='img'>
<img src='https://home-assistant.io/images/blog/2016-07-data-exploration/graph.png'>
One of the graphs created with this tutorial. One of the graphs created with this tutorial.
</p> </p>
<h4><a class='title-link' name='whats-next' href='#whats-next'></a> Whats next? </h4> #### <a class='title-link' name='whats-next' href='#whats-next'></a> Whats next?
<p>Thanks to the magic of Jupyter, all of the code is customizable: want to selectively display your data, only covering a specific entity? Sure thing! Want to change the properties of the plots? No problem!</p> Thanks to the magic of Jupyter, all of the code is customizable: want to selectively display your data, only covering a specific entity? Sure thing! Want to change the properties of the plots? No problem!
<p>While you learn and explore your IoT data, we will be working on providing more ready-to-use Jupyter Notebooks. Feel free to ask questions or provide suggestions. Would you like to see a specific visualization? Is there a particular facet of data youre interested in? Lets talk about it, lets dive into the world of data together!</p> While you learn and explore your IoT data, we will be working on providing more ready-to-use Jupyter Notebooks. Feel free to ask questions or provide suggestions. Would you like to see a specific visualization? Is there a particular facet of data youre interested in? Lets talk about it, lets dive into the world of data together!
]]></content> ]]></content>
</entry> </entry>
@ -420,114 +398,106 @@ One of the graphs created with this tutorial.
<link href="https://home-assistant.io/blog/2016/07/19/visualizing-your-iot-data/"/> <link href="https://home-assistant.io/blog/2016/07/19/visualizing-your-iot-data/"/>
<updated>2016-07-19T16:00:00+00:00</updated> <updated>2016-07-19T16:00:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/07/19/visualizing-your-iot-data</id> <id>https://home-assistant.io/blog/2016/07/19/visualizing-your-iot-data</id>
<content type="html"><![CDATA[<p><img src="https://home-assistant.io/images/blog/2016-07-reporting/mpl-sensor.png" style="clear: right; border:none; box-shadow: none; float: right; margin-bottom: 12px;" width="200" /></p> <content type="html"><![CDATA[<img src='https://home-assistant.io/images/blog/2016-07-reporting/mpl-sensor.png' style='clear: right; border:none; box-shadow: none; float: right; margin-bottom: 12px;' width='200' />
<p>The <a href="/components/history/">history component</a> is tracking everything that is going on within Home Assistant. This means that you have access to all stored information about your home. Our history is not a full-fledged graphical processing and visualization component as you may know from systems and network monitoring tools. The current limitation is that you only can select a day for a visual output of your information and not a period. Also, there is no possibility to drill down on a specific entity.</p> The [history component](/components/history/) is tracking everything that is going on within Home Assistant. This means that you have access to all stored information about your home. Our history is not a full-fledged graphical processing and visualization component as you may know from systems and network monitoring tools. The current limitation is that you only can select a day for a visual output of your information and not a period. Also, there is no possibility to drill down on a specific entity.
<p>This blog post will show you ways to export data for reporting, visualization, or further analysis of automation rules.</p> This blog post will show you ways to export data for reporting, visualization, or further analysis of automation rules.
<!--more--> <!--more-->
<p>In this blog post I use the temperature of the <a href="https://en.wikipedia.org/wiki/Aare">Aare</a> river close to where I live as a show case. The temperatures were recorded with the <a href="/components/sensor.swiss_hydrological_data/">Swiss Hydrological Data sensor</a> and the name of the sensor is <code>sensor.aare</code>.</p> In this blog post I use the temperature of the [Aare](https://en.wikipedia.org/wiki/Aare) river close to where I live as a show case. The temperatures were recorded with the [Swiss Hydrological Data sensor](/components/sensor.swiss_hydrological_data/) and the name of the sensor is `sensor.aare`.
<p>The database is stored at <code>&lt;path to config dir&gt;/.homeassistant/home-assistant_v2.db</code> as <a href="https://www.sqlite.org/">SQLite database</a>. In all examples we are going to use the path: <code>/home/ha/.homeassistant/home-assistant_v2.db</code></p> The database is stored at `<path to config dir>/.homeassistant/home-assistant_v2.db` as [SQLite database](https://www.sqlite.org/). In all examples we are going to use the path: `/home/ha/.homeassistant/home-assistant_v2.db`
<p>If you are just curious whats stored in your database then you can use the <code>sqlite3</code> command-line tool or a graphical one like <a href="http://sqlitebrowser.org/">DB Browser for SQLite</a>.</p> If you are just curious what's stored in your database then you can use the `sqlite3` command-line tool or a graphical one like [DB Browser for SQLite](http://sqlitebrowser.org/).
<p>The table that is holding the states is called <code>states</code>. The <code>events</code> tables is responsible for storing the events which occurred. So, we will first check how many entries there are in the <code>states</code> table. <code>sqlite3</code> needs to know where the databases is located. To work with your database make sure that Home Assistant is not running or create a copy of the existing database. Its recommended to work with a copy.</p> The table that is holding the states is called `states`. The `events` tables is responsible for storing the events which occurred. So, we will first check how many entries there are in the `states` table. `sqlite3` needs to know where the databases is located. To work with your database make sure that Home Assistant is not running or create a copy of the existing database. It's recommended to work with a copy.
<div class="highlighter-coderay"><div class="CodeRay"> ```bash
<div class="code"><pre>$ sqlite3 /home/ha/.homeassistant/home-assistant_v2.db $ sqlite3 /home/ha/.homeassistant/home-assistant_v2.db
SQLite version 3.11.0 2016-02-15 17:29:24 SQLite version 3.11.0 2016-02-15 17:29:24
sqlite&gt; SELECT count(*) FROM states; sqlite> SELECT count(*) FROM states;
24659 24659
</pre></div> ```
</div>
</div>
<p>Lets have a look at a sample <a href="https://en.wikipedia.org/wiki/SQL">SQL</a> query. This query will show all states in a period for the sensor <code>sensor.aare</code>.</p> Let's have a look at a sample [SQL](https://en.wikipedia.org/wiki/SQL) query. This query will show all states in a period for the sensor `sensor.aare`.
<div class="highlighter-coderay"><div class="CodeRay"> ```sql
<div class="code"><pre><span class="class">SELECT</span> state, last_changed <span class="keyword">FROM</span> states SELECT state, last_changed FROM states
<span class="keyword">WHERE</span> WHERE
entity_id = <span class="string"><span class="delimiter">'</span><span class="content">sensor.aare</span><span class="delimiter">'</span></span> entity_id = 'sensor.aare'
<span class="keyword">AND</span> AND
last_changed <span class="keyword">BETWEEN</span> last_changed BETWEEN
<span class="string"><span class="delimiter">'</span><span class="content">2016-07-05 00:00:00.000000</span><span class="delimiter">'</span></span> <span class="keyword">AND</span> <span class="string"><span class="delimiter">'</span><span class="content">2016-07-07 00:00:00.000000</span><span class="delimiter">'</span></span>; '2016-07-05 00:00:00.000000' AND '2016-07-07 00:00:00.000000';
</pre></div> ```
</div>
</div>
<p>The SQL statement can be formed that it fits exactly what you need. This means that you can process the data in any way you want for further use. Often it makes sense to eliminate certain entries like <code>Unknown</code> or peaks.</p> The SQL statement can be formed that it fits exactly what you need. This means that you can process the data in any way you want for further use. Often it makes sense to eliminate certain entries like `Unknown` or peaks.
<p>If the above query is executed in DB Browser for SQLite you would be able to save the sensors graph as png.</p> If the above query is executed in DB Browser for SQLite you would be able to save the sensor's graph as png.
<p class="img"> <p class='img'>
<img src="https://home-assistant.io/images/blog/2016-07-reporting/db-browser.png" /> <img src='https://home-assistant.io/images/blog/2016-07-reporting/db-browser.png' />
Visualization with DB Browser for SQLite Visualization with DB Browser for SQLite
</p> </p>
<p>You may ask: Why not do this with LibreOffice Calc or another spreadsheet application? As most spreadsheet applications are not able to work directly with SQLite database we are going to export the data from the database to <a href="https://en.wikipedia.org/wiki/Comma-separated_values">CSV</a>.</p> You may ask: Why not do this with LibreOffice Calc or another spreadsheet application? As most spreadsheet applications are not able to work directly with SQLite database we are going to export the data from the database to [CSV](https://en.wikipedia.org/wiki/Comma-separated_values).
<div class="highlighter-coderay"><div class="CodeRay"> ```bash
<div class="code"><pre>$ sqlite3 -header -csv /home/ha/.homeassistant/home-assistant_v2.db &quot;SELECT last_changed, state FROM states WHERE entity_id = 'sensor.aare' AND last_changed BETWEEN '2016-07-05 00:00:00.000000' AND '2016-07-07 00:00:00.000000';&quot; &gt; sensor.csv $ sqlite3 -header -csv /home/ha/.homeassistant/home-assistant_v2.db "SELECT last_changed, state FROM states WHERE entity_id = 'sensor.aare' AND last_changed BETWEEN '2016-07-05 00:00:00.000000' AND '2016-07-07 00:00:00.000000';" > sensor.csv
</pre></div> ```
</div>
</div>
<p>The ordering for the <code>SELECT</code> was changed to get the time stamps first and then the state. Now we can import the CSV file into the application of your choice, here its LibreOffice Calc.</p> The ordering for the `SELECT` was changed to get the time stamps first and then the state. Now we can import the CSV file into the application of your choice, here it's LibreOffice Calc.
<p class="img"> <p class='img'>
<img src="https://home-assistant.io/images/blog/2016-07-reporting/libreoffice-import.png" /> <img src='https://home-assistant.io/images/blog/2016-07-reporting/libreoffice-import.png' />
Import of the CSV file Import of the CSV file
</p> </p>
<p>After the import a graph can be created over the existing data.</p> After the import a graph can be created over the existing data.
<p class="img"> <p class='img'>
<img src="https://home-assistant.io/images/blog/2016-07-reporting/libreoffice-graph.png" /> <img src='https://home-assistant.io/images/blog/2016-07-reporting/libreoffice-graph.png' />
Graph in LibreOffice Graph in LibreOffice
</p> </p>
<p>You can also use <a href="http://matplotlib.org/">matplotlib</a> to generate graphs as an alternative to a spreadsheet application. This is a powerful Python 2D plotting library. With the built-in support for SQLite in Python it will only take a couple lines of code to visualize your data.</p> You can also use [matplotlib](http://matplotlib.org/) to generate graphs as an alternative to a spreadsheet application. This is a powerful Python 2D plotting library. With the built-in support for SQLite in Python it will only take a couple lines of code to visualize your data.
<div class="highlighter-coderay"><div class="CodeRay"> ```python
<div class="code"><pre><span class="keyword">import</span> <span class="include">sqlite3</span> import sqlite3
<span class="keyword">from</span> <span class="include">matplotlib</span> <span class="keyword">import</span> <span class="include">dates</span> from matplotlib import dates
<span class="keyword">import</span> <span class="include">matplotlib.pyplot</span> <span class="keyword">as</span> plt import matplotlib.pyplot as plt
<span class="keyword">import</span> <span class="include">homeassistant.util.dt</span> <span class="keyword">as</span> dt import homeassistant.util.dt as dt
values = [] values = []
timestamps = [] timestamps = []
conn = sqlite3.connect(<span class="string"><span class="delimiter">'</span><span class="content">/home/ha/.homeassistant/home-assistant_v2.db</span><span class="delimiter">'</span></span>) conn = sqlite3.connect('/home/ha/.homeassistant/home-assistant_v2.db')
data = conn.execute(<span class="string"><span class="delimiter">&quot;</span><span class="content">SELECT state, last_changed FROM states WHERE </span><span class="delimiter">&quot;</span></span> data = conn.execute("SELECT state, last_changed FROM states WHERE "
<span class="string"><span class="delimiter">&quot;</span><span class="content">entity_id = 'sensor.aare' AND last_changed BETWEEN </span><span class="delimiter">&quot;</span></span> "entity_id = 'sensor.aare' AND last_changed BETWEEN "
<span class="string"><span class="delimiter">&quot;</span><span class="content">'2016-07-05 00:00:00.000000' AND </span><span class="delimiter">&quot;</span></span> "'2016-07-05 00:00:00.000000' AND "
<span class="string"><span class="delimiter">&quot;</span><span class="content">'2016-07-07 00:00:00.000000'</span><span class="delimiter">&quot;</span></span>) "'2016-07-07 00:00:00.000000'")
<span class="keyword">for</span> x <span class="keyword">in</span> data: for x in data:
timestamps.append(dates.date2num(dt.parse_datetime(x[<span class="integer">1</span>]))) timestamps.append(dates.date2num(dt.parse_datetime(x[1])))
values.append(<span class="predefined">float</span>(x[<span class="integer">0</span>])) values.append(float(x[0]))
plt.plot_date(x=timestamps, y=values, fmt=<span class="string"><span class="delimiter">&quot;</span><span class="content">r-</span><span class="delimiter">&quot;</span></span>) plt.plot_date(x=timestamps, y=values, fmt="r-")
plt.ylabel(<span class="string"><span class="delimiter">'</span><span class="content">Temperature</span><span class="delimiter">'</span></span>) plt.ylabel('Temperature')
plt.xlabel(<span class="string"><span class="delimiter">'</span><span class="content">Time line</span><span class="delimiter">'</span></span>) plt.xlabel('Time line')
plt.savefig(<span class="string"><span class="delimiter">'</span><span class="content">sensor.png</span><span class="delimiter">'</span></span>) plt.savefig('sensor.png')
</pre></div> ```
</div>
</div>
<p>Creating a connection to the database and executing a query is similar to the ways already seen. The return values from the query are splitted into two lists. The time stamps must be converted in an value which is accepted by matplotlib and then the graph is generated and saved as image.</p> Creating a connection to the database and executing a query is similar to the ways already seen. The return values from the query are splitted into two lists. The time stamps must be converted in an value which is accepted by matplotlib and then the graph is generated and saved as image.
<p class="img"> <p class='img'>
<img src="https://home-assistant.io/images/blog/2016-07-reporting/mpl-sensor.png" /> <img src='https://home-assistant.io/images/blog/2016-07-reporting/mpl-sensor.png' />
Sensor graph generated by matplotlib Sensor graph generated by matplotlib
</p> </p>
<p>Most of the graphs are pretty ugly. So, further beautification will be needed. If you have created a nice report including some amazing graphs then the Home Assistant community would be grateful for sharing them in our <a href="https://community.home-assistant.io/">forum</a>.</p> Most of the graphs are pretty ugly. So, further beautification will be needed. If you have created a nice report including some amazing graphs then the Home Assistant community would be grateful for sharing them in our [forum](https://community.home-assistant.io/).
]]></content> ]]></content>
</entry> </entry>

View file

@ -401,7 +401,7 @@
</time> </time>
</div> </div>
<div class="grid__item four-fifths palm-one-whole"> <div class="grid__item four-fifths palm-one-whole">
<h1 class="gamma"><a href="/blog/2016/02/09/smarter-smart-things-with-mqtt-and-home-assistant/">Smarter SmartThings with MQTT and Home Assistant</a></h1> <h1 class="gamma"><a href="/blog/2016/02/09/Smarter-Smart-Things-with-MQTT-and-Home-Assistant/">Smarter SmartThings with MQTT and Home Assistant</a></h1>
<footer class="meta"> <footer class="meta">
<span> <span>
@ -729,7 +729,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: iBeacons | Home Assistant]]></title> <title><![CDATA[Category: iBeacons | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/ibeacons/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/ibeacons/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2016-08-22T07:26:42+00:00</updated> <updated>2016-08-22T08:20:27+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>
@ -18,153 +18,152 @@
<link href="https://home-assistant.io/blog/2016/05/26/ibeacons-how-to-track-things-that-cant-track-themselves-part-ii/"/> <link href="https://home-assistant.io/blog/2016/05/26/ibeacons-how-to-track-things-that-cant-track-themselves-part-ii/"/>
<updated>2016-05-26T11:06:12+00:00</updated> <updated>2016-05-26T11:06:12+00:00</updated>
<id>https://home-assistant.io/blog/2016/05/26/ibeacons-how-to-track-things-that-cant-track-themselves-part-ii</id> <id>https://home-assistant.io/blog/2016/05/26/ibeacons-how-to-track-things-that-cant-track-themselves-part-ii</id>
<content type="html"><![CDATA[<p><em>This post is by Home Assistant contributor <a href="https://github.com/pavoni">Greg Dowling</a>.</em></p> <content type="html"><![CDATA[_This post is by Home Assistant contributor [Greg Dowling](https://github.com/pavoni)._
<p>In <a href="/blog/2016/04/30/ibeacons-part-1-making-presence-detection-work-better">Part 1</a> I talked about using iBeacons to improve presence tracking. In part 2 Ill talk about how to track things like keys that cant track themselves by using iBeacons.</p>
<h3><a class='title-link' name='tracking-things-using-ibeacons' href='#tracking-things-using-ibeacons'></a> Tracking things using iBeacons </h3> In [Part 1](/blog/2016/04/30/ibeacons-part-1-making-presence-detection-work-better) I talked about using iBeacons to improve presence tracking. In part 2 Ill talk about how to track things like keys that cant track themselves by using iBeacons.
<p>In the first part I mentioned that iBeacons just send out <em>Im here</em> packets, and we used this to trigger an update when your phone came close to a fixed beacon.</p>
<p>But beacons dont have to be fixed.</p> ### <a class='title-link' name='tracking-things-using-ibeacons' href='#tracking-things-using-ibeacons'></a> Tracking things using iBeacons
In the first part I mentioned that iBeacons just send out *Im here* packets, and we used this to trigger an update when your phone came close to a fixed beacon.
<p>Your phone knows roughly where it is located (based on mobile phone masts, Wi-Fi networks or GPS). If your phone sees an <em>Im here</em> message then it knows the beacon is close.</p> But beacons dont have to be fixed.
<p>If your phone can remember (or tell a server) where it was when it last saw the iBeacon - then it knows where the beacon was. So the result of this is that you can track where an iBeacon was - even though the iBeacon doesnt have any tracking technology itself.</p> Your phone knows roughly where it is located (based on mobile phone masts, Wi-Fi networks or GPS). If your phone sees an *Im here* message then it knows the beacon is close.
<p>So if you put an iBeacon on your keys or in your car - then you can track them.</p> If your phone can remember (or tell a server) where it was when it last saw the iBeacon - then it knows where the beacon was. So the result of this is that you can track where an iBeacon was - even though the iBeacon doesn't have any tracking technology itself.
<p class="img"> So if you put an iBeacon on your keys or in your car - then you can track them.
<img width="200" src="https://home-assistant.io/images/blog/2016-05-ibeacons/keys_with_beacon.jpg" />
<p class='img'>
<img width='200' src='https://home-assistant.io/images/blog/2016-05-ibeacons/keys_with_beacon.jpg'>
Here are my keys - with a Estimote Nearable iBeacon stuck to them. Ugly but effective! Here are my keys - with a Estimote Nearable iBeacon stuck to them. Ugly but effective!
</p> </p>
<!--more--> <!--more-->
<p>Its easier to set up OwnTracks and HA to track a mobile beacon than the fixed beacon I discussed in Part 1, because you only need to tell OwnTracks about your iBeacon. You dont need to configure HA at all.</p> Its easier to set up OwnTracks and HA to track a mobile beacon than the fixed beacon I discussed in Part 1, because you only need to tell OwnTracks about your iBeacon. You dont need to configure HA at all.
<p class="note warning">OwnTracks currently only supports mobile beacons on iOS.</p> <p class='note warning'>OwnTracks currently only supports mobile beacons on iOS.</p>
<p>You set up the beacon the same way as we discussed in part 1. The only difference is that instead of calling the region the name of a location (eg -drive) you call it the name of the device you want to track (eg -keys). Remember the leading - that makes the connection more reliable.</p> You set up the beacon the same way as we discussed in part 1. The only difference is that instead of calling the region the name of a location (eg -drive) you call it the name of the device you want to track (eg -keys). Remember the leading - that makes the connection more reliable.
<p class="img"> <p class='img'>
<img width="200" src="https://home-assistant.io/images/blog/2016-04-ibeacons/owntracks_beacon_setup.png" /> <img width='200' src='https://home-assistant.io/images/blog/2016-04-ibeacons/owntracks_beacon_setup.png'>
</p> </p>
<p>Once youve added the iBeacon - you should be able to see it on the OwnTracks region screen. If your phone can see the packets from that beacon, OwnTracks will turn the relevant Region red.</p> Once youve added the iBeacon - you should be able to see it on the OwnTracks region screen. If your phone can see the packets from that beacon, OwnTracks will turn the relevant Region red.
<p>Because you turned <em>Share</em> on for the region, when OwnTracks sees the beacon it will send HA a message. HA will use this message to add the beacon as a tracked device if it hasnt seen it before. So you should see a new device appear in HA called device_tracker.beacon_[name] - and its location will be where your phone thought it was when it last saw the beacon.</p> Because you turned *Share* on for the region, when OwnTracks sees the beacon it will send HA a message. HA will use this message to add the beacon as a tracked device if it hasnt seen it before. So you should see a new device appear in HA called device_tracker.beacon_[name] - and its location will be where your phone thought it was when it last saw the beacon.
<p class="img"> <p class='img'>
<img width="200" src="https://home-assistant.io/images/blog/2016-05-ibeacons/keys_device.png" /> <img width='200' src='https://home-assistant.io/images/blog/2016-05-ibeacons/keys_device.png'>
</p> </p>
<p>If your phone moves and sends HA a new location while it is still in range of the beacon - HA will update the location of the beacon. So if go for a drive in your car - you will see both your phone and the <em>device_tracker.beacon_car</em> move together.</p> If your phone moves and sends HA a new location while it is still in range of the beacon - HA will update the location of the beacon. So if go for a drive in your car - you will see both your phone and the *device_tracker.beacon_car* move together.
<p>If you park your car and go shopping - <em>device_tracker.beacon_car</em> will stop moving.</p> If you park your car and go shopping - *device_tracker.beacon_car* will stop moving.
<p>With the basic tracking working - you can use automation to do things like open your gates if your car comes home</p> With the basic tracking working - you can use automation to do things like open your gates if your car comes home
<div class="highlighter-coderay"><div class="CodeRay"> ```yaml
<div class="code"><pre><span class="key">automation</span>: automation:
- <span class="string"><span class="content">alias: 'Open gate'</span></span> - alias: 'Open gate'
<span class="key">trigger</span>: trigger:
- <span class="string"><span class="content">platform: state</span></span> - platform: state
<span class="key">entity_id</span>: <span class="string"><span class="content">device_tracker.beacon_car</span></span> entity_id: device_tracker.beacon_car
<span class="key">from</span>: <span class="string"><span class="content">'not_home'</span></span> from: 'not_home'
<span class="key">to</span>: <span class="string"><span class="content">'home'</span></span> to: 'home'
<span class="key">condition</span>: condition:
- <span class="string"><span class="content">condition: state</span></span> - condition: state
<span class="key">entity_id</span>: <span class="string"><span class="content">switch.gate</span></span> entity_id: switch.gate
<span class="key">state</span>: <span class="string"><span class="content">'off'</span></span> state: 'off'
<span class="key">action</span>: action:
<span class="key">service</span>: <span class="string"><span class="content">switch.turn_on</span></span> service: switch.turn_on
<span class="key">entity_id</span>: <span class="string"><span class="content">switch.gate</span></span> entity_id: switch.gate
</pre></div> ```
</div>
</div>
<p>Or warn you if you leave your keys behind</p> Or warn you if you leave your keys behind
<div class="highlighter-coderay"><div class="CodeRay"> ```yaml
<div class="code"><pre><span class="key">automation</span>: automation:
- <span class="string"><span class="content">alias: 'Forgotten keys'</span></span> - alias: 'Forgotten keys'
<span class="key">trigger</span>: trigger:
<span class="key">platform</span>: <span class="string"><span class="content">template</span></span> platform: template
<span class="key">value_template</span>: <span class="string"><span class="content">'{{states.device_tracker.greg_gregphone.state != states.device_tracker.beacon_keys.state}}'</span></span> value_template: '{{ states.device_tracker.greg_gregphone.state != states.device_tracker.beacon_keys.state}}'
<span class="key">condition</span>: condition:
<span class="key">condition</span>: <span class="string"><span class="content">template</span></span> condition: template
<span class="key">value_template</span>: <span class="string"><span class="content">'{{ states.device_tracker.greg_gregphone.state != &quot;home&quot; }}'</span></span> value_template: '{{ states.device_tracker.greg_gregphone.state != "home" }}'
<span class="key">action</span>: action:
<span class="key">service</span>: <span class="string"><span class="content">script.turn_on</span></span> service: script.turn_on
<span class="key">entity_id</span>: <span class="string"><span class="content">script.send_key_alert</span></span> entity_id: script.send_key_alert
- <span class="string"><span class="content">alias: 'Forgotten keys - cancel'</span></span> - alias: 'Forgotten keys - cancel'
<span class="key">trigger</span>: trigger:
<span class="key">platform</span>: <span class="string"><span class="content">template</span></span> platform: template
<span class="key">value_template</span>: <span class="string"><span class="content">'{{states.device_tracker.greg_gregphone.state == states.device_tracker.beacon_keys.state}}'</span></span> value_template: '{{ states.device_tracker.greg_gregphone.state == states.device_tracker.beacon_keys.state }}'
<span class="key">condition</span>: condition:
- <span class="string"><span class="content">condition: state</span></span> - condition: state
<span class="key">entity_id</span>: <span class="string"><span class="content">script.send_key_alert</span></span> entity_id: script.send_key_alert
<span class="key">state</span>: <span class="string"><span class="content">'on'</span></span> state: 'on'
<span class="key">action</span>: action:
<span class="key">service</span>: <span class="string"><span class="content">script.turn_off</span></span> service: script.turn_off
<span class="key">entity_id</span>: <span class="string"><span class="content">script.send_key_alert</span></span> entity_id: script.send_key_alert
</pre></div> ```
</div>
</div>
<div class="highlighter-coderay"><div class="CodeRay"> ```yaml
<div class="code"><pre><span class="key">script</span>: script:
<span class="key">send_key_alert</span>: send_key_alert:
<span class="key">sequence</span>: sequence:
- <span class="string"><span class="content">delay:</span><span class="content"> - delay:
minutes: 2</span></span> minutes: 2
- <span class="string"><span class="content">service: notify.notify</span></span> - service: notify.notify
<span class="key">data</span>: data:
<span class="key">message</span>: <span class="string"><span class="content">'You forgot your keys'</span></span> message: 'You forgot your keys'
<span class="key">target</span>: <span class="string"><span class="content">'device/gregs_iphone'</span></span> target: 'device/gregs_iphone'
</pre></div> ```
</div>
</div>
<p>(The delay is needed for two reasons: -<br />
1. HA updates the beacon and phone locations at slightly different times - so you dont want the automation to trigger in the gap between the updates<br />
2. Ive found that beacons (especially the low power Estimote Nearables) can get disconnected for a few seconds so its best to wait a minute or so before deciding that youve left your keys behind)</p>
<h3><a class='title-link' name='using-both-types-of-ibeacons-at-the-same-time' href='#using-both-types-of-ibeacons-at-the-same-time'></a> Using both types of iBeacons at the same time </h3> (The delay is needed for two reasons: -
<p>Of course you can use both fixed and mobile beacons at the same time. I want my gates to open when I arrive home in the car - so I use an iBeacon in the car so that I can track the car, and a iBeacon on my drive so that a location update is triggered when I arrive. Ive been experimenting with a high power beacon in a waterproof box on my drive which seems to work well to notice when I get home.</p> 1. HA updates the beacon and phone locations at slightly different times - so you dont want the automation to trigger in the gap between the updates
2. Ive found that beacons (especially the low power Estimote Nearables) can get disconnected for a few seconds so its best to wait a minute or so before deciding that youve left your keys behind)
<p class="img">
<img width="300" src="http://bluesensenetworks.com/wp-content/uploads/2015/02/BlueBar-Beacon-Long-Range.jpg" /> ### <a class='title-link' name='using-both-types-of-ibeacons-at-the-same-time' href='#using-both-types-of-ibeacons-at-the-same-time'></a> Using both types of iBeacons at the same time
Of course you can use both fixed and mobile beacons at the same time. I want my gates to open when I arrive home in the car - so I use an iBeacon in the car so that I can track the car, and a iBeacon on my drive so that a location update is triggered when I arrive. I've been experimenting with a high power beacon in a waterproof box on my drive which seems to work well to notice when I get home.
<p class='img'>
<img width='300' src='http://bluesensenetworks.com/wp-content/uploads/2015/02/BlueBar-Beacon-Long-Range.jpg'>
</p> </p>
<p>Long range / High power beacon</p> Long range / High power beacon
<p class="img"> <p class='img'>
<img width="400" src="http://bluesensenetworks.com/wp-content/uploads/2015/02/BlueBar-Beacon-Weatherproof.jpg" /> <img width='400' src='http://bluesensenetworks.com/wp-content/uploads/2015/02/BlueBar-Beacon-Weatherproof.jpg'>
</p> </p>
<p>Waterproof beacon</p> Waterproof beacon
<h3><a class='title-link' name='buying-beacons' href='#buying-beacons'></a> Buying Beacons </h3>
<p>This isnt a buyers guide, but I just wanted to mention the iBeacons Ive been using. I think you should be able to use any iBeacon with HA and OwnTracks. You generally cant buy beacons in your local electronics shop - so I just wanted to briefly mention the two suppliers Ive used so far.</p>
<p>Ive bought quite a few iBeacons from a company called <a href="http://bluesensenetworks.com/">Blue Sense Networks</a>. I work in the tech startup sector in the UK so I partly chose them because they are a local start-up who seemed worth supporting. The products, support and software all seem good. I use a number of their beacons - from a simple USB dongle, to a long range beacon. All their products have batteries that can be changed (or no batteries in the case of the externally powered USB device) - and you can configure all the parameters youd want to using their software. I had one software issue, support got back to me at a weekend(!) - and the issue was resolved with a software release two days later.</p> ### <a class='title-link' name='buying-beacons' href='#buying-beacons'></a> Buying Beacons
This isnt a buyer's guide, but I just wanted to mention the iBeacons Ive been using. I think you should be able to use any iBeacon with HA and OwnTracks. You generally cant buy beacons in your local electronics shop - so I just wanted to briefly mention the two suppliers Ive used so far.
<p>All the beacons seem fine - and the long range unit does work over a longer range than my other beacons.</p> Ive bought quite a few iBeacons from a company called [Blue Sense Networks](http://bluesensenetworks.com/). I work in the tech startup sector in the UK so I partly chose them because they are a local start-up who seemed worth supporting. The products, support and software all seem good. I use a number of their beacons - from a simple USB dongle, to a long range beacon. All their products have batteries that can be changed (or no batteries in the case of the externally powered USB device) - and you can configure all the parameters youd want to using their software. I had one software issue, support got back to me at a weekend(!) - and the issue was resolved with a software release two days later.
<p>I bought some other beacons from a US/Polish startup called <a href="http://estimote.com/">Estimote</a>, who I think are better known. I bought a developer pack of 10 of their <em>nearables</em> which as well as being iBeacons also send out other data (orientation and motion) using their own protocol. This is interesting if youre developing your own application, but for OwnTracks and HA they are just regular beacons. They are small and self adhesive - so you can stick them to things (like your keys). You cant change all the parameters on these devices (UUID/Major/Minor are fixed) - and the batteries cant be replaced. I also killed one of the estimote beacons (I assume the battery died) after I carried it around for a few months and dropped it many times! On the other hand they are well priced, small and waterproof!</p> All the beacons seem fine - and the long range unit does work over a longer range than my other beacons.
<p>Ive mainly used these as <em>devices to track</em> rather that <em>location</em> beacons. Estimote also sell some slightly larger iBeacons with replaceable batteries. Estimote support responded quickly and were helpful when I couldnt work out how to edit their beacons parameters (although the answer was <em>you cant yet</em>).</p> I bought some other beacons from a US/Polish startup called [Estimote](http://estimote.com/), who I think are better known. I bought a developer pack of 10 of their *nearables* which as well as being iBeacons also send out other data (orientation and motion) using their own protocol. This is interesting if youre developing your own application, but for OwnTracks and HA they are just regular beacons. They are small and self adhesive - so you can stick them to things (like your keys). You cant change all the parameters on these devices (UUID/Major/Minor are fixed) - and the batteries cant be replaced. I also killed one of the estimote beacons (I assume the battery died) after I carried it around for a few months and dropped it many times! On the other hand they are well priced, small and waterproof!
<p>The larger Blue Sense Network beacons seem to be better at maintaining a connection that the Estimotes - although that might be because Im reluctant to turn the power to maximum and reduce the gap between sending packets on the Estimotes where I cant replace the batteries!</p> Ive mainly used these as *devices to track* rather that *location* beacons. Estimote also sell some slightly larger iBeacons with replaceable batteries. Estimote support responded quickly and were helpful when I couldnt work out how to edit their beacons parameters (although the answer was *you cant yet*).
<h3><a class='title-link' name='conclusion' href='#conclusion'></a> Conclusion </h3> The larger Blue Sense Network beacons seem to be better at maintaining a connection that the Estimotes - although that might be because Im reluctant to turn the power to maximum and reduce the gap between sending packets on the Estimotes where I cant replace the batteries!
<p>As I said in <a href="/blog/2016/04/30/ibeacons-part-1-making-presence-detection-work-better">part 1</a>, Ive found iBeacons to be a good way of improving presence detection. I also used them to track devices like my car and my keys that cant track themselves.</p>
<p>Im still experimenting, so I hope I can do more with iBeacons. I hope Ive encouraged you do so the same. If you do please share your experiences.</p> ### <a class='title-link' name='conclusion' href='#conclusion'></a> Conclusion
As I said in [part 1](/blog/2016/04/30/ibeacons-part-1-making-presence-detection-work-better), Ive found iBeacons to be a good way of improving presence detection. I also used them to track devices like my car and my keys that cant track themselves.
<h3><a class='title-link' name='notes' href='#notes'></a> Notes </h3> I'm still experimenting, so I hope I can do more with iBeacons. I hope I've encouraged you do so the same. If you do please share your experiences.
### <a class='title-link' name='notes' href='#notes'></a> Notes
Please see the [notes at the end of Part 1](/blog/2016/04/30/ibeacons-part-1-making-presence-detection-work-better/#tips) for documentation information.
<p>Please see the <a href="/blog/2016/04/30/ibeacons-part-1-making-presence-detection-work-better/#tips">notes at the end of Part 1</a> for documentation information.</p>
]]></content> ]]></content>
</entry> </entry>
@ -174,137 +173,134 @@
<link href="https://home-assistant.io/blog/2016/04/30/ibeacons-part-1-making-presence-detection-work-better/"/> <link href="https://home-assistant.io/blog/2016/04/30/ibeacons-part-1-making-presence-detection-work-better/"/>
<updated>2016-04-30T06:50:09+00:00</updated> <updated>2016-04-30T06:50:09+00:00</updated>
<id>https://home-assistant.io/blog/2016/04/30/ibeacons-part-1-making-presence-detection-work-better</id> <id>https://home-assistant.io/blog/2016/04/30/ibeacons-part-1-making-presence-detection-work-better</id>
<content type="html"><![CDATA[<p><em>This post is by Home Assistant contributor <a href="https://github.com/pavoni">Greg Dowling</a>.</em></p> <content type="html"><![CDATA[_This post is by Home Assistant contributor [Greg Dowling](https://github.com/pavoni)._
<p>In 2013 Apple introduced iBeacons: a class of Bluetooth low energy (LE) devices that broadcast their identifier to nearby devices, including most smartphones. At first glance its hard to imagine why they might be useful. In this two part blog Ill try and explain why they are useful and how you can use them with Home Assistant.</p> In 2013 Apple introduced iBeacons: a class of Bluetooth low energy (LE) devices that broadcast their identifier to nearby devices, including most smartphones. At first glance its hard to imagine why they might be useful. In this two part blog Ill try and explain why they are useful and how you can use them with Home Assistant.
<p>The reason I started using iBeacons was to improve presence detection (and I think thats the case with most people) so thats what Ill discuss in <em>part 1</em>. In <em>part 2</em> Ill talk about using iBeacons to track devices that cant track themselves.</p> The reason I started using iBeacons was to improve presence detection (and I think thats the case with most people) so that's what Ill discuss in _part 1_. In _part 2_ Ill talk about using iBeacons to track devices that cant track themselves.
<h3><a class='title-link' name='using-beacons-to-improve-owntracks-location-data' href='#using-beacons-to-improve-owntracks-location-data'></a> Using beacons to improve OwnTracks location data </h3> ### <a class='title-link' name='using-beacons-to-improve-owntracks-location-data' href='#using-beacons-to-improve-owntracks-location-data'></a> Using beacons to improve OwnTracks location data
<p>When you use OwnTracks in standard <em>major move</em> mode (which is kind to your phone battery) it sometimes fails to update when youd like it to. In my case I found that it would often send a location update as I was on my way home, but then not update when I got home. The result would be that Home Assistant would think I was 500M away from home, and take quite a while to notice I was home. It would also mean that the automation that should turn on my lights when I got home didnt work very well! There were a few times when my phone location updated at 2am and turned the lights on for me. Fortunately my wife is very patient!</p> When you use OwnTracks in standard _major move_ mode (which is kind to your phone battery) it sometimes fails to update when youd like it to. In my case I found that it would often send a location update as I was on my way home, but then not update when I got home. The result would be that Home Assistant would think I was 500M away from home, and take quite a while to notice I was home. It would also mean that the automation that should turn on my lights when I got home didnt work very well! There were a few times when my phone location updated at 2am and turned the lights on for me. Fortunately my wife is very patient!
<p>Luckily, OwnTracks supports iBeacons so I could use them to make presence detection more reliable. When OwnTracks sees a beacon it recognises, it will send an update. This means that if you put a beacon at your front door - OwnTracks will see it within a few seconds of you arriving home - and send an update saying it has seen this iBeacon.</p> Luckily, OwnTracks supports iBeacons so I could use them to make presence detection more reliable. When OwnTracks sees a beacon it recognises, it will send an update. This means that if you put a beacon at your front door - OwnTracks will see it within a few seconds of you arriving home - and send an update saying it has seen this iBeacon.
<!--more--> <!--more-->
<h3><a class='title-link' name='getting-started' href='#getting-started'></a> Getting Started </h3> ### <a class='title-link' name='getting-started' href='#getting-started'></a> Getting Started
<p>To do this you first need to set up <a href="/components/mqtt/#picking-a-broker">MQTT</a> and <a href="/components/device_tracker.owntracks/">OwnTracks</a> in Home assistant - and make sure that HA can track your phone.</p> To do this you first need to set up [MQTT] and [OwnTracks] in Home assistant - and make sure that HA can track your phone.
<p>You then have to (A) tell Home Assistant where the beacon is located and (B) tell OwnTracks to recognise the beacon.</p> [MQTT]: /components/mqtt/#picking-a-broker
[OwnTracks]: /components/device_tracker.owntracks/
<h4><a class='title-link' name='a-tell-home-assistant-where-your-beacon-is-located' href='#a-tell-home-assistant-where-your-beacon-is-located'></a> A. Tell Home Assistant where your beacon is located </h4> You then have to (A) tell Home Assistant where the beacon is located and (B) tell OwnTracks to recognise the beacon.
<p>You tell HomeAssistant about fixed locations by creating a Zone with the longitude and latitude of your beacon. You should also give the zone a name which you will also use when you set up OwnTracks. An an example this zone specifies the location of my drive way.</p> #### <a class='title-link' name='a-tell-home-assistant-where-your-beacon-is-located' href='#a-tell-home-assistant-where-your-beacon-is-located'></a> A. Tell Home Assistant where your beacon is located
<p><strong>Example <code>configuration.yaml</code> entry</strong></p> You tell HomeAssistant about fixed locations by creating a Zone with the longitude and latitude of your beacon. You should also give the zone a name which you will also use when you set up OwnTracks. An an example this zone specifies the location of my drive way.
<div class="highlighter-coderay"><div class="CodeRay"> **Example `configuration.yaml` entry**
<div class="code"><pre>
<span class="key">zone</span>:
- <span class="string"><span class="content">name: 'Drive'</span></span>
<span class="key">latitude</span>: <span class="string"><span class="content">XXX</span></span>
<span class="key">longitude</span>: <span class="string"><span class="content">YYY</span></span>
<span class="key">radius</span>: <span class="string"><span class="content">100</span></span>
</pre></div>
</div>
</div>
<p>The radius isnt used by the beacon code, but it is used by the GPS location sensing code. Ill come back to this a little later. For now just use 50 or 100.</p> ````yaml
<p>Once youve created the zone - you need to restart HA. The next step is:-</p> zone:
- name: 'Drive'
latitude: XXX
longitude: YYY
radius: 100
````
<h4><a class='title-link' name='b-tell-owntracks-to-track--your-beacon' href='#b-tell-owntracks-to-track--your-beacon'></a> B. Tell OwnTracks to track your beacon </h4> The radius isnt used by the beacon code, but it is used by the GPS location sensing code. Ill come back to this a little later. For now just use 50 or 100.
<ol> Once youve created the zone - you need to restart HA. The next step is:-
<li>Go to the OwnTracks app on your phone</li>
<li>Touch the <code>Regions</code> menu at the bottom of the screen</li>
<li>Touch the <code>+</code> symbol at the top right of the screen</li>
<li>Give the beacon a name e.g. <code>-drive</code> (start the name with a <code>-</code> see below for the reason)</li>
<li>Turn Share to <code>On</code></li>
<li>Skip the <code>Circular Region</code> section</li>
<li>Enter the <code>UUID</code> of your beacon - this may be written on your beacon - or you can copy it from the management app that came with your iBeacon device. Its a long number so its easier to copy if you can!</li>
<li>Enter the <code>Minor</code> and <code>Major</code> numbers for your iBeacon - or leave them at 0 which will match all beacons with that <code>UUID</code></li>
</ol>
<p class="img"> #### <a class='title-link' name='b-tell-owntracks-to-track--your-beacon' href='#b-tell-owntracks-to-track--your-beacon'></a> B. Tell OwnTracks to track your beacon
<img width="200" border="2" src="https://home-assistant.io/images/blog/2016-04-ibeacons/owntracks_beacon_setup.png" />
1. Go to the OwnTracks app on your phone
2. Touch the `Regions` menu at the bottom of the screen
3. Touch the `+` symbol at the top right of the screen
4. Give the beacon a name e.g. `-drive` (start the name with a `-` see below for the reason)
5. Turn Share to `On`
6. Skip the `Circular Region` section
7. Enter the `UUID` of your beacon - this may be written on your beacon - or you can copy it from the management app that came with your iBeacon device. Its a long number so its easier to copy if you can!
8. Enter the `Minor` and `Major` numbers for your iBeacon - or leave them at 0 which will match all beacons with that `UUID`
<p class='img'>
<img width='200' border='2' src='https://home-assistant.io/images/blog/2016-04-ibeacons/owntracks_beacon_setup.png'>
</p> </p>
<p>Once youve added the iBeacon - you should be able to see it on the OwnTracks region screen. If your phone can see the packets from that beacon, OwnTracks will turn the relevant Region red.</p> Once youve added the iBeacon - you should be able to see it on the OwnTracks region screen. If your phone can see the packets from that beacon, OwnTracks will turn the relevant Region red.
<p class="img"> <p class='img'>
<img width="200" src="https://home-assistant.io/images/blog/2016-04-ibeacons/owntracks_red_beacon.png" /> <img width='200' src='https://home-assistant.io/images/blog/2016-04-ibeacons/owntracks_red_beacon.png'>
</p> </p>
<p>When OwnTracks sees the beacon (and turns the region red), it also sends an MQTT packet to HA to say that you have entered that region.</p> When OwnTracks sees the beacon (and turns the region red), it also sends an MQTT packet to HA to say that you have entered that region.
<p>The result of the configuration above would be to set the location of device.phone to <code>Drive</code> , (and the GPS location to XXX,YYY) when your phone sees the beacon.</p> The result of the configuration above would be to set the location of device.phone to `Drive` , (and the GPS location to XXX,YYY) when your phone sees the beacon.
<p>So with the steps above you should be able to improve the reliability of tracking your phone - and send timely updates to HA. I did this for my home - and the lights now turn on before I reach the house on foot. If I arrive by car they turn on within a few seconds of arriving, before I can get to the front door.</p> So with the steps above you should be able to improve the reliability of tracking your phone - and send timely updates to HA. I did this for my home - and the lights now turn on before I reach the house on foot. If I arrive by car they turn on within a few seconds of arriving, before I can get to the front door.
<p>Im also pleased to say I no longer get an <em>arrive home</em> event at 2am that turns the lights on. I hope Ive convinced you that iBeacons are worth trying!</p> Im also pleased to say I no longer get an _arrive home_ event at 2am that turns the lights on. I hope Ive convinced you that iBeacons are worth trying!
<h3><a class='title-link' name='mixing-beacons-and-gps-locations' href='#mixing-beacons-and-gps-locations'></a> Mixing Beacons and GPS locations </h3> ### <a class='title-link' name='mixing-beacons-and-gps-locations' href='#mixing-beacons-and-gps-locations'></a> Mixing Beacons and GPS locations
<p>You will probably use beacons to make entry into your existing GPS zones more reliable. By default either a beacon or a GPS location can cause you to enter a zone - and HA has some logic that should make them two work well together (it ignores GPS updates when youre in an iBeacon Zone).</p> You will probably use beacons to make entry into your existing GPS zones more reliable. By default either a beacon or a GPS location can cause you to enter a zone - and HA has some logic that should make them two work well together (it ignores GPS updates when youre in an iBeacon Zone).
<p>However you can also use beacons for situations where GPS doesnt work well.</p> However you can also use beacons for situations where GPS doesnt work well.
<p>This might be because the zones are too close together - or even on top of each other!<br /> This might be because the zones are too close together - or even on top of each other!
For example, my wife works next door - and I couldnt detect whether shes at home or in the office via GPS because the accuracy wasnt high enough. However I can do this by using two beacons.</p> For example, my wife works next door - and I couldnt detect whether shes at home or in the office via GPS because the accuracy wasnt high enough. However I can do this by using two beacons.
<p>To make this type of presence detection work you need to turn GPS off for a zone in Home Assistant by making them <code>passive</code>. This is important because otherwise HA will try to decide between two close together zones without enough data. This doesnt work well.</p> To make this type of presence detection work you need to turn GPS off for a zone in Home Assistant by making them `passive`. This is important because otherwise HA will try to decide between two close together zones without enough data. This doesnt work well.
<p>A passive zone can only be entered via an iBeacon, so a GPS location update will always pick the other zone.</p> A passive zone can only be entered via an iBeacon, so a GPS location update will always pick the other zone.
<p>I set up my Home zone to be a standard region, and my office zone to be passive, so the home zone can be entered in the normal way via either GPS or a Beacon.</p> I set up my Home zone to be a standard region, and my office zone to be passive, so the home zone can be entered in the normal way via either GPS or a Beacon.
<p><strong>Example <code>configuration.yaml</code> entry</strong></p> **Example `configuration.yaml` entry**
<div class="highlighter-coderay"><div class="CodeRay"> ````yaml
<div class="code"><pre>
<span class="key">zone</span>:
- <span class="string"><span class="content">name: 'Office'</span></span>
<span class="key">latitude</span>: <span class="string"><span class="content">XXX</span></span>
<span class="key">longitude</span>: <span class="string"><span class="content">YYY</span></span>
<span class="key">radius</span>: <span class="string"><span class="content">3</span></span>
<span class="key">passive</span>: <span class="string"><span class="content">true</span></span>
</pre></div>
</div>
</div>
<p>You could use this technique to try to detect which room someone is in. This might allow you to notice whether someone is in the living room or the bedroom - even though one is above the other (although beacon packets do pass through walls and floors).</p> zone:
- name: 'Office'
latitude: XXX
longitude: YYY
radius: 3
passive: true
````
<p>To get this to work youll probably need to experiment with the beacon signal strength to try to match the beacon reception area to the location you want to track. Let me know if you get this to work (it doesnt make sense in my open plan house)</p> You could use this technique to try to detect which room someone is in. This might allow you to notice whether someone is in the living room or the bedroom - even though one is above the other (although beacon packets do pass through walls and floors).
<h3><a class='title-link' name='conclusion' href='#conclusion'></a> Conclusion </h3> To get this to work youll probably need to experiment with the beacon signal strength to try to match the beacon reception area to the location you want to track. Let me know if you get this to work (it doesnt make sense in my open plan house)
<p>Presence tracking sounds easy - and its an important part of Home Automation. Trying it shows how difficult it is to get presence detection right. Ive found that iBeacons have improved the reliability and timeliness of knowing where I am, and I hope I encouraged you to try them too.</p> ### <a class='title-link' name='conclusion' href='#conclusion'></a> Conclusion
<h3><a class='title-link' name='tips' href='#tips'></a> Tips </h3> Presence tracking sounds easy - and it's an important part of Home Automation. Trying it shows how difficult it is to get presence detection right. I've found that iBeacons have improved the reliability and timeliness of knowing where I am, and I hope I encouraged you to try them too.
<p>You can find out more about configuring the OwnTracks application and beacons <a href="http://owntracks.org/booklet/features/beacons/">here</a></p> ### <a class='title-link' name='tips' href='#tips'></a> Tips
<p>There is information about configuring Homeassistant to use beacons <a href="https://home-assistant.io/components/device_tracker.owntracks/">here</a></p> You can find out more about configuring the OwnTracks application and beacons [here](http://owntracks.org/booklet/features/beacons/)
<h4><a class='title-link' name='connections-and-disconnecting' href='#connections-and-disconnecting'></a> Connections and disconnecting </h4> There is information about configuring Homeassistant to use beacons [here](https://home-assistant.io/components/device_tracker.owntracks/)
<p>Owntracks treats a region name with a leading <code>-</code> as a hint that it shouldnt disconnect after a single missed packet. This improves the ability to keep a connection to a beacon.</p> #### <a class='title-link' name='connections-and-disconnecting' href='#connections-and-disconnecting'></a> Connections and disconnecting
<p>However, even when using this feature Ive noticed that you can still lose connections (although it seems to vary by beacon manufacturer and type - Ill talk more about this in <em>part 2</em>). This means that its best to take into account that you may see false enter/leave events in HA. You may be able to improve this by changing how often the beacons send packets - and by increasing the signal strength (both will drain your beacon batteries more quickly). You can usually change these parameters in the app supplied by the iBeacon maker. You can also find some high power beacons (which have worked well for me).</p> Owntracks treats a region name with a leading `-` as a hint that it shouldn't disconnect after a single missed packet. This improves the ability to keep a connection to a beacon.
<p>In automations you can use a <code>for:</code> to avoid triggering during a brief disconnect, or use a script with a delay. Stay tuned for <em>part 2</em> for an example of this.</p> However, even when using this feature Ive noticed that you can still lose connections (although it seems to vary by beacon manufacturer and type - Ill talk more about this in _part 2_). This means that it's best to take into account that you may see false enter/leave events in HA. You may be able to improve this by changing how often the beacons send packets - and by increasing the signal strength (both will drain your beacon batteries more quickly). You can usually change these parameters in the app supplied by the iBeacon maker. You can also find some high power beacons (which have worked well for me).
<h4><a class='title-link' name='using-multiple-beacons-for-the-same-zone' href='#using-multiple-beacons-for-the-same-zone'></a> Using Multiple beacons for the same Zone </h4> In automations you can use a `for:` to avoid triggering during a brief disconnect, or use a script with a delay. Stay tuned for _part 2_ for an example of this.
<p>iBeacons have a <code>UUID</code> (usually set to the same value for beacons from the same manufacturer), as well as a <code>minor</code> and <code>major</code> number. If you set two beacons to have exactly same details then OwnTracks will think multiple beacons are at the same location.</p>
<p>This means you can have more than one beacon around your home - and a connection to any of them will count as <code>home</code> to OwnTracks and HA. This reduces disconnections.</p> #### <a class='title-link' name='using-multiple-beacons-for-the-same-zone' href='#using-multiple-beacons-for-the-same-zone'></a> Using Multiple beacons for the same Zone
iBeacons have a `UUID` (usually set to the same value for beacons from the same manufacturer), as well as a `minor` and `major` number. If you set two beacons to have exactly same details then OwnTracks will think multiple beacons are at the same location.
<p>You can achieve the same effect by using the same the same <code>UUID</code> but different <code>major</code> / <code>minor</code> numbers - and tell OwnTracks not to worry about the <code>minor</code> / <code>major</code> numbers for a particular region by setting them to 0).</p> This means you can have more than one beacon around your home - and a connection to any of them will count as `home` to OwnTracks and HA. This reduces disconnections.
<p><em>Make sure to also check out <a href="/blog/2016/05/26/ibeacons-how-to-track-things-that-cant-track-themselves-part-ii/">part II</a> where I talk about how to use iBeacons to track any object.</em></p> You can achieve the same effect by using the same the same `UUID` but different `major` / `minor` numbers - and tell OwnTracks not to worry about the `minor` / `major` numbers for a particular region by setting them to 0).
_Make sure to also check out [part II](/blog/2016/05/26/ibeacons-how-to-track-things-that-cant-track-themselves-part-ii/) where I talk about how to use iBeacons to track any object._
]]></content> ]]></content>
</entry> </entry>

View file

@ -238,7 +238,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Internet-of-Things | Home Assistant]]></title> <title><![CDATA[Category: Internet-of-Things | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/internet-of-things/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/internet-of-things/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2016-08-22T07:26:42+00:00</updated> <updated>2016-08-22T08:20:27+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>
@ -18,18 +18,22 @@
<link href="https://home-assistant.io/blog/2016/04/05/your-hub-should-be-local-and-open/"/> <link href="https://home-assistant.io/blog/2016/04/05/your-hub-should-be-local-and-open/"/>
<updated>2016-04-05T04:11:00+00:00</updated> <updated>2016-04-05T04:11:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/04/05/your-hub-should-be-local-and-open</id> <id>https://home-assistant.io/blog/2016/04/05/your-hub-should-be-local-and-open</id>
<content type="html"><![CDATA[<p>Today the news spread that Google will be <a href="https://medium.com/@arlogilbert/the-time-that-tony-fadell-sold-me-a-container-of-hummus-cb0941c762c1#.rmppks86a">shutting down the Revolv hubs</a>. And shutting down here doesnt mean they stop selling or supporting them - no, they are sending an update to each hub to turn your perfectly fine home automation hub into a useless piece of plastic. The fact that this seemed like a good idea by Google astonishes me. If anything, they should have gone the same route as <a href="https://discuss.ninjablocks.com/t/ninja-blocks-whats-been-happening-whats-happening-next/3608">ninjasphere</a>: open it all up and let people decide on the fate of their <em>own</em> hub.</p> <content type="html"><![CDATA[Today the news spread that Google will be [shutting down the Revolv hubs][medium-revolv]. And shutting down here doesn't mean they stop selling or supporting them - no, they are sending an update to each hub to turn your perfectly fine home automation hub into a useless piece of plastic. The fact that this seemed like a good idea by Google astonishes me. If anything, they should have gone the same route as [ninjasphere]: open it all up and let people decide on the fate of their _own_ hub.
<p>Ive said it <a href="/blog/2016/01/19/perfect-home-automation/#your-system-should-run-at-home-not-in-the-cloud">before</a> but Ill repeat it again:</p> I've said it [before][perfect-cloud] but I'll repeat it again:
<blockquote> <blockquote>
<p>The cloud should be treated as an extension to your smart home instead of running it.</p> The cloud should be treated as an extension to your smart home instead of running it.
</blockquote> </blockquote>
<p>Your hub should not be affected when your internet breaks down or the company that sold you your hub goes out of business. It should work locally so that it can continue to work even long after the vendor goes out of business or decides to kill it. Preferably, your hub should also be open so that the community can take over development after the vendor stops caring.</p> Your hub should not be affected when your internet breaks down or the company that sold you your hub goes out of business. It should work locally so that it can continue to work even long after the vendor goes out of business or decides to kill it. Preferably, your hub should also be open so that the community can take over development after the vendor stops caring.
<p>Unless you can afford losing a product here and there, be cautious when buying IoT products that depend on the cloud from companies that are not well established. The chances are high that they go bankrupt or get acquired and closed. This however is easier said than done as <a href="http://www.gartner.com/newsroom/id/2869521">Gartner</a> predicts that by 2017, 50 percent of IoT solutions will originate in startups that are less than three years old.</p> Unless you can afford losing a product here and there, be cautious when buying IoT products that depend on the cloud from companies that are not well established. The chances are high that they go bankrupt or get acquired and closed. This however is easier said than done as [Gartner] predicts that by 2017, 50 percent of IoT solutions will originate in startups that are less than three years old.
[medium-revolv]: https://medium.com/@arlogilbert/the-time-that-tony-fadell-sold-me-a-container-of-hummus-cb0941c762c1#.rmppks86a
[ninjasphere]: https://discuss.ninjablocks.com/t/ninja-blocks-whats-been-happening-whats-happening-next/3608
[perfect-cloud]: /blog/2016/01/19/perfect-home-automation/#your-system-should-run-at-home-not-in-the-cloud
[Gartner]: http://www.gartner.com/newsroom/id/2869521
]]></content> ]]></content>
</entry> </entry>
@ -38,27 +42,27 @@
<link href="https://home-assistant.io/blog/2016/02/12/classifying-the-internet-of-things/"/> <link href="https://home-assistant.io/blog/2016/02/12/classifying-the-internet-of-things/"/>
<updated>2016-02-12T06:31:00+00:00</updated> <updated>2016-02-12T06:31:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/02/12/classifying-the-internet-of-things</id> <id>https://home-assistant.io/blog/2016/02/12/classifying-the-internet-of-things</id>
<content type="html"><![CDATA[<p>The core of home automation is knowing whats going on. The faster we know about a state change, the better we can serve the user. If you want to have your lights to turn on when you arrive at home, it doesnt help if it only knows about it after youve already opened the door and manually (!!) turned on the light.</p> <content type="html"><![CDATA[The core of home automation is knowing whats going on. The faster we know about a state change, the better we can serve the user. If you want to have your lights to turn on when you arrive at home, it doesnt help if it only knows about it after youve already opened the door and manually (!!) turned on the light.
<p>Each smart device consists of the normal device and the piece that makes it smart: the connectivity. The connectivity part of a device can consists of either control, state or both.</p> Each smart device consists of the normal device and the piece that makes it smart: the connectivity. The connectivity part of a device can consists of either control, state or both.
<p>State describes what a device is up to right now. For example, a light can be on with a red color and a medium brightness.</p> State describes what a device is up to right now. For example, a light can be on with a red color and a medium brightness.
<p>Control is about controlling the smart device by sending commands via an API. These commands can vary from configuring how a device works till mimicking how a user would interact with a device. A media player can allow skipping to the next track and a sensor could allow to configure its sensitivity or polling interval.</p> Control is about controlling the smart device by sending commands via an API. These commands can vary from configuring how a device works till mimicking how a user would interact with a device. A media player can allow skipping to the next track and a sensor could allow to configure its sensitivity or polling interval.
<p>The Home Assistant APIs are setup to be as convenient as possible. However, a network is always as weak as its weakest link. In our case these are the integrations. Take for example controlling a light that does not report state. The only state Home Assistant can report on after sending a command is the assumed state: what do we expect the state of the light to be if the command worked.</p> The Home Assistant APIs are setup to be as convenient as possible. However, a network is always as weak as its weakest link. In our case these are the integrations. Take for example controlling a light that does not report state. The only state Home Assistant can report on after sending a command is the assumed state: what do we expect the state of the light to be if the command worked.
<p>We want our users to get the best home automation experience out there and this starts with making sure they have devices that work well with Home Assistant. Thats why we will start applying the following classifiers to our integrations:</p> We want our users to get the best home automation experience out there and this starts with making sure they have devices that work well with Home Assistant. Thats why we will start applying the following classifiers to our integrations:
<p><a name="classifiers"></a></p> <a name='classifiers'>
<table> <table>
<tr> <tr>
<th colspan="2">Classifier</th> <th colspan='2'>Classifier</th>
<th>Description</th> <th>Description</th>
</tr> </tr>
<tr> <tr>
<td><i class="icon-adjust"></i></td> <td><i class="icon-adjust"></i></td>
<td style="white-space: nowrap;">Assumed State</td> <td style='white-space: nowrap;'>Assumed State</td>
<td> <td>
We are unable to get the state of the device. Best we can do is to assume the state based on our last command. We are unable to get the state of the device. Best we can do is to assume the state based on our last command.
</td> </td>
@ -97,124 +101,101 @@
</tr> </tr>
</table> </table>
<p>The background to how we got to these classifiers can be read after the break.<br /> The background to how we got to these classifiers can be read after the break.
<!--more--></p> <!--more-->
<h2><a class='title-link' name='state' href='#state'></a> State </h2> ## <a class='title-link' name='state' href='#state'></a> State
<p>How state is communicated can be broken down into 5 categories. They are not mutually exclusive - a device state can be available both via the cloud and local connectivity.</p> How state is communicated can be broken down into 5 categories. They are not mutually exclusive - a device state can be available both via the cloud and local connectivity.
<h3><a class='title-link' name='no-state-available' href='#no-state-available'></a> No state available </h3> ### <a class='title-link' name='no-state-available' href='#no-state-available'></a> No state available
<p>These are devices that do not have the capabilities to make their state available. They only allow to be controlled. For example, devices with infrared remote controls like TVs and ACs. You can press the turn on button on the remote but can only assume that your command was received and executed successfully. The device might not be powered or something is blocking the infrared receiver.</p> These are devices that do not have the capabilities to make their state available. They only allow to be controlled. For example, devices with infrared remote controls like TVs and ACs. You can press the turn on button on the remote but can only assume that your command was received and executed successfully. The device might not be powered or something is blocking the infrared receiver.
<p>Home automation will have to approach such devices based on the assumption that its commands are received correctly: using optimistic updates. This means that after sending a command it will update the state of the device as if the command was received successfully.</p> Home automation will have to approach such devices based on the assumption that its commands are received correctly: using optimistic updates. This means that after sending a command it will update the state of the device as if the command was received successfully.
<p>Advantages:</p> Advantages:
<ul> - None
<li>None</li>
</ul>
<p>Disadvantages:</p> Disadvantages:
<ul> - Home automation will assume the wrong state if the the command is not received correctly or if the device is controlled in any other way outside of the home automation system.
<li>Home automation will assume the wrong state if the the command is not received correctly or if the device is controlled in any other way outside of the home automation system.</li>
</ul>
<h3><a class='title-link' name='polling-the-cloud' href='#polling-the-cloud'></a> Polling the cloud </h3> ### <a class='title-link' name='polling-the-cloud' href='#polling-the-cloud'></a> Polling the cloud
<p>These are devices that will only report their state to their own cloud backend. The cloud backend will allow reading the state but will not notify when a new state has arrived. This requires the home automation to check frequently if the state has been updated.</p> These are devices that will only report their state to their own cloud backend. The cloud backend will allow reading the state but will not notify when a new state has arrived. This requires the home automation to check frequently if the state has been updated.
<p>Advantages:</p> Advantages:
<ul> - Able to control devices while at home or away.
<li>Able to control devices while at home or away.</li> - Cloud has access to more computing power to mine the device data to suggest optimizations to the user.
<li>Cloud has access to more computing power to mine the device data to suggest optimizations to the user.</li>
</ul>
<p>Disadvantages:</p> Disadvantages:
<ul> - It doesnt work if the internet is down or the company stops support.
<li>It doesnt work if the internet is down or the company stops support.</li> - You are no longer in control about who has access to your data.
<li>You are no longer in control about who has access to your data.</li>
</ul>
<h3><a class='title-link' name='cloud-pushing-new-state' href='#cloud-pushing-new-state'></a> Cloud pushing new state </h3> ### <a class='title-link' name='cloud-pushing-new-state' href='#cloud-pushing-new-state'></a> Cloud pushing new state
<p>All off the previous section applies to this one. On top of that the cloud will now notify the home automation when a new state has arrived. This means that as soon as the cloud knows, the home automation knows.</p> All off the previous section applies to this one. On top of that the cloud will now notify the home automation when a new state has arrived. This means that as soon as the cloud knows, the home automation knows.
<p>Advantages:</p> Advantages:
<ul> - New state known as soon as available in the cloud.
<li>New state known as soon as available in the cloud.</li>
</ul>
<h3><a class='title-link' name='polling-the-local-device' href='#polling-the-local-device'></a> Polling the local device </h3> ### <a class='title-link' name='polling-the-local-device' href='#polling-the-local-device'></a> Polling the local device
<p>These devices will offer an API that is locally accessible. The home automation will have to frequently check if the state has been updated.</p> These devices will offer an API that is locally accessible. The home automation will have to frequently check if the state has been updated.
<p>Advantages:</p> Advantages:
<ul> - Does not depend on the internet
<li>Does not depend on the internet</li>
</ul>
<p>Disadvantages:</p> Disadvantages:
<ul> - To be pollable, a device needs to be always online which requires the device to be connected to a power source.
<li>To be pollable, a device needs to be always online which requires the device to be connected to a power source.</li>
</ul>
<h3><a class='title-link' name='local-device-pushing-new-state' href='#local-device-pushing-new-state'></a> Local device pushing new state </h3> ### <a class='title-link' name='local-device-pushing-new-state' href='#local-device-pushing-new-state'></a> Local device pushing new state
<p>The best of the best. These devices will send out a notice when they get to a new state. These devices usually use a home automation protocol to pass its message to a hub that will do the heavy lifting of managing and notifying subscribers</p> The best of the best. These devices will send out a notice when they get to a new state. These devices usually use a home automation protocol to pass its message to a hub that will do the heavy lifting of managing and notifying subscribers
<p>Advantages:</p> Advantages:
<ul> - Near instant delivery of new states.
<li>Near instant delivery of new states.</li> - Able to get a long battery life by going into deep sleep between state updates.
<li>Able to get a long battery life by going into deep sleep between state updates.</li>
</ul>
<p>Disadvantages:</p> Disadvantages:
<ul> - If it does not also support polling, home automation will not be made aware of the state after booting up until it changes.
<li>If it does not also support polling, home automation will not be made aware of the state after booting up until it changes.</li> - If using deep sleep and wifi, will suffer a delay when waking up because connecting to WiFi and receiving an IP takes time.
<li>If using deep sleep and wifi, will suffer a delay when waking up because connecting to WiFi and receiving an IP takes time.</li>
</ul>
<h2><a class='title-link' name='control' href='#control'></a> Control </h2>
<p>Controlling a device can, just like state, be done through cloud and/or local connectivity. But the more important part of control is knowing if your command was a success and the new state of the device.</p> ## <a class='title-link' name='control' href='#control'></a> Control
<h3><a class='title-link' name='no-control-available' href='#no-control-available'></a> No control available </h3> Controlling a device can, just like state, be done through cloud and/or local connectivity. But the more important part of control is knowing if your command was a success and the new state of the device.
<p>These devices are not able to be controlled. They will only offer state.</p>
<h3><a class='title-link' name='poll-state-after-sending-command' href='#poll-state-after-sending-command'></a> Poll State after sending command </h3> ### <a class='title-link' name='no-control-available' href='#no-control-available'></a> No control available
<p>These devices will require the state to be polled after sending a command to see if a command was successfull.</p> These devices are not able to be controlled. They will only offer state.
<p>Advantages:</p> ### <a class='title-link' name='poll-state-after-sending-command' href='#poll-state-after-sending-command'></a> Poll State after sending command
These devices will require the state to be polled after sending a command to see if a command was successfull.
<ul> Advantages:
<li>The state will be known right after the command was issued.</li>
</ul>
<p>Disadvantages:</p> - The state will be known right after the command was issued.
<ul> Disadvantages:
<li>It can take time before the state gets updated. How often do we poll and how long do we wait till we consider the command failed? Also, a state may change because of other factors. Difficult to determine if the updated state is because of our command.</li>
</ul>
<h3><a class='title-link' name='device-pushes-state-update' href='#device-pushes-state-update'></a> Device pushes state update </h3> - It can take time before the state gets updated. How often do we poll and how long do we wait till we consider the command failed? Also, a state may change because of other factors. Difficult to determine if the updated state is because of our command.
<p>These devices will not return a new state as a result of the command but instead will push a new state right away. The downside of this approach is that we have to assume that a state update coming in within a certain period of time after a command is related to the command.</p>
<h3><a class='title-link' name='command-returns-new-state' href='#command-returns-new-state'></a> Command returns new state </h3> ### <a class='title-link' name='device-pushes-state-update' href='#device-pushes-state-update'></a> Device pushes state update
<p>The very best. These devices will answer the command with the new state after executing the command.</p> These devices will not return a new state as a result of the command but instead will push a new state right away. The downside of this approach is that we have to assume that a state update coming in within a certain period of time after a command is related to the command.
<h2><a class='title-link' name='classifying-home-assistant' href='#classifying-home-assistant'></a> Classifying Home Assistant </h2> ### <a class='title-link' name='command-returns-new-state' href='#command-returns-new-state'></a> Command returns new state
<p>Home Assistant tries to offer the best experience possible via its APIs. There are different ways of interacting with Home Assistant but all are local.</p> The very best. These devices will answer the command with the new state after executing the command.
<ul> ## <a class='title-link' name='classifying-home-assistant' href='#classifying-home-assistant'></a> Classifying Home Assistant
<li>State polling is available via the REST API</li> Home Assistant tries to offer the best experience possible via its APIs. There are different ways of interacting with Home Assistant but all are local.
<li>There is a stream API that will push new states as soon as they arrive to subscribers. This is how the frontend is able to always stay in sync.</li>
<li>Calling a service on Home Assistant will return all states that changed while the service was executing. This sadly does not always include the new state of devices that push their new state, as they might arrive after the service has finished.</li> - State polling is available via the REST API
</ul> - There is a stream API that will push new states as soon as they arrive to subscribers. This is how the frontend is able to always stay in sync.
- Calling a service on Home Assistant will return all states that changed while the service was executing. This sadly does not always include the new state of devices that push their new state, as they might arrive after the service has finished.
]]></content> ]]></content>
</entry> </entry>
@ -223,44 +204,48 @@
<link href="https://home-assistant.io/blog/2016/01/19/perfect-home-automation/"/> <link href="https://home-assistant.io/blog/2016/01/19/perfect-home-automation/"/>
<updated>2016-01-19T08:20:00+00:00</updated> <updated>2016-01-19T08:20:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/01/19/perfect-home-automation</id> <id>https://home-assistant.io/blog/2016/01/19/perfect-home-automation</id>
<content type="html"><![CDATA[<p>People often ask me about my vision for Home Assistant. Before I can describe where I want to go with Home Assistant, I should first talk about how home automation would look in my ideal world. This will be the aim of this post. Im not going to focus on protocols, networks or specific hubs. Thats all implementation details. Instead, this post will focus on what is most important: the interaction between the users and their home.</p> <content type="html"><![CDATA[People often ask me about my vision for Home Assistant. Before I can describe where I want to go with Home Assistant, I should first talk about how home automation would look in my ideal world. This will be the aim of this post. Im not going to focus on protocols, networks or specific hubs. That's all implementation details. Instead, this post will focus on what is most important: the interaction between the users and their home.
<h3><a class='title-link' name='you-should-not-have-to-adapt-to-technology' href='#you-should-not-have-to-adapt-to-technology'></a> You should not have to adapt to technology. </h3> ### <a class='title-link' name='you-should-not-have-to-adapt-to-technology' href='#you-should-not-have-to-adapt-to-technology'></a> You should not have to adapt to technology.
<p>When people start using home automation, they always experience home control first: being able to control devices in new ways using a phone or computer. They believe the future is now and their app will be their remote for their lives. They only focus on what they are getting, not on what they are losing. You install some light bulbs and all of a sudden you are no longer able to use the light switches. Youll arrive at home at night and have to pull out your phone, open the app, let it connect and finally youll be able to turn on the light. All while turning the light on could have been a switch away.</p> When people start using home automation, they always experience home control first: being able to control devices in new ways using a phone or computer. They believe the future is now and their app will be their remote for their lives. They only focus on what they are getting, not on what they are losing. You install some light bulbs and all of a sudden you are no longer able to use the light switches. You'll arrive at home at night and have to pull out your phone, open the app, let it connect and finally you'll be able to turn on the light. All while turning the light on could have been a switch away.
<p>Yes, you can solve this with presence detection. What if your phone runs out of battery? Youll have to resort to the switch again.</p> Yes, you can solve this with presence detection. What if your phone runs out of battery? Youll have to resort to the switch again.
<p>If you find that using your new home devices is cumbersome, the promise of home automation technology has failed you. Your lights should work with both a switch (or button) at the entrance of your room and via presence detection. Honestly, there are hardly any valid use cases for being able to control lights from your phone except for showing off.<br /> If you find that using your new home devices is cumbersome, the promise of home automation technology has failed you. Your lights should work with both a switch (or button) at the entrance of your room and via presence detection. Honestly, there are hardly any valid use cases for being able to control lights from your phone except for showing off.
<!--more--></p> <!--more-->
<h3><a class='title-link' name='you-are-not-the-only-user-of-your-home-automation' href='#you-are-not-the-only-user-of-your-home-automation'></a> You are not the only user of your home automation. </h3> ### <a class='title-link' name='you-are-not-the-only-user-of-your-home-automation' href='#you-are-not-the-only-user-of-your-home-automation'></a> You are not the only user of your home automation.
<p>People tend to forget that they are not the only ones in their home. As the developer of your house youre enthusiastic about the possibilities and are willing to overlook flaws. Chances are very high that the other people in your household have different hobbies and just want to mind their own business.</p> People tend to forget that they are not the only ones in their home. As the developer of your house you're enthusiastic about the possibilities and are willing to overlook flaws. Chances are very high that the other people in your household have different hobbies and just want to mind their own business.
<p>This means that everything you automate has to work flawlessly. If you successfully manage to cause a response to some stimulus 90% of the time, youre going to have a disproportionately poor experience 10% of the time. A common automation that fits this pattern is to fade the lights when you start watching a movie or series in the living room. It only works if everyone is watching.</p> This means that everything you automate has to work flawlessly. If you successfully manage to cause a response to some stimulus 90% of the time, youre going to have a disproportionately poor experience 10% of the time. A common automation that fits this pattern is to fade the lights when you start watching a movie or series in the living room. It only works if everyone is watching.
<h3><a class='title-link' name='limit-the-impact-of-false-positives-and-negatives' href='#limit-the-impact-of-false-positives-and-negatives'></a> Limit the impact of false positives and negatives. </h3> ### <a class='title-link' name='limit-the-impact-of-false-positives-and-negatives' href='#limit-the-impact-of-false-positives-and-negatives'></a> Limit the impact of false positives and negatives.
<p>With every automation, you always have to think: what will be the impact if it doesnt work? Home automation is composed of many different systems by many different vendors that speak many different protocols: things will go wrong. Its up to you to make sure that they have a limited impact when they fail. Ideally, devices should fall back to a pre-smart home experience. A Philips Hue bulb will act like a standard white light if turned on/off using a normal switch or when not connected to a hub. If things get worse when your system is out of order, your users will revolt. Take for example the Nest thermostat that <a href="http://www.nytimes.com/2016/01/14/fashion/nest-thermostat-glitch-battery-dies-software-freeze.html">had a bug in the beginning of January</a> which caused it to stop heating the house, yikes!</p> With every automation, you always have to think: what will be the impact if it doesnt work? Home automation is composed of many different systems by many different vendors that speak many different protocols: things will go wrong. Its up to you to make sure that they have a limited impact when they fail. Ideally, devices should fall back to a pre-smart home experience. A Philips Hue bulb will act like a standard white light if turned on/off using a normal switch or when not connected to a hub. If things get worse when your system is out of order, your users will revolt. Take for example the Nest thermostat that [had a bug in the beginning of January][nest-bug] which caused it to stop heating the house, yikes!
<h3><a class='title-link' name='the-perfect-app-is-no-app' href='#the-perfect-app-is-no-app'></a> The perfect app is no app. </h3> [nest-bug]: http://www.nytimes.com/2016/01/14/fashion/nest-thermostat-glitch-battery-dies-software-freeze.html
<p>Home automation should blend with your current workflow, not replace it. For most devices, there is no faster way to control most devices than how you are already doing it today. Most of the time, the best app is no app. The only interface that can be more convenient, and is accessible for visitors of your home of all ages is a voice interface. The industry has realized this too and there are some major players focussing on voice interaction. Take Apple for example: the only way to control your HomeKit devices is with Siri. Amazon has taken it one step further with the Amazon Echo, providing an always-listening connected speaker/microphone for the living room. I expect a lot more companies to join this segment in 2016.</p> ### <a class='title-link' name='the-perfect-app-is-no-app' href='#the-perfect-app-is-no-app'></a> The perfect app is no app.
<p>Voice interfaces are not perfect either. The speed at which you can issue commands is low because you have to wait for a response. There are also issues with the discoverability of commands, recognition of accents and dependency on the cloud for processing your voice. I believe that all but the first one are problems that are going to be solved eventually.</p> Home automation should blend with your current workflow, not replace it. For most devices, there is no faster way to control most devices than how you are already doing it today. Most of the time, the best app is no app. The only interface that can be more convenient, and is accessible for visitors of your home of all ages is a voice interface. The industry has realized this too and there are some major players focussing on voice interaction. Take Apple for example: the only way to control your HomeKit devices is with Siri. Amazon has taken it one step further with the Amazon Echo, providing an always-listening connected speaker/microphone for the living room. I expect a lot more companies to join this segment in 2016.
<p>This however doesnt mean there isnt a place for apps, there definitely is. They are perfectly well-suited for checking in while youre away, browsing the state changes of your house or making the lights go all funky when there are kids visiting.</p> Voice interfaces are not perfect either. The speed at which you can issue commands is low because you have to wait for a response. There are also issues with the discoverability of commands, recognition of accents and dependency on the cloud for processing your voice. I believe that all but the first one are problems that are going to be solved eventually.
<h3><a class='title-link' name='your-system-should-run-at-home-not-in-the-cloud' href='#your-system-should-run-at-home-not-in-the-cloud'></a> Your system should run at home, not in the cloud. </h3> This however doesnt mean there isnt a place for apps, there definitely is. They are perfectly well-suited for checking in while youre away, browsing the state changes of your house or making the lights go all funky when there are kids visiting.
<p>The cloud is a magical thing. Somewhere in the world there are computers collecting the data that your house generates, testing them against your automation rules and sending commands back when needed. The cloud will receive updates and improve itself over time so it is able to serve you better. Until its not. There are many reasons why your home might lose its connection to the cloud. The internet can stop working, an update might have gone wrong or the servers running the cloud crash.</p> ### <a class='title-link' name='your-system-should-run-at-home-not-in-the-cloud' href='#your-system-should-run-at-home-not-in-the-cloud'></a> Your system should run at home, not in the cloud.
<p>When this happens, your house should be able to keep functioning. The cloud should be treated as an extension to your smart home instead of running it. That way youll avoid awkward situations like when Amazon AWS was down and the <a href="http://www.zdnet.com/article/the-night-alexa-lost-her-mind/">Amazon Echo stopped working</a>.</p> The cloud is a magical thing. Somewhere in the world there are computers collecting the data that your house generates, testing them against your automation rules and sending commands back when needed. The cloud will receive updates and improve itself over time so it is able to serve you better. Until its not. There are many reasons why your home might lose its connection to the cloud. The internet can stop working, an update might have gone wrong or the servers running the cloud crash.
<p><strong>Good home automation never annoys but is missed when it is not working.</strong></p> When this happens, your house should be able to keep functioning. The cloud should be treated as an extension to your smart home instead of running it. That way youll avoid awkward situations like when Amazon AWS was down and the [Amazon Echo stopped working][echo-crash].
<p><em>Thanks to Chris LaRose for this feedback and comments.</em></p> [echo-crash]: http://www.zdnet.com/article/the-night-alexa-lost-her-mind/
**Good home automation never annoys but is missed when it is not working.**
*Thanks to Chris LaRose for this feedback and comments.*
]]></content> ]]></content>
</entry> </entry>
@ -269,62 +254,64 @@
<link href="https://home-assistant.io/blog/2014/12/26/home-control-home-automation-and-the-smart-home/"/> <link href="https://home-assistant.io/blog/2014/12/26/home-control-home-automation-and-the-smart-home/"/>
<updated>2014-12-26T18:23:13+00:00</updated> <updated>2014-12-26T18:23:13+00:00</updated>
<id>https://home-assistant.io/blog/2014/12/26/home-control-home-automation-and-the-smart-home</id> <id>https://home-assistant.io/blog/2014/12/26/home-control-home-automation-and-the-smart-home</id>
<content type="html"><![CDATA[<p>The internet has been buzzing over the last year about home automation. A lot of different terms fly around like the internet of things, home automation and the smart home.<br /> <content type="html"><![CDATA[The internet has been buzzing over the last year about home automation. A lot of different terms fly around like the internet of things, home automation and the smart home.
This article will try to explain how they all relate.</p> This article will try to explain how they all relate.
<p>The first thing to introduce is the <strong>Internet of Things</strong> (IoT). This refers to a new generation of devices that cannot only be controlled by humans via buttons or remotes but also provide an interface to communicate with other devices and applications. For example, an IoT-capable coffee machine could receive commands to create different types of coffee and be able to broadcast the amount of water left in its resevoir.</p> The first thing to introduce is the **Internet of Things** (IoT). This refers to a new generation of devices that cannot only be controlled by humans via buttons or remotes but also provide an interface to communicate with other devices and applications. For example, an IoT-capable coffee machine could receive commands to create different types of coffee and be able to broadcast the amount of water left in its resevoir.
<p>There is no widely adopted open standard for smart device communication. This prevents a lot of devices to communicate with one another. And even if they could, most devices are not designed to manage other devices. To solve this we need a device to be able to communicate with and manage all these connected devices. This device is called a <strong>hub</strong>.</p> There is no widely adopted open standard for smart device communication. This prevents a lot of devices to communicate with one another. And even if they could, most devices are not designed to manage other devices. To solve this we need a device to be able to communicate with and manage all these connected devices. This device is called a **hub**.
<p>As a bare minimum a hub has to keep track of the state of each device and should be able to control them if possible. For example, it has to know which lights are on or off and offer a way to control the lights. For a sensor it only has to know the value. A hub with these capabilities offers <strong>home control</strong>.</p> As a bare minimum a hub has to keep track of the state of each device and should be able to control them if possible. For example, it has to know which lights are on or off and offer a way to control the lights. For a sensor it only has to know the value. A hub with these capabilities offers **home control**.
<p class="img"> <p class='img'>
<a href="/images/screenshots/nexus_7_dashboard.png"> <a href='/images/screenshots/nexus_7_dashboard.png'>
<img alt="Hub dashboard example" src="/images/screenshots/nexus_7_dashboard.png" /> <img alt='Hub dashboard example'
src='/images/screenshots/nexus_7_dashboard.png' />
</a> </a>
Example of a hubs dashboard. Showing the state of 2 persons, 4 lights and the sun. Example of a hub's dashboard. Showing the state of 2 persons, 4 lights and the sun.
</p> </p>
<!--more--> <!--more-->
<p>A step up from home control is to have the user setup triggers to send commands based on information in the home control layer. For example, to turn on the lights when a person arrives home. A hub with these capabilities is capable of <strong>home automation</strong>.</p> A step up from home control is to have the user setup triggers to send commands based on information in the home control layer. For example, to turn on the lights when a person arrives home. A hub with these capabilities is capable of **home automation**.
<p>Most hubs on the market today offer this in various degrees of functionality and usability. Some IoT-capable devices offer this too, but only control themselves and are usually limited to location and time-based events.</p> Most hubs on the market today offer this in various degrees of functionality and usability. Some IoT-capable devices offer this too, but only control themselves and are usually limited to location and time-based events.
<p>The last category, and this is still very much in the future, is the <strong>smart home</strong>. A self-learning and adopting system that will decide which events should impact other devices.</p> The last category, and this is still very much in the future, is the **smart home**. A self-learning and adopting system that will decide which events should impact other devices.
<p>An example of a smart home in action is that it observes that when person A comes home, the lights in the living room and the kitchen switch on. While if person B comes home, the lights in the living room and the study room are switched on. The next time person A or B comes home, the smart home will turn on its preferred lights without any configuration being set by the user.</p> An example of a smart home in action is that it observes that when person A comes home, the lights in the living room and the kitchen switch on. While if person B comes home, the lights in the living room and the study room are switched on. The next time person A or B comes home, the smart home will turn on its preferred lights without any configuration being set by the user.
<p>A glimpse today at how the future can look is the <a href="https://nest.com/">Nest thermostat</a>. A thermostat smart enough to learn your schedule and adjust its own temperature accordingly.</p> A glimpse today at how the future can look is the [Nest thermostat](https://nest.com/). A thermostat smart enough to learn your schedule and adjust its own temperature accordingly.
<p>All this results in the following overview of Home Automation.</p> All this results in the following overview of Home Automation.
<p class="img"> <p class='img'>
<a href="/images/architecture/home_automation_landscape.png"> <a href='/images/architecture/home_automation_landscape.png'>
<img alt="Home Automation landscape" src="/images/architecture/home_automation_landscape.png" /> <img alt='Home Automation landscape'
src='/images/architecture/home_automation_landscape.png' />
</a> </a>
Overview of the home automation landscape. Overview of the home automation landscape.
</p> </p>
<h3>Challenges</h3> ### Challenges
<p>You are probably wondering, this all seems relatively simple, why dont I have my very own smart home yet? There are a couple of challenges today that keep us from stepping into the future.</p> You are probably wondering, this all seems relatively simple, why don't I have my very own smart home yet? There are a couple of challenges today that keep us from stepping into the future.
<h4>More Internet of Things-capable devices</h4> #### More Internet of Things-capable devices
<p>The majority of the IoT products out there are either lights, switches or presence detection. Thats not enough for your home to be very smart about. We need televisions, fridges, ovens and more to join the party to increase the number of devices that we can control.</p> The majority of the IoT products out there are either lights, switches or presence detection. That's not enough for your home to be very smart about. We need televisions, fridges, ovens and more to join the party to increase the number of devices that we can control.
<h4>More data</h4> #### More data
<p>Most first generation IoT devices are only exposing information that is needed for controlling it. We need to be able to track all interactions with each device for our smart home to learn how interaction with devices influence other things. For example, we need to be able to track how many cups of coffee were made or how often the fridge was open. This will increase the information flow and open up a whole bunch of new possibilities. For example, the smart home can order new coffee when youre running low.</p> Most first generation IoT devices are only exposing information that is needed for controlling it. We need to be able to track all interactions with each device for our smart home to learn how interaction with devices influence other things. For example, we need to be able to track how many cups of coffee were made or how often the fridge was open. This will increase the information flow and open up a whole bunch of new possibilities. For example, the smart home can order new coffee when you're running low.
<h4>Easy to use, open software that we can trust</h4> #### Easy to use, open software that we can trust
<p>To increase adoption we will need people to trust their smart home system. It will be very tough to convince people to upgrade all their devices and upload all interactions with each of them to the cloud. This data could reveal their whole life including all bad habits. Thats why such a system should be simple and open-source so people can validate that their data generated at home stays home.</p> To increase adoption we will need people to trust their smart home system. It will be very tough to convince people to upgrade all their devices and upload all interactions with each of them to the cloud. This data could reveal their whole life including all bad habits. That's why such a system should be simple and open-source so people can validate that their data generated at home stays home.
<p>Anoter important booster for adoption is that the software should be easy to set up and use by the average user. A lot of people are not burning their hands yet on Home Automation because they are scared of configurating it.</p> Anoter important booster for adoption is that the software should be easy to set up and use by the average user. A lot of people are not burning their hands yet on Home Automation because they are scared of configurating it.
<p>Home Assistant is trying to be this software. It is not there yet but trying hard. Device discovery and a user interface for configuring home automation are problems we hope to tackle in 2015 while not sacrificing any modularity or usability.</p> Home Assistant is trying to be this software. It is not there yet but trying hard. Device discovery and a user interface for configuring home automation are problems we hope to tackle in 2015 while not sacrificing any modularity or usability.
<p>Happy new year!</p> Happy new year!
]]></content> ]]></content>
</entry> </entry>

View file

@ -297,7 +297,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: IoT-Data | Home Assistant]]></title> <title><![CDATA[Category: IoT-Data | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/iot-data/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/iot-data/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2016-08-22T07:26:42+00:00</updated> <updated>2016-08-22T08:20:27+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>
@ -18,13 +18,17 @@
<link href="https://home-assistant.io/blog/2016/08/19/github-style-calendar-heatmap-of-device-data/"/> <link href="https://home-assistant.io/blog/2016/08/19/github-style-calendar-heatmap-of-device-data/"/>
<updated>2016-08-19T06:00:00+00:00</updated> <updated>2016-08-19T06:00:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/08/19/github-style-calendar-heatmap-of-device-data</id> <id>https://home-assistant.io/blog/2016/08/19/github-style-calendar-heatmap-of-device-data</id>
<content type="html"><![CDATA[<p>Thanks to <a href="https://github.com/kireyeu">Anton Kireyeu</a> we are able to present another awesome <a href="https://jupyter.org/">Jupyter notebook</a>. I guess that you all know the graph which Github is using to visualize your commits per day over a time-line. Its a so-called <a href="https://en.wikipedia.org/wiki/Heat_map">heatmap</a>. If there are more commits, its getting hotter. The latest <a href="http://nbviewer.jupyter.org/github/home-assistant/home-assistant-notebooks/blob/master/DataExploration-2/DataExploration-2.ipynb">notebook</a> is capable to do the same thing for your devices. To be more precise, for the hours your devices are home.</p> <content type="html"><![CDATA[Thanks to [Anton Kireyeu](https://github.com/kireyeu) we are able to present another awesome [Jupyter notebook]. I guess that you all know the graph which Github is using to visualize your commits per day over a time-line. It's a so-called [heatmap]. If there are more commits, it's getting hotter. The latest [notebook][nb-prev] is capable to do the same thing for your devices. To be more precise, for the hours your devices are home.
<p class="img"> <p class='img'>
<img src="https://home-assistant.io/images/blog/2016-08-data-exploration/heatmap.png" /> <img src='https://home-assistant.io/images/blog/2016-08-data-exploration/heatmap.png'>
Heatmap Heatmap
</p> </p>
[heatmap]: https://en.wikipedia.org/wiki/Heat_map
[Jupyter notebook]: https://jupyter.org/
[nb-prev]: http://nbviewer.jupyter.org/github/home-assistant/home-assistant-notebooks/blob/master/DataExploration-2/DataExploration-2.ipynb
]]></content> ]]></content>
</entry> </entry>
@ -33,71 +37,74 @@ Heatmap
<link href="https://home-assistant.io/blog/2016/07/23/internet-of-things-data-exploration-with-jupyter-notebooks/"/> <link href="https://home-assistant.io/blog/2016/07/23/internet-of-things-data-exploration-with-jupyter-notebooks/"/>
<updated>2016-07-23T18:00:00+00:00</updated> <updated>2016-07-23T18:00:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/07/23/internet-of-things-data-exploration-with-jupyter-notebooks</id> <id>https://home-assistant.io/blog/2016/07/23/internet-of-things-data-exploration-with-jupyter-notebooks</id>
<content type="html"><![CDATA[<p><em>This is the first blog post by Anton Kireyeu. A new contributor to Home Assistant who will focus on exploring and visualizing Home Assistant data.</em></p> <content type="html"><![CDATA[_This is the first blog post by Anton Kireyeu. A new contributor to Home Assistant who will focus on exploring and visualizing Home Assistant data._
<p>As we learned in the recent <a href="https://home-assistant.io/blog/2016/07/19/visualizing-your-iot-data/">blog post by Fabian</a>, all operational data of your Home Assistant application is stored locally and is available for exploration. Our first steps were querying data with the <a href="http://sqlitebrowser.org/">DB Browser for SQLite</a>, exporting the data extract as a CSV file and graphing in LibreOffice. But what else can be done with this data and what tools are there available?</p> As we learned in the recent [blog post by Fabian], all operational data of your Home Assistant application is stored locally and is available for exploration. Our first steps were querying data with the [DB Browser for SQLite], exporting the data extract as a CSV file and graphing in LibreOffice. But what else can be done with this data and what tools are there available?
<p>This post will help you get set up using a few popular data scientist tools to allow you to locally process your data:</p> This post will help you get set up using a few popular data scientist tools to allow you to locally process your data:
<ul> - &nbsp;[Pandas]: an open source tool for data analysis for Python
<li> <a href="http://pandas.pydata.org/">Pandas</a>: an open source tool for data analysis for Python</li> - &nbsp;[matplotlib]: a Python plotting library
<li> <a href="http://matplotlib.org/">matplotlib</a>: a Python plotting library</li> - &nbsp;[Jupyter notebook]: application for creation and sharing of documents containing live code, visualizations and explanatory text
<li> <a href="https://jupyter.org/">Jupyter notebook</a>: application for creation and sharing of documents containing live code, visualizations and explanatory text</li>
</ul>
<p class="img"> <p class='img'>
<img src="https://home-assistant.io/images/blog/2016-07-data-exploration/graph.png" /> <img src='https://home-assistant.io/images/blog/2016-07-data-exploration/graph.png'>
One of the graphs created with this tutorial. One of the graphs created with this tutorial.
</p> </p>
<p><em>TL; DR: Use <a href="http://nbviewer.jupyter.org/github/home-assistant/home-assistant-notebooks/blob/master/DataExploration-1/DataExploration-1.ipynb">this Jupyter Notebook</a> to visualize of your data</em></p> _TL; DR: Use [this Jupyter Notebook][nb-prev] to visualize of your data_
[blog post by Fabian]: https://home-assistant.io/blog/2016/07/19/visualizing-your-iot-data/
[DB Browser for SQLite]: http://sqlitebrowser.org/
[Pandas]: http://pandas.pydata.org/
[matplotlib]: http://matplotlib.org/
[Jupyter notebook]: https://jupyter.org/
[nb-prev]: http://nbviewer.jupyter.org/github/home-assistant/home-assistant-notebooks/blob/master/DataExploration-1/DataExploration-1.ipynb
<!--more--> <!--more-->
<h3><a class='title-link' name='dependencies' href='#dependencies'></a> Dependencies </h3> ### <a class='title-link' name='dependencies' href='#dependencies'></a> Dependencies
<p>In order to run the provided Jupyter notebook, please make sure you have the following applications/libraries installed on your computer:</p> In order to run the provided Jupyter notebook, please make sure you have the following applications/libraries installed on your computer:
<ul> - Pandas
<li>Pandas</li> - NumPy
<li>NumPy</li> - Matplotlib
<li>Matplotlib</li> - SQLAlchemy
<li>SQLAlchemy</li> - Jupyter
<li>Jupyter</li>
</ul>
<p>As a Windows user myself, I find the easiest, quickest and most hassle-free way of installing all of these dependencies is to use <a href="https://winpython.github.io/">WinPython</a>. This free open-source portable distribution includes all of the dependencies required for this notebook, as well as a few other essential Python libraries you may require for data exploration in the future.</p> As a Windows user myself, I find the easiest, quickest and most hassle-free way of installing all of these dependencies is to use [WinPython]. This free open-source portable distribution includes all of the dependencies required for this notebook, as well as a few other essential Python libraries you may require for data exploration in the future.
<h4><a class='title-link' name='why-jupyter' href='#why-jupyter'></a> Why Jupyter? </h4> [WinPython]: https://winpython.github.io/
<p>While all Home Assistant implementations can have varying setup, components and scripts, the underlying data structure is standardized and well-defined. This allows us to write Python code that is environmentally agnostic. Wrapping it in a Jupyter notebook ensures the code, visualizations and directions/explanations are kept digestible and neatly-packaged. One of the amazing features of Jupyter is the ability to change code as you go along, customizing all outputs and visualizations on the fly!</p> #### <a class='title-link' name='why-jupyter' href='#why-jupyter'></a> Why Jupyter?
<h4><a class='title-link' name='where-do-i-start' href='#where-do-i-start'></a> Where do I start? </h4> While all Home Assistant implementations can have varying setup, components and scripts, the underlying data structure is standardized and well-defined. This allows us to write Python code that is environmentally agnostic. Wrapping it in a Jupyter notebook ensures the code, visualizations and directions/explanations are kept digestible and neatly-packaged. One of the amazing features of Jupyter is the ability to change code as you go along, customizing all outputs and visualizations on the fly!
<p>This tutorial is based around a heavily commented Jupyter Notebook that we created. So to get started, you will have to open that:</p> #### <a class='title-link' name='where-do-i-start' href='#where-do-i-start'></a> Where do I start?
<ul> This tutorial is based around a heavily commented Jupyter Notebook that we created. So to get started, you will have to open that:
<li><a href="http://nbviewer.jupyter.org/github/home-assistant/home-assistant-notebooks/blob/master/DataExploration-1/DataExploration-1.ipynb">download the tutorial Jupyter Notebook</a> (leads to preview page, from there click download top-right)</li>
<li>launch the Jupyter Notebook App</li>
<li>Click the upload button to add the downloaded notebook to Jupyter</li>
<li>Adjust the <code>DB_URL</code> at the beginning of the notebook to point at your Home Assistant database</li>
<li>Select in top menu: Cell -&gt; Run All</li>
</ul>
<p>Thats it! The included code will walk you through importing the required libraries, show running raw SQL against your local database, plotting basic data from the states table, and in the end output a few plots of changes for every entity in your system as well as the mean daily value for the past 20 days.</p> - [download the tutorial Jupyter Notebook][nb-prev] (leads to preview page, from there click download top-right)
- launch the Jupyter Notebook App
- Click the 'upload' button to add the downloaded notebook to Jupyter
- Adjust the `DB_URL` at the beginning of the notebook to point at your Home Assistant database
- Select in top menu: Cell -> Run All
<p>After just those few steps, you will be greeted with beautiful formatted data like this:</p> Thats it! The included code will walk you through importing the required libraries, show running raw SQL against your local database, plotting basic data from the states table, and in the end output a few plots of changes for every entity in your system as well as the mean daily value for the past 20 days.
<p class="img"> After just those few steps, you will be greeted with beautiful formatted data like this:
<img src="https://home-assistant.io/images/blog/2016-07-data-exploration/graph.png" />
<p class='img'>
<img src='https://home-assistant.io/images/blog/2016-07-data-exploration/graph.png'>
One of the graphs created with this tutorial. One of the graphs created with this tutorial.
</p> </p>
<h4><a class='title-link' name='whats-next' href='#whats-next'></a> Whats next? </h4> #### <a class='title-link' name='whats-next' href='#whats-next'></a> Whats next?
<p>Thanks to the magic of Jupyter, all of the code is customizable: want to selectively display your data, only covering a specific entity? Sure thing! Want to change the properties of the plots? No problem!</p> Thanks to the magic of Jupyter, all of the code is customizable: want to selectively display your data, only covering a specific entity? Sure thing! Want to change the properties of the plots? No problem!
<p>While you learn and explore your IoT data, we will be working on providing more ready-to-use Jupyter Notebooks. Feel free to ask questions or provide suggestions. Would you like to see a specific visualization? Is there a particular facet of data youre interested in? Lets talk about it, lets dive into the world of data together!</p> While you learn and explore your IoT data, we will be working on providing more ready-to-use Jupyter Notebooks. Feel free to ask questions or provide suggestions. Would you like to see a specific visualization? Is there a particular facet of data youre interested in? Lets talk about it, lets dive into the world of data together!
]]></content> ]]></content>
</entry> </entry>
@ -106,114 +113,106 @@ One of the graphs created with this tutorial.
<link href="https://home-assistant.io/blog/2016/07/19/visualizing-your-iot-data/"/> <link href="https://home-assistant.io/blog/2016/07/19/visualizing-your-iot-data/"/>
<updated>2016-07-19T16:00:00+00:00</updated> <updated>2016-07-19T16:00:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/07/19/visualizing-your-iot-data</id> <id>https://home-assistant.io/blog/2016/07/19/visualizing-your-iot-data</id>
<content type="html"><![CDATA[<p><img src="https://home-assistant.io/images/blog/2016-07-reporting/mpl-sensor.png" style="clear: right; border:none; box-shadow: none; float: right; margin-bottom: 12px;" width="200" /></p> <content type="html"><![CDATA[<img src='https://home-assistant.io/images/blog/2016-07-reporting/mpl-sensor.png' style='clear: right; border:none; box-shadow: none; float: right; margin-bottom: 12px;' width='200' />
<p>The <a href="/components/history/">history component</a> is tracking everything that is going on within Home Assistant. This means that you have access to all stored information about your home. Our history is not a full-fledged graphical processing and visualization component as you may know from systems and network monitoring tools. The current limitation is that you only can select a day for a visual output of your information and not a period. Also, there is no possibility to drill down on a specific entity.</p> The [history component](/components/history/) is tracking everything that is going on within Home Assistant. This means that you have access to all stored information about your home. Our history is not a full-fledged graphical processing and visualization component as you may know from systems and network monitoring tools. The current limitation is that you only can select a day for a visual output of your information and not a period. Also, there is no possibility to drill down on a specific entity.
<p>This blog post will show you ways to export data for reporting, visualization, or further analysis of automation rules.</p> This blog post will show you ways to export data for reporting, visualization, or further analysis of automation rules.
<!--more--> <!--more-->
<p>In this blog post I use the temperature of the <a href="https://en.wikipedia.org/wiki/Aare">Aare</a> river close to where I live as a show case. The temperatures were recorded with the <a href="/components/sensor.swiss_hydrological_data/">Swiss Hydrological Data sensor</a> and the name of the sensor is <code>sensor.aare</code>.</p> In this blog post I use the temperature of the [Aare](https://en.wikipedia.org/wiki/Aare) river close to where I live as a show case. The temperatures were recorded with the [Swiss Hydrological Data sensor](/components/sensor.swiss_hydrological_data/) and the name of the sensor is `sensor.aare`.
<p>The database is stored at <code>&lt;path to config dir&gt;/.homeassistant/home-assistant_v2.db</code> as <a href="https://www.sqlite.org/">SQLite database</a>. In all examples we are going to use the path: <code>/home/ha/.homeassistant/home-assistant_v2.db</code></p> The database is stored at `<path to config dir>/.homeassistant/home-assistant_v2.db` as [SQLite database](https://www.sqlite.org/). In all examples we are going to use the path: `/home/ha/.homeassistant/home-assistant_v2.db`
<p>If you are just curious whats stored in your database then you can use the <code>sqlite3</code> command-line tool or a graphical one like <a href="http://sqlitebrowser.org/">DB Browser for SQLite</a>.</p> If you are just curious what's stored in your database then you can use the `sqlite3` command-line tool or a graphical one like [DB Browser for SQLite](http://sqlitebrowser.org/).
<p>The table that is holding the states is called <code>states</code>. The <code>events</code> tables is responsible for storing the events which occurred. So, we will first check how many entries there are in the <code>states</code> table. <code>sqlite3</code> needs to know where the databases is located. To work with your database make sure that Home Assistant is not running or create a copy of the existing database. Its recommended to work with a copy.</p> The table that is holding the states is called `states`. The `events` tables is responsible for storing the events which occurred. So, we will first check how many entries there are in the `states` table. `sqlite3` needs to know where the databases is located. To work with your database make sure that Home Assistant is not running or create a copy of the existing database. It's recommended to work with a copy.
<div class="highlighter-coderay"><div class="CodeRay"> ```bash
<div class="code"><pre>$ sqlite3 /home/ha/.homeassistant/home-assistant_v2.db $ sqlite3 /home/ha/.homeassistant/home-assistant_v2.db
SQLite version 3.11.0 2016-02-15 17:29:24 SQLite version 3.11.0 2016-02-15 17:29:24
sqlite&gt; SELECT count(*) FROM states; sqlite> SELECT count(*) FROM states;
24659 24659
</pre></div> ```
</div>
</div>
<p>Lets have a look at a sample <a href="https://en.wikipedia.org/wiki/SQL">SQL</a> query. This query will show all states in a period for the sensor <code>sensor.aare</code>.</p> Let's have a look at a sample [SQL](https://en.wikipedia.org/wiki/SQL) query. This query will show all states in a period for the sensor `sensor.aare`.
<div class="highlighter-coderay"><div class="CodeRay"> ```sql
<div class="code"><pre><span class="class">SELECT</span> state, last_changed <span class="keyword">FROM</span> states SELECT state, last_changed FROM states
<span class="keyword">WHERE</span> WHERE
entity_id = <span class="string"><span class="delimiter">'</span><span class="content">sensor.aare</span><span class="delimiter">'</span></span> entity_id = 'sensor.aare'
<span class="keyword">AND</span> AND
last_changed <span class="keyword">BETWEEN</span> last_changed BETWEEN
<span class="string"><span class="delimiter">'</span><span class="content">2016-07-05 00:00:00.000000</span><span class="delimiter">'</span></span> <span class="keyword">AND</span> <span class="string"><span class="delimiter">'</span><span class="content">2016-07-07 00:00:00.000000</span><span class="delimiter">'</span></span>; '2016-07-05 00:00:00.000000' AND '2016-07-07 00:00:00.000000';
</pre></div> ```
</div>
</div>
<p>The SQL statement can be formed that it fits exactly what you need. This means that you can process the data in any way you want for further use. Often it makes sense to eliminate certain entries like <code>Unknown</code> or peaks.</p> The SQL statement can be formed that it fits exactly what you need. This means that you can process the data in any way you want for further use. Often it makes sense to eliminate certain entries like `Unknown` or peaks.
<p>If the above query is executed in DB Browser for SQLite you would be able to save the sensors graph as png.</p> If the above query is executed in DB Browser for SQLite you would be able to save the sensor's graph as png.
<p class="img"> <p class='img'>
<img src="https://home-assistant.io/images/blog/2016-07-reporting/db-browser.png" /> <img src='https://home-assistant.io/images/blog/2016-07-reporting/db-browser.png' />
Visualization with DB Browser for SQLite Visualization with DB Browser for SQLite
</p> </p>
<p>You may ask: Why not do this with LibreOffice Calc or another spreadsheet application? As most spreadsheet applications are not able to work directly with SQLite database we are going to export the data from the database to <a href="https://en.wikipedia.org/wiki/Comma-separated_values">CSV</a>.</p> You may ask: Why not do this with LibreOffice Calc or another spreadsheet application? As most spreadsheet applications are not able to work directly with SQLite database we are going to export the data from the database to [CSV](https://en.wikipedia.org/wiki/Comma-separated_values).
<div class="highlighter-coderay"><div class="CodeRay"> ```bash
<div class="code"><pre>$ sqlite3 -header -csv /home/ha/.homeassistant/home-assistant_v2.db &quot;SELECT last_changed, state FROM states WHERE entity_id = 'sensor.aare' AND last_changed BETWEEN '2016-07-05 00:00:00.000000' AND '2016-07-07 00:00:00.000000';&quot; &gt; sensor.csv $ sqlite3 -header -csv /home/ha/.homeassistant/home-assistant_v2.db "SELECT last_changed, state FROM states WHERE entity_id = 'sensor.aare' AND last_changed BETWEEN '2016-07-05 00:00:00.000000' AND '2016-07-07 00:00:00.000000';" > sensor.csv
</pre></div> ```
</div>
</div>
<p>The ordering for the <code>SELECT</code> was changed to get the time stamps first and then the state. Now we can import the CSV file into the application of your choice, here its LibreOffice Calc.</p> The ordering for the `SELECT` was changed to get the time stamps first and then the state. Now we can import the CSV file into the application of your choice, here it's LibreOffice Calc.
<p class="img"> <p class='img'>
<img src="https://home-assistant.io/images/blog/2016-07-reporting/libreoffice-import.png" /> <img src='https://home-assistant.io/images/blog/2016-07-reporting/libreoffice-import.png' />
Import of the CSV file Import of the CSV file
</p> </p>
<p>After the import a graph can be created over the existing data.</p> After the import a graph can be created over the existing data.
<p class="img"> <p class='img'>
<img src="https://home-assistant.io/images/blog/2016-07-reporting/libreoffice-graph.png" /> <img src='https://home-assistant.io/images/blog/2016-07-reporting/libreoffice-graph.png' />
Graph in LibreOffice Graph in LibreOffice
</p> </p>
<p>You can also use <a href="http://matplotlib.org/">matplotlib</a> to generate graphs as an alternative to a spreadsheet application. This is a powerful Python 2D plotting library. With the built-in support for SQLite in Python it will only take a couple lines of code to visualize your data.</p> You can also use [matplotlib](http://matplotlib.org/) to generate graphs as an alternative to a spreadsheet application. This is a powerful Python 2D plotting library. With the built-in support for SQLite in Python it will only take a couple lines of code to visualize your data.
<div class="highlighter-coderay"><div class="CodeRay"> ```python
<div class="code"><pre><span class="keyword">import</span> <span class="include">sqlite3</span> import sqlite3
<span class="keyword">from</span> <span class="include">matplotlib</span> <span class="keyword">import</span> <span class="include">dates</span> from matplotlib import dates
<span class="keyword">import</span> <span class="include">matplotlib.pyplot</span> <span class="keyword">as</span> plt import matplotlib.pyplot as plt
<span class="keyword">import</span> <span class="include">homeassistant.util.dt</span> <span class="keyword">as</span> dt import homeassistant.util.dt as dt
values = [] values = []
timestamps = [] timestamps = []
conn = sqlite3.connect(<span class="string"><span class="delimiter">'</span><span class="content">/home/ha/.homeassistant/home-assistant_v2.db</span><span class="delimiter">'</span></span>) conn = sqlite3.connect('/home/ha/.homeassistant/home-assistant_v2.db')
data = conn.execute(<span class="string"><span class="delimiter">&quot;</span><span class="content">SELECT state, last_changed FROM states WHERE </span><span class="delimiter">&quot;</span></span> data = conn.execute("SELECT state, last_changed FROM states WHERE "
<span class="string"><span class="delimiter">&quot;</span><span class="content">entity_id = 'sensor.aare' AND last_changed BETWEEN </span><span class="delimiter">&quot;</span></span> "entity_id = 'sensor.aare' AND last_changed BETWEEN "
<span class="string"><span class="delimiter">&quot;</span><span class="content">'2016-07-05 00:00:00.000000' AND </span><span class="delimiter">&quot;</span></span> "'2016-07-05 00:00:00.000000' AND "
<span class="string"><span class="delimiter">&quot;</span><span class="content">'2016-07-07 00:00:00.000000'</span><span class="delimiter">&quot;</span></span>) "'2016-07-07 00:00:00.000000'")
<span class="keyword">for</span> x <span class="keyword">in</span> data: for x in data:
timestamps.append(dates.date2num(dt.parse_datetime(x[<span class="integer">1</span>]))) timestamps.append(dates.date2num(dt.parse_datetime(x[1])))
values.append(<span class="predefined">float</span>(x[<span class="integer">0</span>])) values.append(float(x[0]))
plt.plot_date(x=timestamps, y=values, fmt=<span class="string"><span class="delimiter">&quot;</span><span class="content">r-</span><span class="delimiter">&quot;</span></span>) plt.plot_date(x=timestamps, y=values, fmt="r-")
plt.ylabel(<span class="string"><span class="delimiter">'</span><span class="content">Temperature</span><span class="delimiter">'</span></span>) plt.ylabel('Temperature')
plt.xlabel(<span class="string"><span class="delimiter">'</span><span class="content">Time line</span><span class="delimiter">'</span></span>) plt.xlabel('Time line')
plt.savefig(<span class="string"><span class="delimiter">'</span><span class="content">sensor.png</span><span class="delimiter">'</span></span>) plt.savefig('sensor.png')
</pre></div> ```
</div>
</div>
<p>Creating a connection to the database and executing a query is similar to the ways already seen. The return values from the query are splitted into two lists. The time stamps must be converted in an value which is accepted by matplotlib and then the graph is generated and saved as image.</p> Creating a connection to the database and executing a query is similar to the ways already seen. The return values from the query are splitted into two lists. The time stamps must be converted in an value which is accepted by matplotlib and then the graph is generated and saved as image.
<p class="img"> <p class='img'>
<img src="https://home-assistant.io/images/blog/2016-07-reporting/mpl-sensor.png" /> <img src='https://home-assistant.io/images/blog/2016-07-reporting/mpl-sensor.png' />
Sensor graph generated by matplotlib Sensor graph generated by matplotlib
</p> </p>
<p>Most of the graphs are pretty ugly. So, further beautification will be needed. If you have created a nice report including some amazing graphs then the Home Assistant community would be grateful for sharing them in our <a href="https://community.home-assistant.io/">forum</a>.</p> Most of the graphs are pretty ugly. So, further beautification will be needed. If you have created a nice report including some amazing graphs then the Home Assistant community would be grateful for sharing them in our [forum](https://community.home-assistant.io/).
]]></content> ]]></content>
</entry> </entry>

View file

@ -268,7 +268,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

File diff suppressed because it is too large Load diff

View file

@ -107,7 +107,7 @@
</time> </time>
</div> </div>
<div class="grid__item four-fifths palm-one-whole"> <div class="grid__item four-fifths palm-one-whole">
<h1 class="gamma"><a href="/blog/2016/02/09/smarter-smart-things-with-mqtt-and-home-assistant/">Smarter SmartThings with MQTT and Home Assistant</a></h1> <h1 class="gamma"><a href="/blog/2016/02/09/Smarter-Smart-Things-with-MQTT-and-Home-Assistant/">Smarter SmartThings with MQTT and Home Assistant</a></h1>
<footer class="meta"> <footer class="meta">
<span> <span>
@ -273,7 +273,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Organisation | Home Assistant]]></title> <title><![CDATA[Category: Organisation | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/organisation/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/organisation/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2016-08-22T07:26:42+00:00</updated> <updated>2016-08-22T08:20:27+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>
@ -18,33 +18,35 @@
<link href="https://home-assistant.io/blog/2016/04/19/to-infinity-and-beyond/"/> <link href="https://home-assistant.io/blog/2016/04/19/to-infinity-and-beyond/"/>
<updated>2016-04-19T05:44:00+00:00</updated> <updated>2016-04-19T05:44:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/04/19/to-infinity-and-beyond</id> <id>https://home-assistant.io/blog/2016/04/19/to-infinity-and-beyond</id>
<content type="html"><![CDATA[<p>After 2.5 years I think we can proudly say: Home Assistant is a success. I write <em>we</em> because Home Assistant is no longer a one-person side project. It has become the side project of many people who spend countless hours on making Home Assistant the best home automation software out there. To acknowledge this we migrated the repositories from being under my name to be under our own <a href="https://github.com/home-assistant/">organisation on GitHub</a>.</p> <content type="html"><![CDATA[After 2.5 years I think we can proudly say: Home Assistant is a success. I write _we_ because Home Assistant is no longer a one-person side project. It has become the side project of many people who spend countless hours on making Home Assistant the best home automation software out there. To acknowledge this we migrated the repositories from being under my name to be under our own [organisation on GitHub][gh-ha].
<p>On our journey weve reached many noteworthy milestones:</p> On our journey we've reached many noteworthy milestones:
<ul> - #1 on HackerNews
<li>#1 on HackerNews</li> - Featured on ProductHunt
<li>Featured on ProductHunt</li> - Trending repository on GitHub
<li>Trending repository on GitHub</li> - 3000 stars on GitHub
<li>3000 stars on GitHub</li> - 1.5 million page views on our website
<li>1.5 million page views on our website</li> - Speaker at OpenIoT Summit 2016
<li>Speaker at OpenIoT Summit 2016</li>
</ul>
<p>All these accomplishments are a nice pat on the back but our journey is far from over. There are a lot of challenges ahead if we want to become the go to solution for home automation <em>for everyone</em>.</p> All these accomplishments are a nice pat on the back but our journey is far from over. There are a lot of challenges ahead if we want to become the go to solution for home automation _for everyone_.
<p>Until now the focus has been on making a platform that developers love to use. A platform that is simple but customizable. A platform that is both powerful and reliable. But most important: a platform that is local and open. Home Assistant does a great job at all these things.</p> Until now the focus has been on making a platform that developers love to use. A platform that is simple but customizable. A platform that is both powerful and reliable. But most important: a platform that is local and open. Home Assistant does a great job at all these things.
<p>There will be some major challenges ahead of us to target groups other than developers. Easy installation and easy configuration being the #1. Im sure that well be able to eventually achieve these goals. I cant say yet how or when. As with everything Home Assistant, well take tiny steps, gathering feedback along the way to make sure were solving the right problems.</p> There will be some major challenges ahead of us to target groups other than developers. Easy installation and easy configuration being the #1. I'm sure that we'll be able to eventually achieve these goals. I can't say yet how or when. As with everything Home Assistant, we'll take tiny steps, gathering feedback along the way to make sure we're solving the right problems.
<p>I am confident that we will get there because we are set up for success: we have a robust architecture, high test coverage and an active community of world class developers and users. On top of that, we use Python which allows us to move fast and tackle complex problems in elegant ways. It is so easy to learn that it allows any programmer, experienced or not, to contribute support for devices and services. Its as simple as <a href="/developers/platform_example_sensor/#code">filling in the blanks</a>.</p> I am confident that we will get there because we are set up for success: we have a robust architecture, high test coverage and an active community of world class developers and users. On top of that, we use Python which allows us to move fast and tackle complex problems in elegant ways. It is so easy to learn that it allows any programmer, experienced or not, to contribute support for devices and services. It's as simple as [filling in the blanks].
<p>I would like to put out a big thank you to all our contributors who make Home Assistant what it is today. It doesnt matter if it is form of code, documentation or giving support in our <a href="https://gitter.im/home-assistant/home-assistant">chat room</a> or <a href="https://community.home-assistant.io/">forums</a>. You. all. rock.</p> I would like to put out a big thank you to all our contributors who make Home Assistant what it is today. It doesn't matter if it is form of code, documentation or giving support in our [chat room] or [forums]. You. all. rock.
<p>Cheers to the future!</p> Cheers to the future!
<p>Paulus</p> Paulus
[gh-ha]: https://github.com/home-assistant/
[filling in the blanks]: /developers/platform_example_sensor/#code
[chat room]: https://gitter.im/home-assistant/home-assistant
[forums]: https://community.home-assistant.io/
]]></content> ]]></content>
</entry> </entry>
@ -53,12 +55,12 @@
<link href="https://home-assistant.io/blog/2015/03/08/new-logo/"/> <link href="https://home-assistant.io/blog/2015/03/08/new-logo/"/>
<updated>2015-03-08T22:16:10+00:00</updated> <updated>2015-03-08T22:16:10+00:00</updated>
<id>https://home-assistant.io/blog/2015/03/08/new-logo</id> <id>https://home-assistant.io/blog/2015/03/08/new-logo</id>
<content type="html"><![CDATA[<p>It is well known that you are either a good programmer or a good designer. Its rare youll meet someone that is both. Thats why it wasnt surprising to anyone that the logo that I made was mediocre — at best. Luckily, <a href="http://jeremygeltman.com/">Jeremy Geltman</a> has come to the rescue and contributed a brand new logo for Home Assistant.</p> <content type="html"><![CDATA[It is well known that you are either a good programmer or a good designer. It's rare you'll meet someone that is both. That's why it wasn't surprising to anyone that the logo that I made was mediocre &mdash; at best. Luckily, [Jeremy Geltman](http://jeremygeltman.com/) has come to the rescue and contributed a brand new logo for Home Assistant.
<p>The new logo follows Googles material design spec. It uses the blue color that Home Assistant uses in the interface and it comes in two versions: a high detailed version (for homescreen icon etc) and a simple version (for favicon etc).</p> The new logo follows Googles material design spec. It uses the blue color that Home Assistant uses in the interface and it comes in two versions: a high detailed version (for homescreen icon etc) and a simple version (for favicon etc).
<p class="img"> <p class='img'>
<img src="/images/blog/ha-logo-history.png" /> <img src='/images/blog/ha-logo-history.png' />
The old logo, the new detailed logo and the new simple logo. The old logo, the new detailed logo and the new simple logo.
</p> </p>
]]></content> ]]></content>

View file

@ -233,7 +233,7 @@
<li class="post"> <li class="post">
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a> <a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
</li> </li>

Some files were not shown because too many files have changed in this diff Show more