home-assistant.github.io/atom.xml
2016-08-28 17:28:43 +00:00

1765 lines
179 KiB
XML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title><![CDATA[Home Assistant]]></title>
<link href="https://home-assistant.io/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/>
<updated>2016-08-28T17:27:05+00:00</updated>
<id>https://home-assistant.io/</id>
<author>
<name><![CDATA[Home Assistant]]></name>
</author>
<generator uri="http://octopress.org/">Octopress</generator>
<entry>
<title type="html"><![CDATA[0.27 is here to break eggs and take names: notifications, Hue fakery, safety and unification come to Home Assistant]]></title>
<link href="https://home-assistant.io/blog/2016/08/28/notifications-hue-fake-unification/"/>
<updated>2016-08-28T03:30:25+00:00</updated>
<id>https://home-assistant.io/blog/2016/08/28/notifications-hue-fake-unification</id>
<content type="html"><![CDATA[<p>This weeks blog post could only be possibly described by exactly one hashtag:</p>
<h1>#Amazing</h1>
<p><sup>or <sup>maybe<sup>#supersized</sup></sup></sup></p>
<p>Keep reading to see what <strong>#Amazing</strong> things we have in store for you this week 😄! And make sure you read all the way to the end, because I left a present down there for those committed few among you :)</p>
<p>But first…</p>
<h2><a class="title-link" name="some-general-housekeeping" href="#some-general-housekeeping"></a> Some general housekeeping</h2>
<p>Paulus (<a href="https://github.com/balloob">@balloob</a>) is on vacation in Europe this week, so you will all have to deal with me, Robbie (<a href="https://github.com/robbiet480">@robbiet480</a>) for this release blog post. Dont worry, Paulus will be back to tearing apart your pull requests in no time 😈.</p>
<p>Special thanks to my awesome helpers for this weeks release who are looking over my shoulder to make sure Im crossing my ts and dotting my is: <a href="https://github.com/Teagan42">@Teagan42</a>, <a href="https://github.com/infamy">@infamy</a> and <a href="https://github.com/fabaff">@fabaff</a>.</p>
<p>For my next trick, lets hand out some…</p>
<h2><a class="title-link" name="trophies" href="#trophies"></a> Trophies</h2>
<p>I felt that I had to 1-up Paulus (<a href="https://github.com/balloob">@balloob</a>) somehow with his 500,000 pageviews stat he shared in the <a href="https://home-assistant.io/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26 blog post</a>, so I pushed myself and our development community as a whole super hard the last two weeks to put a lot of love into Home Assistant to bring you not just one, but six <strong>#Amazing</strong> stats for this release. As of 0.27, we have now surpassed the following milestones:</p>
<ul>
<li><a href="https://travis-ci.org/home-assistant/home-assistant/builds/154660811">10,000</a> builds on Travis (congrats to <a href="https://github.com/BluGeni">@BluGeni</a>)</li>
<li><a href="https://github.com/home-assistant/home-assistant/pull/3000">3,000</a> issues and pull requests (thanks <a href="https://github.com/kellerza">@kellerza</a>!)</li>
<li><a href="https://github.com/home-assistant/home-assistant/pull/2991">2,000</a> pull requests alone (awesome <a href="https://github.com/fabaff">@fabaff</a>!!)</li>
<li>900 forks on Github!</li>
</ul>
<p>In addition,</p>
<ul>
<li>We are very close to 4,000 stars on Github!</li>
<li><a href="https://github.com/home-assistant/home-assistant/graphs/contributors">Im now #5 contributor by most commits!!!</a> Hey wait, howd this get in here 😳…</li>
</ul>
<p>Now that we have that great news out of the way, onto this weeks release which is going to keep the <strong>#Amazing</strong> gravy train rolling right along and get to the stuff you all <em>really</em> are here for.</p>
<h2><a class="title-link" name="027" href="#027"></a> 0.27</h2>
<p>While this release is <strong>#Amazing</strong>, we had to break a few eggs (now you understand the title reference!) to make a beautiful omelette (using home automation obviously) so some platforms and components have needed to introduce breaking changes. Please make sure to read the <a href="#breaking-changes">Breaking Changes</a> section below.</p>
<h3><a class="title-link" name="hue-bridge-emulation" href="#hue-bridge-emulation"></a> Hue Bridge Emulation</h3>
<p>Thanks to <a href="https://github.com/mgbowen">@mgbowen</a> we now have the functionality previously provided by <a href="https://github.com/blocke">@blocke</a>s <a href="https://github.com/blocke/ha-local-echo">ha-local-echo</a> <a href="https://home-assistant.io/components/emulated_hue/">built right into Home Assistant</a>! This means that for those of you with devices that either lack or have a subpar integration with Home Assistant (looking at you Amazon Echo) you can now have a better experience by having your Home Assistant pretend to be a Hue Bridge. Personally, I have used <a href="https://github.com/auchter">@auchter</a>s <a href="https://github.com/auchter/haaska">Haaska</a> previously but found that it was slow to respond and sometimes failed entirely. With the new <a href="https://home-assistant.io/components/emulated_hue/"><code class="highlighter-rouge">emulated_hue</code></a> component, you can have local control of entities through Amazon Echo.</p>
<h3><a class="title-link" name="notification-improvements" href="#notification-improvements"></a> Notification improvements</h3>
<p>We have some excellent upgrades to the notification system coming to you in 0.27, courtesy of me, <a href="https://github.com/robbiet480">@robbiet480</a>.</p>
<h4><a class="title-link" name="html5-push-notifications" href="#html5-push-notifications"></a> HTML5 Push Notifications</h4>
<p>This release adds support for <a href="https://home-assistant.io/components/notify.html5/">HTML5</a> push notifications on Chrome/Firefox/Opera on both desktop and Android devices. This means that you can send a notification to your phone even when your Home Assistant is not open in your mobile browser. When using Chrome you can even include 2 action buttons so that you can control your Home Assistant from your phones lock screen, allowing you to do things like sound alarms or unlock your front door, all without leaving the notification. Thanks again to me (<a href="https://github.com/robbiet480">@robbiet480</a>) and Paulus (<a href="https://github.com/balloob">@balloob</a>) for all the hard work on this!</p>
<p class="img">
<img src="https://home-assistant.io/images/screenshots/html5-notify.png" />
</p>
<h4><a class="title-link" name="notification-groups" href="#notification-groups"></a> Notification Groups</h4>
<p>Using the new notify <code class="highlighter-rouge">group</code> platform allows you to cut down a lot of duplicate automation logic by combining multiple notification platforms and <code class="highlighter-rouge">target</code>s into a single notify service. Check out the <a href="https://home-assistant.io/components/notify.group/">docs</a> for more info.</p>
<h4><a class="title-link" name="target-is-no-longer-needed" href="#target-is-no-longer-needed"></a> <code class="highlighter-rouge">target</code> is no longer needed!</h4>
<p>For platforms that support it, starting with the new HTML5 platform, any <code class="highlighter-rouge">target</code>s that are available will be exposed as individual services, so no more having to remember which <code class="highlighter-rouge">target</code>s to use. Please note that the existing services also still exist so you can keep using <code class="highlighter-rouge">target</code> if you wish.</p>
<h3><a class="title-link" name="validate-configuration-before-restarting-home-assistant" href="#validate-configuration-before-restarting-home-assistant"></a> Validate configuration before restarting Home Assistant</h3>
<p>Ever restarted Home Assistant to test a configuration change just to find out there is a validation error? Well, not anymore! <a href="https://github.com/kellerza">@kellerza</a> has added a command line script that will validate your configuration as if you started Home Assistant.</p>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>hass --script check_config
</code></pre>
</div>
<h3><a class="title-link" name="configuration-validation" href="#configuration-validation"></a> Configuration validation</h3>
<p>This release includes a big push on making sure all platforms contain proper configuration validation. This should help in getting your configuration right. Thanks to <a href="https://github.com/fabaff">@fabaff</a>, <a href="https://github.com/pavoni">@pavoni</a>, <a href="https://github.com/pvizeli">@pvizeli</a>, <a href="https://github.com/nkgilley">@nkgilley</a> for all the hard work on this, you all rock!</p>
<p class="img">
<img src="https://home-assistant.io/images/screenshots/config-validation.png" />
</p>
<h3><a class="title-link" name="ffmpeg-motionnoise-sensing" href="#ffmpeg-motionnoise-sensing"></a> FFMpeg motion/noise sensing</h3>
<p>Its now possible to use <a href="https://home-assistant.io/components/binary_sensor.ffmpeg/">FFMpeg</a> to monitor a video stream and detect motion thanks to a new binary sensor platform by <a href="https://github.com/pvizeli">@pvizeli</a>.</p>
<h3><a class="title-link" name="component-clean-up---thermostat--hvac---climate-rollershutter--garage-door---cover" href="#component-clean-up---thermostat--hvac---climate-rollershutter--garage-door---cover"></a> Component clean up - Thermostat &amp; HVAC -&gt; Climate. Rollershutter &amp; Garage Door -&gt; Cover.</h3>
<p>Due to our wild growth we ended up with a few components that had a lot of overlapping functionality. <a href="https://github.com/turbokongen">@turbokongen</a> took on the hard job on merging them. Thermostat and HVAC platforms are now combined under the new Climate component. Rollershutter and Garage Door platforms are now combined under the new Cover component. You can easily upgrade by just swapping out the name. For example replace <code class="highlighter-rouge">thermostat</code> with <code class="highlighter-rouge">climate</code>. The old components have been deprecated and will be removed in the near future.</p>
<h3><a class="title-link" name="a-new-fan-component" href="#a-new-fan-component"></a> A new <code class="highlighter-rouge">fan</code> component</h3>
<p>Along with the new <code class="highlighter-rouge">climate</code> component, <a href="https://github.com/Teagan42">@Teagan42</a> and I (<a href="https://github.com/robbiet480">@robbiet480</a>) decided we needed something simpler to just control a fan. Currently it has support for controlling Insteon fans. MQTT support will appear in 0.28.0. I tried to get it implemented before 0.27.0 but spent too long writing this blog post 😢.</p>
<h3><a class="title-link" name="all-changes" href="#all-changes"></a> All changes</h3>
<p><img src="https://home-assistant.io/images/supported_brands/html5.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="100" /><img src="https://home-assistant.io/images/supported_brands/mqtt.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="100" /><img src="https://home-assistant.io/images/supported_brands/hewlett_packard_enterprise.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="100" /><img src="https://home-assistant.io/images/supported_brands/wunderground.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="100" /></p>
<ul>
<li>Merge thermostat and HVAC components into new <a href="https://home-assistant.io/components/climate/">climate</a> component (<a href="https://github.com/turbokongen">@turbokongen</a>)</li>
<li>Merge rollershutter and garage door components into new <a href="https://home-assistant.io/components/cover/">cover</a> component (<a href="https://github.com/turbokongen">@turbokongen</a>)</li>
<li>Alarm Control Panel - Manual: Allow returning to previous state after <a href="https://home-assistant.io/components/alarm_control_panel.manual/">trigger</a> (<a href="https://github.com/tobiebooth">@tobiebooth</a>)</li>
<li>Sensor - DHT: Allow range <a href="https://home-assistant.io/components/sensor.dht/">checking</a> (<a href="https://github.com/open-homeautomation">@open-homeautomation</a>)</li>
<li>Light entities will now <a href="https://home-assistant.io/components/light/">expose</a> their features (<a href="https://github.com/shmuelzon">@shmuelzon</a>)</li>
<li>Sensor: Monitor HP ILO sensors on <a href="https://home-assistant.io/components/sensor.hp_ilo/">HP</a> servers (<a href="https://github.com/Juggels">@Juggels</a>)</li>
<li>Sensor: Monitor <a href="https://home-assistant.io/components/sensor.fritzbox_callmonitor/">Fritzbox</a> Calls (<a href="https://github.com/DavidMStraub">@DavidMStraub</a>)</li>
<li>Notify: LlamaLab <a href="https://home-assistant.io/components/notify.llamalab_automate/">Automate</a> is now supported (<a href="https://github.com/danielperna84">@danielperna84</a>)</li>
<li>Sensor: Serial <a href="https://home-assistant.io/components/sensor.mhz19/">CO2</a> sensors now supported (<a href="https://github.com/open-homeautomation">@open-homeautomation</a>)</li>
<li>Sensor: MQTT room <a href="https://home-assistant.io/components/sensor.mqtt_room">presence</a> detection (<a href="https://github.com/mKerix">@mKerix</a>)</li>
<li>Notify: New group platform allows <a href="https://home-assistant.io/components/notify.group/">grouping</a> notify targets across platforms (<a href="https://github.com/robbiet480">@robbiet480</a>)</li>
<li><a href="https://home-assistant.io/components/notify.html5/">HTML5</a> push notifications (<a href="https://github.com/robbiet480">@robbiet480</a>, <a href="https://github.com/balloob">@balloob</a>)</li>
<li>Weather: <a href="https://home-assistant.io/components/sensor.wunderground/">Wunderground</a> now supported (<a href="https://github.com/arsaboo">@arsaboo</a>, <a href="https://github.com/Teagan42">@Teagan42</a>)</li>
<li>New check config script to test validity before restarting HA (<a href="https://github.com/kellerza">@kellerza</a>)</li>
<li>Binary Sensor: Allow <a href="https://home-assistant.io/components/binary_sensor.ffmpeg/">monitoring</a> a camera feed using FFMpeg (<a href="https://github.com/pvizeli">@pvizeli</a>)</li>
<li>Cover: Z-Wave platform now supports <a href="https://home-assistant.io/components/cover.zwave/">positions</a> (<a href="https://github.com/nunofgs">@nunofgs</a>)</li>
<li>Device tracker: allow using <a href="https://home-assistant.io/components/device_tracker/">Gravatar</a> for entity picture (<a href="https://github.com/robbiet480">@robbiet480</a>)</li>
<li>Notify: platforms with known targets will expose them as standalone services (<a href="https://github.com/robbiet480">@robbiet480</a>)</li>
<li>Camera: <a href="https://home-assistant.io/components/camera.mjpeg/">MJPEG</a> and <a href="https://home-assistant.io/components/camera.generic/">Generic</a> cameras can now authenticate using digest auth (<a href="https://github.com/meatz">@meatz</a>)</li>
<li>Weather: Forecast.io now can show daily temp/precip <a href="https://home-assistant.io/components/sensor.forecast/">forecast</a> values (<a href="https://github.com/DavidMStraub">@DavidMStraub</a>)</li>
<li>Media Player: WebOS TV now allows <a href="https://home-assistant.io/components/media_player.webostv/">customizing</a> the sources (<a href="ttps://github.com/roidayan">@roidayan</a>)</li>
<li>Device tracker: Allow tracking devices using <a href="https://home-assistant.io/components/device_tracker.bluetooth_le_tracker/">Bluetooth</a> Low-Energy (<a href="https://github.com/open-homeautomation">@open-homeautomation</a>)</li>
<li>Notify: Ensure <a href="https://home-assistant.io/components/notify.slack/">Slack</a> messages appear as correct user (<a href="https://github.com/technicalpickles">@technicalpickles</a>)</li>
<li>YAML: <a href="https://home-assistant.io/topics/secrets/">Secrets</a> will look for values in all parents folders up to the config root folder (<a href="https://github.com/Teagan42">@Teagan42</a>)</li>
<li>Camera: Generic camera now supports <a href="https://home-assistant.io/components/camera.generic/">template</a> support (<a href="https://github.com/balloob">@balloob</a>)</li>
<li>Slack: Allow sending <a href="https://home-assistant.io/components/notify.slack/">attachments</a> (<a href="https://github.com/technicalpickles">@technicalpickles</a>)</li>
<li>Device Tracking: TP-Link Archer C7 5 GHz devices will now also be <a href="https://home-assistant.io/components/device_tracker.tplink/">found</a> (<a href="https://github.com/dpford">@dpford</a>)</li>
<li>Z-Wave: New rename <a href="https://home-assistant.io/components/zwave/">node</a> service added (<a href="https://github.com/jnewland">@jnewland</a>)</li>
<li>Wink: <a href="https://home-assistant.io/components/wink/">Bug</a> fixes (<a href="https://github.com/w1ll1am23">@w1ll1am23</a>)</li>
<li>Homematic: new device and controller variable <a href="https://home-assistant.io/components/homematic/">support</a> (<a href="https://github.com/danielperna84">@danielperna84</a>, <a href="https://github.com/pvizeli">@pvizeli</a>, <a href="https://github.com/mcdeck">@mcdeck</a>)</li>
<li>Allow emulating a <a href="https://home-assistant.io/components/emulated_hue/">Hue</a> bridge to control entities (<a href="https://github.com/mgbowen">@mgbowen</a>)</li>
<li>New <a href="https://home-assistant.io/components/fan/">Fan</a> component (<a href="https://github.com/Teagan42">@Teagan42</a>, <a href="https://github.com/robbiet480">@robbiet480</a>)</li>
</ul>
<h3><a class="title-link" name="breaking-changes" href="#breaking-changes"></a> Breaking changes</h3>
<ul>
<li>Ecobee3 occupancy sensors have moved from sensor platform to binary sensor platform.</li>
<li>Forecast.io entity IDs are now like <code class="highlighter-rouge">sensor.forecastio_temperature</code>. Previously they were like <code class="highlighter-rouge">sensor.weather_temperature</code>. Apologies for this change, but we needed to make Forecast.io more generic now that we have many weather platforms.</li>
<li>The <a href="https://home-assistant.io/components/sensor.loop_energy/">Loop Energy</a> sensor configuration format changed slightly, please reformat based on the revised documentation.</li>
<li>The configuration for the <a href="https://home-assistant.io/components/sensor.sabnzbd/">SABnzbd</a> sensor has slightly changed. The prefix <code class="highlighter-rouge">type:</code> is no longer required for monitored variables.</li>
<li>The <a href="https://home-assistant.io/components/sensor.imap/">IMAP</a> sensor now uses <code class="highlighter-rouge">username</code> instead of <code class="highlighter-rouge">user</code>.</li>
<li>The <a href="https://home-assistant.io/components/sensor.nzbget/">NZBGet</a> sensor has had so many changes I cant list them all. Please refer to the documentation for more info.</li>
</ul>
<h3><a class="title-link" name="deprecations" href="#deprecations"></a> Deprecations</h3>
<ul>
<li>Using the <code class="highlighter-rouge">thermostat</code> and <code class="highlighter-rouge">hvac</code> components has been deprecated. Please migrate to the new <code class="highlighter-rouge">climate</code> component. (just change the component name, the configurations are compatible)</li>
<li>Using the <code class="highlighter-rouge">rollershutter</code> and <code class="highlighter-rouge">garage_door</code> components have also been deprecated. Please migrate to the new <code class="highlighter-rouge">cover</code> component. (just change the component name, the configurations are compatible)</li>
</ul>
<h2><a class="title-link" name="finishing-up" href="#finishing-up"></a> Finishing up</h2>
<p>Thanks all for sticking with me to the end. Ill be taking over a lot of Pauluss (<a href="https://github.com/balloob">@balloob</a>) work while he is gone, but as I said, dont worry because hell be back well before 0.28.0 comes out. Hopefully you didnt find this jovial blog post too jarring from our standard style, I just wrote a lot of this at 2am after being awake for almost 20 hours, so Im a little loopy hahaha 😴.</p>
<p>Also, thanks as always to our developer contributors, documentation contributors, but most of all our users! This wouldve just been a script that Paulus (@balloob) used to control his lights at home if we didnt have your enthusiasm.</p>
<p>Feel free to let me know what you thought of this blog post and release on Gitter or my <a href="https://twitter.com/robbie">Twitter</a>, or even the <a href="https://twitter.com/home_assistant">Home Assistant Twitter</a>. Did I mention we have a brand new <a href="https://www.facebook.com/homeassistantio">Facebook page</a> that you should absolutely Like? Theres a convenient Facebook Like and Twitter follow button right on the sidebar.</p>
<p>I almost forgot about your 🎁 for reading all the way to here: a 🍪! Hope you enjoy it in good health 😄.</p>
<p>Talk to you soon on Gitter and in your pull request comments!</p>
<p> Robbie</p>
<p>(p.s. To those of you that scrolled directly to the bottom to get your present, just know that you didnt earn it like the others did. 😄)</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Github-style calendar heatmap of device data]]></title>
<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>
<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>
<p class="img">
<img src="https://home-assistant.io/images/blog/2016-08-data-exploration/heatmap.png" />
Heatmap
</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[We Have Apps Now]]></title>
<link href="https://home-assistant.io/blog/2016/08/16/we-have-apps-now/"/>
<updated>2016-08-16T10:00:00+00:00</updated>
<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 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>
<!--more-->
<h2><a class="title-link" name="another-take-on-automation" href="#another-take-on-automation"></a> Another Take on Automation</h2>
<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>
<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>
<ul>
<li>Can the system respond to presence or absence of people?</li>
<li>Can I turn a light on at Sunset +/- a certain amount of time?</li>
<li>Can I arrive home in light or dark and have the lights figure out if they should be on or off?</li>
<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>
<li>Is it open and expandable?</li>
<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>
<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>
<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 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>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>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>
</ul>
<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>
<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>
<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="language-python highlighter-rouge"><pre class="highlight"><code><span class="kn">import</span> <span class="nn">appapi</span>
<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="k">def</span> <span class="nf">initialize</span><span class="p">(</span><span class="bp">self</span><span class="p">):</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="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="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="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>
<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>
<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>
<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>
<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="language-python highlighter-rouge"><pre class="highlight"><code><span class="kn">import</span> <span class="nn">appapi</span>
<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="k">def</span> <span class="nf">initialize</span><span class="p">(</span><span class="bp">self</span><span class="p">):</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="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="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">sun_down</span><span class="p">():</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="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="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="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>
</code></pre>
</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 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="language-python highlighter-rouge"><pre class="highlight"><code><span class="kn">import</span> <span class="nn">appapi</span>
<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="k">def</span> <span class="nf">initialize</span><span class="p">(</span><span class="bp">self</span><span class="p">):</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="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="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="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="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="bp">self</span><span class="o">.</span><span class="n">flashcount</span> <span class="o">=</span> <span class="mi">0</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="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="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="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="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="bp">self</span><span class="o">.</span><span class="n">flashcount</span> <span class="o">+=</span> <span class="mi">1</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="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>
</code></pre>
</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 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 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>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>
</entry>
<entry>
<title type="html"><![CDATA[0.26: Foursquare, Fast.com, FFMPEG and GPSD]]></title>
<link href="https://home-assistant.io/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/"/>
<updated>2016-08-13T19:00:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd</id>
<content type="html"><![CDATA[<p>Its time for 0.26 and its again full of new features and fixes. First I want to highlight that we are now having 500 000 monthly pageviews on the website. A big milestone for us! Its been an amazing journey. Big thanks to the Home Assistant community for being such a delightful bunch.</p>
<p>This release includes code contributed by 31 different people. The biggest change in this release is a new unit system. Instead of picking Celsius or Fahrenheit youll have to pick imperial or metric now. This influences the units for your temperature, distance, and weight. This will simplify any platform or component that needs to know this information. Big thanks to <a href="https://github.com/Teagan42">@Teagan42</a> for her hard work on this!</p>
<p><img src="https://home-assistant.io/images/supported_brands/foursquare.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="100" /><img src="https://home-assistant.io/images/supported_brands/ohmconnect.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="100" /><img src="https://home-assistant.io/images/supported_brands/fastdotcom.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="100" /><img src="https://home-assistant.io/images/supported_brands/gpsd.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="100" /><img src="https://home-assistant.io/images/supported_brands/ffmpeg.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="100" /></p>
<ul>
<li>Core: Introduce notion of unit system (deprecates temperature unit option) (<a href="https://github.com/Teagan42">@Teagan42</a>)</li>
<li>Front end: Speed improvements (<a href="https://github.com/balloob">@balloob</a>)</li>
<li>Front end: Improve layout of state dev tool (<a href="https://github.com/balloob">@balloob</a>)</li>
<li><a href="https://home-assistant.io/components/proximity/">Proximity</a>: Allow definition of unit of measurement (<a href="https://github.com/Teagan42">@Teagan42</a>)</li>
<li><a href="https://home-assistant.io/components/switch.flux/">Flux</a>: Add mired and kelvin mode (<a href="https://github.com/HBDK">@HBDK</a>)</li>
<li>Thermostat - <a href="https://home-assistant.io/components/thermostat.proliphix/">Proliphix</a>: Support for cooling (<a href="https://github.com/sdague">@sdague</a>)</li>
<li>Media Player - <a href="https://home-assistant.io/components/media_player.lg_netcast/">LG Netcast TV</a>: Show screenshot of what is currently playing (<a href="https://github.com/shmuelzon">@shmuelzon</a>)</li>
<li>Z-Wave improvements (<a href="https://github.com/jnewland">@jnewland</a>, <a href="https://github.com/turbokongen">@turbokongen</a>)</li>
<li>Thermostat - <a href="https://home-assistant.io/components/thermostat.heat_control/">heat control</a>: now also able to control an AC (<a href="https://github.com/mtreinish">@mtreinish</a>)</li>
<li>Thermostat - <a href="https://home-assistant.io/components/thermostat.heat_control/">heat control</a>: allow specifying a minimum duration before switching (<a href="https://github.com/mtreinish">@mtreinish</a>)</li>
<li><a href="https://home-assistant.io/components/influxdb/">InfluxDB</a>: Whitelist entities option added (<a href="https://github.com/tchellomello">@tchellomello</a>)</li>
<li>Sensor: Serial <a href="https://home-assistant.io/components/sensor.serial_pm/">particulate matters</a> sensors now supported (<a href="https://github.com/open-homeautomation">@open-homeautomation</a>)</li>
<li>Sensor - <a href="https://home-assistant.io/components/sensor.fitbit/">Fitbit</a>: Fix unit system (<a href="https://github.com/tchellomello">@tchellomello</a>)</li>
<li>Light - <a href="https://home-assistant.io/components/light.flux_led/">Flux LED</a>: Add support for [color and brightness][color] (<a href="https://github.com/Danielhiversen">@Danielhiversen</a>)</li>
<li>Media Player - <a href="https://home-assistant.io/components/media_player.plex/">Plex</a>: Now able to report on music (<a href="https://github.com/abcminiuser">@abcminiuser</a>)</li>
<li>Alarm Control Panel - <a href="https://home-assistant.io/components/alarm_control_panel.verisure/">Verisure</a>: Now able to see who changed the alarm (<a href="https://github.com/persandtrom">@persandtrom</a>)</li>
<li>Thermostat - <a href="https://home-assistant.io/components/thermostat.honeywell/">Honeywell</a>: Add option to read and control HVAC mode (<a href="https://github.com/Teagan42">@Teagan42</a>)</li>
<li><a href="https://home-assistant.io/components/foursquare/">Foursquare</a> component to receive instant notifications of checkins (<a href="https://github.com/robbiet480">@robbiet480</a>)</li>
<li>Camera: New <a href="https://home-assistant.io/components/camera.ffmpeg/">FFMPEG</a> platform allows to stream anything through front end (<a href="https://github.com/pvizeli">@pvizeli</a>)</li>
<li>Manage <a href="https://home-assistant.io/topics/secrets/">secrets</a> with new command line script (<a href="https://github.com/kellerza">@kellerza</a>)</li>
<li>Notify - <a href="https://home-assistant.io/components/notify.smtp/">SMTP</a>: Allow embedding of images (<a href="https://github.com/partofthething">@partofthething</a>)</li>
<li>Sensor: <a href="https://home-assistant.io/components/sensor.ohmconnect/">OhmConnect</a> is now supported (<a href="https://github.com/robbiet480">@robbiet480</a>)</li>
<li><a href="https://home-assistant.io/components/panel_custom/">panel_custom</a> component allows the registering of new panels (<a href="https://github.com/balloob">@balloob</a>)</li>
<li>Light: New <a href="https://home-assistant.io/components/light.mqtt_json/">mqtt_json</a> platform for working with JSON payload (<a href="https://github.com/corbanmailloux">@corbanmailloux</a>)</li>
<li>Sensor: New <a href="https://home-assistant.io/components/sensor.fastdotcom/">Fast.com</a> platform to measure network bandwidth performance (<a href="https://github.com/nkgilley">@nkgilley</a>)</li>
<li>New <a href="https://home-assistant.io/components/pilight/">pilight</a> component to control 433 Mz devices (<a href="https://github.com/DavidLP">@DavidLP</a>)</li>
<li>Sensor: <a href="https://home-assistant.io/components/sensor.gpsd/">GPSD</a> now supported (<a href="https://github.com/fabaff">@fabaff</a>)</li>
</ul>
<h3><a class="title-link" name="hotfix-0261---august-14" href="#hotfix-0261---august-14"></a> Hotfix 0.26.1 - August 14</h3>
<ul>
<li>Fix serial_pm config validation (<a href="https://github.com/open-homeautomation">@open-homeautomation</a>)</li>
<li>Check for existence of system mode on Honeywell thermostats (<a href="https://github.com/mKeRix">@mKeRix</a>)</li>
<li>Fix unknown unit of measurement for hvac and thermostat component (<a href="https://github.com/turbokongen">@turbokongen</a>)</li>
</ul>
<h3><a class="title-link" name="hotfix-0262---august-15" href="#hotfix-0262---august-15"></a> Hotfix 0.26.2 - August 15</h3>
<ul>
<li>Fix Wemo: have PyWemo play nicely with the latest Requests (<a href="https://github.com/pavoni">@pavoni</a>)</li>
</ul>
<h3><a class="title-link" name="hotfix-0263---august-19" href="#hotfix-0263---august-19"></a> Hotfix 0.26.3 - August 19</h3>
<ul>
<li>Media Player cover art would not work when an API password was set. Thanks to <a href="https://github.com/maddox">@maddox</a> for reporting it and <a href="https://github.com/balloob">@balloob</a> for the fix.</li>
</ul>
<h3><a class="title-link" name="breaking-changes" href="#breaking-changes"></a> Breaking changes</h3>
<ul>
<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>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Configuration.yaml example</span>
<span class="s">homeassistant</span><span class="pi">:</span>
<span class="c1"># '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>
</code></pre>
</div>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Optimizing the Home Assistant mobile web app]]></title>
<link href="https://home-assistant.io/blog/2016/08/07/optimizing-the-home-assistant-mobile-web-app/"/>
<updated>2016-08-07T19:36:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/08/07/optimizing-the-home-assistant-mobile-web-app</id>
<content type="html"><![CDATA[<p><em>This blog post will go into detail about the recent performance optimizations that went into the Home Assistant front end. For people not familiar with the app, check out <a href="https://home-assistant.io/demo">the demo</a> and <a href="https://github.com/home-assistant/home-assistant-polymer">the source</a>.</em></p>
<p>TL; DR: Dont hack the framework, separate responsibilities, ship less, use service workers, use (future) web standards.</p>
<p>This year at Google I/O I saw Monica from the Polymer team talk about web components and performance. In her talk <a href="https://www.youtube.com/watch?v=zfQoleQEa4w&amp;feature=youtu.be&amp;t=1380">she mentions a mantra</a> that they use in the Polymer team to make things fast: <strong>Do less and be lazy</strong>.</p>
<p>Do less and be lazy. It sounds so obvious and it took a while before it started to dawn on me. I think most of the code I write is pretty fast, but I dont often stop to take a harder look at how and when it runs in practice. When do we need the result, can it be postponed?</p>
<p>And thus started my journey to take a critical look at how the Home Assistant app was working and how to make things faster. Below is the list of the different things that I did to make it fast.</p>
<p>I hope this list can be useful to other people, as a guide for optimizing their own apps or for avoiding pitfalls when building a new one.</p>
<p>The first thing to do is to measure. The Home Assistant front end is a mobile web app, so we shouldnt measure this on a machine with 8 cores and gigabytes of ram but instead measure on devices you expect a mobile web app to run: phones. Below are two timelines recorded with Home Assistant 0.18.2 (pre-optimizations) and Google Chrome 53. <strong>On my Mac the app starts in 1400 miliseconds and on my Nexus 5x in ~6500 miliseconds (~4.5 times slower!).</strong></p>
<p class="img">
<img src="https://home-assistant.io/images/blog/2016-08-optimizing-web-app/performance-timeline-0.18.2.png" alt="Timeline of loading the front end in Home Assistant 0.18.2" />
</p>
<p>Although the app takes 6500 milliseconds to load on my phone, it would perform well afterwards. Still, that initial load is unacceptable. You expect to open an app on your phone and be able to use it, quickly. After I applied all the changes described below, I managed to reduce startup time to 900 miliseconds (-35%) on my Mac and 2400 miliseconds (-63%) on my Nexus 5x. <a href="https://home-assistant.io/demo">Check out the demo here.</a></p>
<p class="img">
<img src="https://home-assistant.io/images/blog/2016-08-optimizing-web-app/performance-diagram.png" alt="diagram showing old and new loading times next to one another" />
<img src="https://home-assistant.io/images/blog/2016-08-optimizing-web-app/performance-timeline-0.26.png" alt="Timeline of loading the front end in Home Assistant 0.26" />
</p>
<!--more-->
<h2><a class="title-link" name="technology" href="#technology"></a> Technology</h2>
<p>The Home Assistant front end consists of two parts. There is <a href="https://github.com/home-assistant/home-assistant-js">Home Assistant JS</a>, which controls all data and interaction between JavaScript and the server. It is a Flux architecture using <a href="https://optimizely.github.io/nuclear-js/">NuclearJS</a> and <a href="https://facebook.github.io/immutable-js/">ImmutableJS</a>. The UI is implemented by <a href="https://github.com/home-assistant/home-assistant-polymer">Home Assistant Polymer</a> using <a href="https://www.polymer-project.org/">Polymer</a> and web components.</p>
<h1><a class="title-link" name="dont-hack-the-framework" href="#dont-hack-the-framework"></a> Dont hack the framework</h1>
<p>I thought to be smart. I split out the JavaScript part of all web components and bundled them separately using Webpack so that I could use ES2015 via BabelJS (<a href="https://github.com/home-assistant/home-assistant-polymer/wiki/Using-Polymer-with-ES2015,-Babel-and-NPM">architecture</a>). This is not how Polymer components are written and it meant that I was unable to use any of the tooling that is available in the community or easily split up the bundle (more on this later).</p>
<p>So I went ahead and backported all my web components back from shiny beautiful ES6 to ES5. And you know what? Its not that bad. Yes, not being able to use the concise object notation and arrow functions make your code more verbose. But in the end it is the same code that is running in browsers.</p>
<p>Another benefit of having each web component contain their own script tag is that the browser will process them one by one, allowing the browser to render our loading spinner animation in between.</p>
<p>As you can see in the timelines, we were able to get rid of most of the blocking component loading.</p>
<p class="img">
<img src="https://home-assistant.io/images/blog/2016-08-optimizing-web-app/timeline-no-more-es2015.png" alt="Timeline of loading the front end before and after the optimization" />
</p>
<h1><a class="title-link" name="separate-responsibilities" href="#separate-responsibilities"></a> Separate responsibilities</h1>
<p>Whenever you learn a new technology, you feel like youve learned a new superpower. Wow, I can do all this with only 2 lines?! I had the same with bundling.</p>
<p>I was initially very focused on shipping just a single file with everything that my app needed. The entry point would be my main component which would require all of its Flux and UI dependencies. Then, just before it all would be rendered, it would check if there is authentication and start the data fetching.</p>
<p>This is a very bad pattern. This means that you will not start any data fetching until your UI is ready to render. Instead, you want your data to be fetched as soon as possible, and while the request is out to the server you want the page to load all your UI components.</p>
<p>To accomplish this I extracted the application core out of the main bundle. In the current optimized version its 31.1kb gzipd. It is loaded before any other scripts so that it can start fetching data as soon as possible.</p>
<p class="img">
<img src="https://home-assistant.io/images/blog/2016-08-optimizing-web-app/timeline-corejs.png" alt="Timeline of loading the front end before and after the optimization" />
</p>
<p>When the data does come back before the UI is done loading, we can process it before we start rendering the UI because of all the web components being processed individually. This means that we dont have to show a loading screen the first time our components render we can just render the components with the data they require.</p>
<h1><a class="title-link" name="ship-less" href="#ship-less"></a> Ship less</h1>
<p>The theory behind this one is simple: if we manage to ship less code, the browser has to process less code and it will start faster.</p>
<h2><a class="title-link" name="only-include-the-components-for-the-page-that-you-will-show" href="#only-include-the-components-for-the-page-that-you-will-show"></a> Only include the components for the page that you will show</h2>
<p>The Home Assistant mobile web application has 10 different panels (pages). Besides that, it also has a dialog for each type of device to show more info. Thats a lot of components and screens of which only a very small set is needed at the start. That means that we are shipping a lot of unnecessary data that the browser has to process before our initial render!</p>
<p>I broke up each panel of the app into a separate bundle that will be loaded on demand. This saved 250 kilobytes (pre-gzip) on just the embedded map alone! This change, however, required some significant changes to our build process.</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="language-javascript highlighter-rouge"><pre class="highlight"><code><span class="c1">// 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="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>
<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>
</code></pre>
</div>
<p>Because the browser tracks your web components, creating standalone bundles for parts of the app is easy:</p>
<ul>
<li>Find all dependencies included in the main bundle (using <a href="https://github.com/Polymer/hydrolysis">hydrolysis</a>)</li>
<li>Create individual bundles of each panel (page) but filter out the dependencies included in main bundle.</li>
</ul>
<p>The <a href="https://github.com/home-assistant/home-assistant-polymer/blob/master/script/vulcanize.js">build script</a> that bundles and minifies the main bundle and panel bundles is &lt;100 lines.</p>
<h2><a class="title-link" name="change-the-javascript-bundler-to-rollup" href="#change-the-javascript-bundler-to-rollup"></a> Change the JavaScript bundler to Rollup</h2>
<p>Core.js is still pure JavaScript and requires bundling. In my journey to get a smaller bundle, I went from <a href="https://webpack.github.io/">Webpack</a> to Webpack 2 to <a href="http://rollupjs.org/">Rollup</a>. At each step the bundle got smaller. Rollup is the big winner here because it doesnt wrap all your modules in function calls but instead concatenates all files with minimal changes to make it work. This not only reduces the file size but also the loading speed. This is because the JavaScript engine will no longer have to invoke a function to resolve each import, its doing less work. This might not mean much for a computer but on a phone, everything counts.</p>
<h2><a class="title-link" name="scrutinize-dependencies" href="#scrutinize-dependencies"></a> Scrutinize dependencies</h2>
<p>If the goal is to ship less, its time to take a good look at dependencies. Its so often that we decide to fall back to yet another NPM package that makes our life a little easier but comes at the cost of size size usually taken up by functionality that you might never need.</p>
<h3><a class="title-link" name="remove-lodash" href="#remove-lodash"></a> Remove Lodash</h3>
<p>I realized that I only used a few methods of lodash. Lodash (and previously underscore) used to be one of the dependencies that would always be one of the first things that I would add to any project I start. But I could no longer justify it in the case of Home Assistant. Even with dead tree shaking it was not worth including it. Yes, they support a lot of edge cases but those were not relevant to my use case. And standalone lodash packages are <a href="https://github.com/lodash/lodash/blob/3.1.7-npm-packages/lodash.range/index.js">still huge</a>. The only thing that I couldnt replace with a few lines of my own code was debounce. However I found <a href="https://github.com/component/debounce">a 40 line replacement</a>.</p>
<h3><a class="title-link" name="replace-momentjs-with-fecha" href="#replace-momentjs-with-fecha"></a> Replace moment.js with Fecha</h3>
<p>Moment.js is one of those power libraries. It is able to handle any date problem that you can throw at it. But this obviously comes at the cost of size. <a href="https://github.com/taylorhakes/fecha">Fecha</a> is a date formatting library at ~8% the size of moment.js (only 4.7kb pre-gzip). The only thing that it does not contain is date manipulation, which was something that was not being used.</p>
<h1><a class="title-link" name="use-service-worker-to-instantly-load-the-app" href="#use-service-worker-to-instantly-load-the-app"></a> Use Service worker to instantly load the app</h1>
<p>Using a service worker were able to store all app components and core javascript in the browser. This means that after their first visit, the browser will only have to go to the network to fetch the latest data from the server.</p>
<p>Creating a service worker is easy using <a href="https://github.com/GoogleChrome/sw-precache">sw-precache</a>, a service worker generation tool.</p>
<p>When a browser does not support service workers, Home Assistant will serve fingerprinted assets that are aggressively cached. Only when the content changes will the client redownload the asset.</p>
<p>Using fingerprinting with sw-precache required jumping through a few hoops. <a href="https://github.com/home-assistant/home-assistant-polymer/blob/master/script/sw-precache.js">The final build script can be found here.</a></p>
<h1><a class="title-link" name="make-it-feel-fast" href="#make-it-feel-fast"></a> Make it feel fast</h1>
<p>This one is more psychological: no one likes staring at a white screen because white screens are ambiguous: are we loading something, is there a crappy connection or maybe even a script error? Thats why it is very important to render something on the screen to show that the rest is being loaded, and as quickly as possible.</p>
<p>The Home Assistant landing page contains just enough CSS and HTML to render the loading screen minus the animations.</p>
<p>Now that the app is fast enough, I might swap out moving from a lite loading screen to drawing an empty toolbar. This makes it look like the UI is almost there.</p>
<h1><a class="title-link" name="using-a-framework-build-on-web-standards" href="#using-a-framework-build-on-web-standards"></a> Using a framework build on web standards</h1>
<p><em>I left this to the end of the list, mainly because I had no influence on this. Polymer just happened to ship an update while I was optimizing the application which gave a big boost to the loading time.</em></p>
<p>By using Polymer we have the ability to use tomorrows web standards today. This is powered by polyfills. A polyfill will use JavaScript to simulate the behavior that the web standard would have taken care of. As browsers progress, more work can move from the polyfills back to the browsers. This is great because browsers will be able to optimize the work better and thus be faster.</p>
<p>Polymer 1.6 was introduced at the end of June and allowed the app to take advantage of native <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables">CSS variables</a> in Chrome and Firefox. It also introduced lazy registration. Both greatly sped up our loading times.</p>
<h1><a class="title-link" name="future-optimizations" href="#future-optimizations"></a> Future optimizations</h1>
<p>A lot of optimizations have been applied but this journey will never be over. There are still a lot of opportunities to make things even faster. Some ideas that are on my list to explore:</p>
<ul>
<li>Use shadow DOM instead of shady DOM polyfill.</li>
<li>Use <a href="https://developers.google.com/closure/compiler/">closure compiler</a> to optimize the JavaScript.</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>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 class="highlighter-rouge">&lt;link rel="preload" …&gt;</code></li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Laundry Sensors with NodeMCU and Home Assistant]]></title>
<link href="https://home-assistant.io/blog/2016/08/03/laundry-automation-update/"/>
<updated>2016-08-03T17:22:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/08/03/laundry-automation-update</id>
<content type="html"><![CDATA[<p><em>This is a guest post by Home Assistant user and contributor <a href="https://github.com/nkgilley">Nolan Gilley</a>.</em></p>
<p>Today Ill show you how I used Home Assistant, a NodeMCU (ESP8266), and a couple of accelerometers to automate our laundry room. This is a rewrite of an <a href="https://home-assistant.io/blog/2015/08/26/laundry-automation-with-moteino-mqtt-and-home-assistant/">old post</a> where I did the same thing using a Moteino &amp; Raspberry Pi. This version only requires a NodeMCU.</p>
<p>We have an older washer and dryer which doesnt have any form of notification when cycles complete. Home Assistant was the obvious solution, I just needed to create sensors for the washer and dryer. I tried using sound sensors but found them unreliable. I ended up using an accelerometer attached to the back of each appliance. I also added magnetic reed switches on the doors of the washer and dryer to detect whether theyre open or closed. I connected the accelerometers and reed switches to an NodeMCU which will relay the data to my MQTT broker.</p>
<p class="img">
<img src="https://home-assistant.io/images/blog/2016-07-laundry-automation/block-diagram.png" />
Block diagram of schematic
</p>
<!--more-->
<p>After taking some sample data from the accelerometers while each appliance was in operation, I decided to plot the data to help determine the proper thresholds of when the devices were running or off. I had to do this in order to get precise ranges so the dryer sensor wouldnt get tripped by the washer or vice versa. In the plot below you can see the acceleration in each direction for the accelerometer connected to the dryer. Its easy to see when the dryer is in operation here. I used the same technique for the washers accelerometer.</p>
<p class="img">
<img src="https://home-assistant.io/images/blog/2016-07-laundry-automation/data-graph.png" />
Graph showing the accelerometer data
</p>
<p>Next it was just a matter of integrating everything with Home Assistant. I was able to use the <a href="https://home-assistant.io/components/mqtt/">MQTT component</a> to read the washer and dryer states from the Moteino and display it in Home Assistant.</p>
<p class="img">
<img src="https://home-assistant.io/images/blog/2016-07-laundry-automation/screenshot-ha.png" />
Status of the dryer and washer in Home Assistant
</p>
<p>Next I wrote <a href="https://home-assistant.io/components/script/">scripts</a> that are run whenever the washer or dryer completes a load. This is triggered by the <a href="https://home-assistant.io/getting-started/automation/">automation component</a>. When the laundry is complete I have the lights in the house turn red and <a href="https://home-assistant.io/components/notify.joaoapps_join/">notify me via Join</a>. Once the door is opened and laundry emptied another script runs that sets the lights back to normal. So far it has been very helpful and very reliable.</p>
<p class="img">
<a href="https://home-assistant.io/images/blog/2016-07-laundry-automation/protoboard.jpg">
<img src="https://home-assistant.io/images/blog/2016-07-laundry-automation/protoboard.jpg" />
</a>
NodeMCU connected to MPU-6050 accelerometer.
</p>
<p>Materials used:</p>
<ul>
<li><a href="https://www.amazon.com/gp/product/B010O1G1ES">NodeMCU</a></li>
<li><a href="http://www.amazon.com/gp/product/B008BOPN40">2 x Accelerometers</a></li>
<li><a href="http://www.amazon.com/gp/product/B004PARDRO">2 x Reed switch</a></li>
</ul>
<p><a href="https://github.com/nkgilley/nodemcu-laundry/blob/master/nodemcu-laundry.ino">Sketch for the NodeMCU is available here.</a></p>
<p>Home Assistant Configuration:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">mqtt</span><span class="pi">:</span>
<span class="s">broker</span><span class="pi">:</span> <span class="s">192.168.1.100</span>
<span class="s">port</span><span class="pi">:</span> <span class="s">1883</span>
<span class="s">keepalive</span><span class="pi">:</span> <span class="s">60</span>
<span class="s">qos</span><span class="pi">:</span> <span class="s">0</span>
<span class="s">sensor</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">mqtt</span>
<span class="s">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="s">state_topic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">sensor/dryer"</span>
<span class="s">unit_of_measurement</span><span class="pi">:</span> <span class="s2">"</span><span class="s">"</span>
<span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">mqtt</span>
<span class="s">name</span><span class="pi">:</span> <span class="s2">"</span><span class="s">Washer</span><span class="nv"> </span><span class="s">Status"</span>
<span class="s">state_topic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">sensor/washer"</span>
<span class="s">unit_of_measurement</span><span class="pi">:</span> <span class="s2">"</span><span class="s">"</span>
<span class="s">automation</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Washer complete</span>
<span class="s">trigger</span><span class="pi">:</span>
<span class="s">platform</span><span class="pi">:</span> <span class="s">state</span>
<span class="s">entity_id</span><span class="pi">:</span> <span class="s">sensor.washer_status</span>
<span class="s">from</span><span class="pi">:</span> <span class="s1">'</span><span class="s">Running'</span>
<span class="s">to</span><span class="pi">:</span> <span class="s1">'</span><span class="s">Complete'</span>
<span class="s">action</span><span class="pi">:</span>
<span class="s">service</span><span class="pi">:</span> <span class="s">script.turn_on</span>
<span class="s">entity_id</span><span class="pi">:</span> <span class="s">script.washer_complete</span>
<span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Washer emptied</span>
<span class="s">trigger</span><span class="pi">:</span>
<span class="s">platform</span><span class="pi">:</span> <span class="s">state</span>
<span class="s">entity_id</span><span class="pi">:</span> <span class="s">sensor.washer_status</span>
<span class="s">from</span><span class="pi">:</span> <span class="s1">'</span><span class="s">Complete'</span>
<span class="s">to</span><span class="pi">:</span> <span class="s1">'</span><span class="s">Empty'</span>
<span class="s">action</span><span class="pi">:</span>
<span class="s">service</span><span class="pi">:</span> <span class="s">scene.turn_on</span>
<span class="s">entity_id</span><span class="pi">:</span> <span class="s">scene.normal</span>
<span class="s">script</span><span class="pi">:</span>
<span class="s">washer_complete</span><span class="pi">:</span>
<span class="s">alias</span><span class="pi">:</span> <span class="s">Washer Complete</span>
<span class="s">sequence</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Join Notification</span>
<span class="s">service</span><span class="pi">:</span> <span class="s">notify.join</span>
<span class="s">data</span><span class="pi">:</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="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Living Room Lights Blue</span>
<span class="s">service</span><span class="pi">:</span> <span class="s">scene.turn_on</span>
<span class="s">data</span><span class="pi">:</span>
<span class="s">entity_id</span><span class="pi">:</span> <span class="s">scene.blue</span>
</code></pre>
</div>
<p>Resources used:</p>
<ul>
<li><a href="http://www.instructables.com/id/Uber-Home-Automation-w-Arduino-Pi/step13/Washer-Dryer-Smartifier-Water-Leak-Sensor/">Inspiration and Help with Arduino code</a></li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[0.25: Custom frontend panels, Jupyter notebooks, DirecTV.]]></title>
<link href="https://home-assistant.io/blog/2016/07/30/custom-frontend-panels-jupyter-notebooks-directv/"/>
<updated>2016-07-30T12:00:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/07/30/custom-frontend-panels--jupyter-notebooks--directv</id>
<content type="html"><![CDATA[<p>When Home Assistant started the focus has always been on making a great developer experience. Allowing anyone to add support for their favorite devices to Home Assistant easily. This focus has been a great success since we now have 339 components and platforms!</p>
<p>Starting with this release, we are extending our extensability to the frontend. Starting this release, any component can <a href="https://home-assistant.io/developers/frontend_creating_custom_panels/">add its own page to the frontend</a>. Examples of this today are the map, logbook and history. We are looking forward to all the crazy panels youll come up with!</p>
<p>We have also seen an exciting trend of people starting to visualize their Internet of Things data using <a href="http://jupyter.org/">Jupyter</a> Notebooks, which are a great way to create and share documents that contain code, visualizations, and explanatory text. In case you missed it, the <a href="https://home-assistant.io/blog/2016/07/23/internet-of-things-data-exploration-with-jupyter-notebooks/">blog</a> post by <a href="https://github.com/kireyeu">@kireyeu</a> shows an advanced usecase while our <a href="https://home-assistant.io/cookbook/#jupyter-notebooks/">Notebooks</a> in the <a href="https://github.com/home-assistant/home-assistant-notebooks">Home Assistant Notebooks repository</a> cover the basics.</p>
<p>This release also includes a bunch of new integrations, among others three new media player platforms. This means that today Home Assistant can talk to 26 different media players!</p>
<p>The brand-new <a href="https://home-assistant.io/components/panel_iframe/">iFrame panel component</a> allows you to add other websites as pages in the Home Assistant frontend. They will show up in the sidebar and can be used the same way as you open the frontend in your browser but all within one view.</p>
<p>I would like to do a shoutout to <a href="https://github.com/fabianhjr">@fabianhjr</a>. He has started adding <a href="https://docs.python.org/3/library/typing.html">typing</a> data (<a href="https://www.python.org/dev/peps/pep-0484/">PEP484</a>) to the Home Assistant core. This will help us identify issues before they are released.</p>
<p><img src="https://home-assistant.io/images/supported_brands/russound.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="150" /><img src="https://home-assistant.io/images/supported_brands/jupyter.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="150" /><img src="https://home-assistant.io/images/supported_brands/directv.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="150" /></p>
<ul>
<li>Frontend: Support for <a href="https://home-assistant.io/components/panel_iframe/">iFrame panels</a> to adding other sites to sidebar (<a href="https://github.com/balloob">@balloob</a>)</li>
<li>Allow components to register <a href="https://home-assistant.io/developers/frontend_creating_custom_panels/">custom frontend panels</a> (<a href="https://github.com/balloob">@balloob</a>)</li>
<li>Add example custom_component <a href="https://home-assistant.io/cookbook/custom_panel_using_react/">react_panel</a> showing custom panels (<a href="https://github.com/balloob">@balloob</a>)</li>
<li>Light: <a href="https://home-assistant.io/components/light.flux_led/">MagicLight/Flux WiFi Color LED Light</a> support (<a href="https://github.com/Danielhiversen">@Danielhiversen</a>)</li>
<li>Script: Specify a delay <a href="https://home-assistant.io/getting-started/scripts/#delay/">using templates</a> (<a href="https://github.com/Teagan42">@Teagan42</a>)</li>
<li>Media player: <a href="https://home-assistant.io/components/media_player.russound_rnet/">Russound RNET</a> integration (<a href="https://github.com/laf">@laf</a>)</li>
<li>Remote: Option specifying custom timeout when calling Home Assistant API (<a href="https://github.com/n8henrie">@n8henrie</a>)</li>
<li>Thermostat: Integration of <a href="https://home-assistant.io/components/thermostat.knx/">KNX</a> thermostats (<a href="https://github.com/open-homeautomation">@open-homeautomation</a>)</li>
<li>Thermostat: Support for HVAC mode of <a href="https://home-assistant.io/components/thermostat.nest/">Nest</a> devices (<a href="https://github.com/vladonemo">@vladonemo</a>)</li>
<li>InfluxDB: Option to specify additional <a href="https://home-assistant.io/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>Template: New <a href="https://home-assistant.io/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>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>Z-Wave: Rollershutter update (<a href="https://github.com/turbokongen">@turbokongen</a>)</li>
<li>RFXtrx: Fire events when receiving signals from sensors and tests added (<a href="https://github.com/Danielhiversen">@Danielhiversen</a>)</li>
<li>Core: Add <a href="https://docs.python.org/3/library/typing.html">type</a> checking using mypy to the core (<a href="https://github.com/fabianhjr">@fabianhjr</a>)</li>
<li>Remote: Support for getting the <a href="https://home-assistant.io/developers/python_api/#get-configuration/">Configuration</a> through the Python API (<a href="https://github.com/fabaff">@fabaff</a>)</li>
<li>Media player: Support for <a href="https://home-assistant.io/components/media_player.directv/">DirecTV</a> (<a href="https://github.com/cbulock">@cbulock</a>)</li>
<li>Use browser timezone for frontend logbook and history dates (<a href="https://github.com/armills">@armills</a>)</li>
<li>Light: New support for <a href="https://home-assistant.io/components/light.x10/">X10</a> lights (<a href="https://github.com/fotoetienne">@fotoetienne</a>)</li>
<li>Sensor: Support for observing <a href="https://home-assistant.io/components/sensor.imap/">IMAP</a> accounts (<a href="https://github.com/danieljkemp">@danieljkemp</a>)</li>
<li>Media Player: Integration for <a href="https://home-assistant.io/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 class="highlighter-rouge">location</code> extension for <a href="https://home-assistant.io/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>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>Sensor: Speedtest with improved error handling and state restoring (<a href="https://github.com/nkgilley">@nkgilley</a>)</li>
<li>Recorder: Stability fixes (<a href="https://github.com/kellerza">@kellerza</a>)</li>
<li>Qwikswitch: Stability fixes (<a href="https://github.com/kellerza">@kellerza</a>)</li>
<li>Light: <a href="https://home-assistant.io/components/light.hyperion/">Hyperion</a> keeps now track of active color (<a href="https://github.com/schneefux">@schneefux</a>)</li>
</ul>
<h3><a class="title-link" name="hotfix-0251---august-1" href="#hotfix-0251---august-1"></a> Hotfix 0.25.1 - August 1</h3>
<ul>
<li>Light - Z-Wave: Bring back delayed value update behavior (<a href="https://github.com/jnewland">@jnewland</a>)</li>
<li>Recorder: Properly close session after execute (<a href="https://github.com/kellerza">@kellerza</a>)</li>
<li>Media Player - Kodi: No longer block startup if connecting to wrong port (<a href="https://github.com/shoekstra">@shoekstra</a>)</li>
<li>Downgrade voluptuous to 0.8.9 as it blocked the upgrade for some (<a href="https://github.com/balloob">@balloob</a>)</li>
</ul>
<h3><a class="title-link" name="hotfix-0252---august-2" href="#hotfix-0252---august-2"></a> Hotfix 0.25.2 - August 2</h3>
<ul>
<li>Hotfix to make sure Z-Wave locks work again. Thanks to @tobiebooth for the quick fix.</li>
</ul>
<h3><a class="title-link" name="breaking-changes" href="#breaking-changes"></a> Breaking changes</h3>
<ul>
<li>Google Voice SMS notification support was removed.</li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[ESP8266 and MicroPython - Part 1]]></title>
<link href="https://home-assistant.io/blog/2016/07/28/esp8266-and-micropython-part1/"/>
<updated>2016-07-28T04:00:00+00:00</updated>
<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" />
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>
<!--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>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sudo python esptool.py --port /dev/ttyUSB0 erase_flash
esptool.py v1.0.2-dev
Connecting...
Erasing flash <span class="o">(</span>this may take a <span class="k">while</span><span class="o">)</span>...
</code></pre>
</div>
<p>and then load the firmware. You may adjust the file name of the firmware binary.</p>
<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
esptool.py v1.2-dev
Connecting...
Running Cesanta flasher stub...
Flash params <span class="nb">set </span>to 0x0020
Writing 540672 @ 0x0... 540672 <span class="o">(</span>100 %<span class="o">)</span>
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...
</code></pre>
</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 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 class="highlighter-rouge">webrepl_cli.py</code> which is mentionend later in this post.</p>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sudo minicom -D /dev/ttyUSB0
<span class="c">#4 ets_task(4020e374, 29, 3fff70e8, 10) </span>
WebREPL daemon started on ws://192.168.4.1:8266
Started webrepl <span class="k">in </span>setup mode
could not open file <span class="s1">'main.py'</span> <span class="k">for </span>reading
<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
Type <span class="s2">"help()"</span> <span class="k">for </span>more information.
<span class="gp">&gt;&gt;&gt; </span>
</code></pre>
</div>
<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.
</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="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>
<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>
<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>
</code></pre>
</div>
<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>
<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>
<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>
<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>
</code></pre>
</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>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="language-python highlighter-rouge"><pre class="highlight"><code><span class="k">def</span> <span class="nf">do_connect</span><span class="p">():</span>
<span class="kn">import</span> <span class="nn">network</span>
<span class="n">SSID</span> <span class="o">=</span> <span class="s">'SSID'</span>
<span class="n">PASSWORD</span> <span class="o">=</span> <span class="s">'PASSWORD'</span>
<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>
<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="k">if</span> <span class="n">ap_if</span><span class="o">.</span><span class="n">active</span><span class="p">():</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="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>
<span class="k">print</span><span class="p">(</span><span class="s">'connecting to network...'</span><span class="p">)</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>
<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="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="k">pass</span>
<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>
</code></pre>
</div>
<p>Upload this file with <code class="highlighter-rouge">webrepl_cli.py</code> or the WebREPL:</p>
<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
</code></pre>
</div>
<p>If you reboot, you should see your current IP address in the terminal.</p>
<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>
</code></pre>
</div>
<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="https://home-assistant.io/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">
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>
<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>
<span class="n">API_PASSWORD</span> <span class="o">=</span> <span class="s">'YOUR_PASSWORD'</span>
<span class="n">URL</span> <span class="o">=</span> <span class="s">'http://192.168.0.5:8123/api/states/'</span>
<span class="n">ENTITY</span> <span class="o">=</span> <span class="s">'sensor.kitchen_temperature'</span>
<span class="n">TIMEOUT</span> <span class="o">=</span> <span class="mi">30</span>
<span class="n">PIN</span> <span class="o">=</span> <span class="mi">5</span>
<span class="k">def</span> <span class="nf">get_data</span><span class="p">():</span>
<span class="kn">import</span> <span class="nn">urequests</span>
<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>
<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="s">'content-type'</span><span class="p">:</span> <span class="s">'application/json'</span><span class="p">}</span>
<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="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="k">def</span> <span class="nf">main</span><span class="p">():</span>
<span class="kn">import</span> <span class="nn">machine</span>
<span class="kn">import</span> <span class="nn">time</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="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="k">while</span> <span class="bp">True</span><span class="p">:</span>
<span class="k">try</span><span class="p">:</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>
<span class="n">pin</span><span class="o">.</span><span class="n">high</span><span class="p">()</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">pin</span><span class="o">.</span><span class="n">low</span><span class="p">()</span>
<span class="k">except</span> <span class="nb">TypeError</span><span class="p">:</span>
<span class="k">pass</span>
<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="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">'__main__'</span><span class="p">:</span>
<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>
<span class="n">main</span><span class="p">()</span>
</code></pre>
</div>
<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 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>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[IoT Data Exploration with Jupyter Notebooks]]></title>
<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>
<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>
<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>
<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>
<ul>
<li> <a href="http://pandas.pydata.org/">Pandas</a>: an open source tool for data analysis for Python</li>
<li> <a href="http://matplotlib.org/">matplotlib</a>: a Python plotting library</li>
<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">
<img src="https://home-assistant.io/images/blog/2016-07-data-exploration/graph.png" />
One of the graphs created with this tutorial.
</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>
<!--more-->
<h3><a class="title-link" name="dependencies" href="#dependencies"></a> Dependencies</h3>
<p>In order to run the provided Jupyter notebook, please make sure you have the following applications/libraries installed on your computer:</p>
<ul>
<li>Pandas</li>
<li>NumPy</li>
<li>Matplotlib</li>
<li>SQLAlchemy</li>
<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>
<h4><a class="title-link" name="why-jupyter" href="#why-jupyter"></a> Why Jupyter?</h4>
<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>
<h4><a class="title-link" name="where-do-i-start" href="#where-do-i-start"></a> Where do I start?</h4>
<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>
<ul>
<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 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>
</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>
<p>After just those few steps, you will be greeted with beautiful formatted data like this:</p>
<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.
</p>
<h4><a class="title-link" name="whats-next" href="#whats-next"></a> Whats next?</h4>
<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>
<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>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Visualize your IoT data]]></title>
<link href="https://home-assistant.io/blog/2016/07/19/visualizing-your-iot-data/"/>
<updated>2016-07-19T16:00:00+00:00</updated>
<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>
<p>The <a href="https://home-assistant.io/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>
<p>This blog post will show you ways to export data for reporting, visualization, or further analysis of automation rules.</p>
<!--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="https://home-assistant.io/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 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 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 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="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sqlite3 /home/ha/.homeassistant/home-assistant_v2.db
SQLite version 3.11.0 2016-02-15 17:29:24
<span class="gp">sqlite&gt; </span>SELECT count<span class="o">(</span><span class="k">*</span><span class="o">)</span> FROM states;
24659
</code></pre>
</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 class="highlighter-rouge">sensor.aare</code>.</p>
<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>
<span class="k">WHERE</span>
<span class="n">entity_id</span> <span class="o">=</span> <span class="s1">'sensor.aare'</span>
<span class="k">AND</span>
<span class="n">last_changed</span> <span class="k">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>
</code></pre>
</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 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 class="img">
<img src="https://home-assistant.io/images/blog/2016-07-reporting/db-browser.png" />
Visualization with DB Browser for SQLite
</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="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
</code></pre>
</div>
<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">
<img src="https://home-assistant.io/images/blog/2016-07-reporting/libreoffice-import.png" />
Import of the CSV file
</p>
<p>After the import a graph can be created over the existing data.</p>
<p class="img">
<img src="https://home-assistant.io/images/blog/2016-07-reporting/libreoffice-graph.png" />
Graph in LibreOffice
</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="language-python highlighter-rouge"><pre class="highlight"><code><span class="kn">import</span> <span class="nn">sqlite3</span>
<span class="kn">from</span> <span class="nn">matplotlib</span> <span class="kn">import</span> <span class="n">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="kn">import</span> <span class="nn">homeassistant.util.dt</span> <span class="kn">as</span> <span class="nn">dt</span>
<span class="n">values</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">timestamps</span> <span class="o">=</span> <span class="p">[]</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>
<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="s">"entity_id = 'sensor.aare' AND last_changed BETWEEN "</span>
<span class="s">"'2016-07-05 00:00:00.000000' AND "</span>
<span class="s">"'2016-07-07 00:00:00.000000'"</span><span class="p">)</span>
<span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">data</span><span class="p">:</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>
<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>
<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>
<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>
<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>
<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>
</code></pre>
</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 class="img">
<img src="https://home-assistant.io/images/blog/2016-07-reporting/mpl-sensor.png" />
Sensor graph generated by matplotlib
</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>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[0.24: SQLAlchemy, KNX, Join by Joaoapps, and SimpliSafe.]]></title>
<link href="https://home-assistant.io/blog/2016/07/16/sqlalchemy-knx-join-simplisafe/"/>
<updated>2016-07-16T12:00:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/07/16/sqlalchemy-knx-join-simplisafe</id>
<content type="html"><![CDATA[<p>Its time for Home Assistant 0.24 and its full of new integration for your Home. It contains some structural changes to our history which requires action from your end, so please keep reading.</p>
<p><a href="https://www.mapquest.com/">MapQuest</a> discontinued their free and direct tile access by Monday, July 11, 2016. With <a href="https://carto.com/">CARTO</a> we found a very cool and suitable solution. They allow us to use their tile for the map. Thank you, <a href="https://carto.com/">CARTO</a>.</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="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>pip3 install SQLAlchemy
<span class="gp">$ </span>hass --script db_migrator --config /path/to/config
</code></pre>
</div>
<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="https://home-assistant.io/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="https://home-assistant.io/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="https://home-assistant.io/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="https://home-assistant.io/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>
<ul>
<li>Config: Improved support for storing <a href="https://home-assistant.io/topics/secrets/">secrets</a> (<a href="https://github.com/kellerza/">@kellerza</a>)</li>
<li>Sensor: Support for <a href="https://home-assistant.io/components/sensor.yweather/">Yahoo! Weather</a> (<a href="https://github.com/pvizeli/">@pvizeli</a>)</li>
<li>Add scripts to command line to expose advanced options (<a href="https://github.com/balloob/">@balloob</a>)</li>
<li>Alarm: <a href="https://home-assistant.io/components/alarm_control_panel.simplisafe/">SimpliSafe</a> is now supported (<a href="https://github.com/w1ll1am23/">@w1ll1am23</a>)</li>
<li>Core: Switch to SQLAlchemy for the Recorder component (<a href="https://github.com/rhooper/">@rhooper</a>)</li>
<li>Support for <a href="https://home-assistant.io/components/joaoapps_join/">Join by Joaoapps</a> added incl. <a href="https://home-assistant.io/components/notify.joaoapps_join/">Join Notify</a> (<a href="https://github.com/nkgilley">@nkgilley</a>)</li>
<li>Media Player: <a href="https://home-assistant.io/components/media_player.plex/">Plex</a> will no longer spam the logs if server goes offline (<a href="https://github.com/dale3h/">@dale3h</a>)</li>
<li>Sensor: <a href="https://home-assistant.io/components/sensor.apcupsd/">APCUPSd Sensor</a> now supports names, icons and units (<a href="https://github.com/dale3h/">@dale3h</a>)</li>
<li>Lock: <a href="https://home-assistant.io/components/lock.verisure/">Verisure</a> entities will now use name instead of serial number for entity id (<a href="https://github.com/turbokongen/">@turbokongen</a>)</li>
<li><a href="https://home-assistant.io/components/statsd/">StatsD</a> can now also export attributes (<a href="https://github.com/bah2830/">@bah2830</a>)</li>
<li>Support for <a href="https://home-assistant.io/components/knx/">KNX</a> added (<a href="https://github.com/usul27">@usul27</a>)</li>
<li>Switch: <a href="https://home-assistant.io/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> (<a href="https://github.com/danielhiversen">@Danielhiversen</a>)</li>
<li>Tweaks to <a href="https://home-assistant.io/components/zwave/">Z-Wave</a> (<a href="https://github.com/turbokongen/">@turbokongen</a>)</li>
<li>Light: <a href="https://home-assistant.io/components/light/">Brightness</a> now clamped to 0-255 (<a href="https://github.com/keatontaylor">@keatontaylor</a>)</li>
<li>Thermostat: <a href="https://home-assistant.io/components/thermostat.radiotherm/">Radiotherm</a> HVAC mode now supported (<a href="https://github.com/danieljkemp">@danieljkemp</a>)</li>
<li>Sensor: <a href="https://home-assistant.io/components/sensor.google_travel_time/">Google Travel</a> times can now use dynamic locations for start/end (<a href="https://github.com/bah2830/">@bah2830</a>)</li>
<li>Notify: Allow sending photos to <a href="https://home-assistant.io/components/notify.telegram/">Telegram</a> (<a href="https://github.com/pvizeli/">@pvizeli</a>)</li>
<li>Frontend: Improve loading times (<a href="https://github.com/balloob/">@balloob</a>)</li>
<li>Frontend: Fix stream not reconnecting after standby (<a href="https://github.com/balloob/">@balloob</a>)</li>
<li>Frontend: Wait up to two seconds for new state before resetting toggle after toggling state (<a href="https://github.com/balloob/">@balloob</a>)</li>
</ul>
<h3><a class="title-link" name="hotfix-0241---july-21" href="#hotfix-0241---july-21"></a> Hotfix 0.24.1 - July 21</h3>
<p>Quick hot fix after we found a bug in the migrator where it wouldnt work with a database in a non-standard location. Thanks to <a href="https://github.com/n8henrie/">@n8henrie</a> and <a href="https://github.com/AlucardZero/">@AlucardZero</a>.</p>
<h3><a class="title-link" name="breaking-changes" href="#breaking-changes"></a> Breaking changes</h3>
<ul>
<li>Migrating existing databases (see above).</li>
<li>The <a href="https://home-assistant.io/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>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[PocketCHIP running Home Assistant]]></title>
<link href="https://home-assistant.io/blog/2016/07/06/pocketchip-running-home-assistant/"/>
<updated>2016-07-06T05:00:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/07/06/pocketchip-running-home-assistant</id>
<content type="html"><![CDATA[<p><img src="https://home-assistant.io/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>
<!--more-->
<p>Thanks to <a href="https://www.nextthing.co/">Next Thing Co.</a> and their CHIP which is actually 9 USD the space requirement for a single board computer has decreased. No Ethernet and HDMI output helped with that. But I guess that the next development cycle will allow us to put those boards in a matchbox including wired networking and a SATA interface.</p>
<p class="img">
<img src="https://home-assistant.io/images/blog/2016-07-pocketchip/size.png" />
Size comparison of a Cubieboard, OrangePi One, and CHIP.
</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 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 class="highlighter-rouge">$ sudo apt-get update</code> installing those dependencies take a minute or two.</p>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sudo apt-get install python3-dev python3-pip python3-venv
</code></pre>
</div>
<p>As usual I run Python applications in a <a href="https://docs.python.org/3/library/venv.html">venv</a>.</p>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>pvenv ha
</code></pre>
</div>
<p>Lets activate the created environment.</p>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span><span class="nb">cd </span>ha
<span class="gp">$ </span><span class="nb">source </span>bin/activate
</code></pre>
</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>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>pip3 install homeassistant
<span class="gp">$ </span>hass --open-ui
</code></pre>
</div>
<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">
<img src="https://home-assistant.io/images/blog/2016-07-pocketchip/pocketchip.png" />
PocketCHIP with Home Assistant frontend
</p>
<p>Well, with PocketCHIP and Home Assistant you could run your home automation on a 49 USD device with a touchscreen, an integrated USP, and a keyboard. With the GPIO available on top of the display you could even connect your PocketCHIP directly to sensors and actuators.</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[0.23: Envisalink, Homematic, HDMI-CEC and Sony Bravia TV]]></title>
<link href="https://home-assistant.io/blog/2016/07/01/envisalink-homematic-hdmi-cec-and-sony-bravia-tv/"/>
<updated>2016-07-01T00:31:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/07/01/envisalink-homematic-hdmi-cec-and-sony-bravia-tv</id>
<content type="html"><![CDATA[<p>Its time for Home Assistant 0.23 and its full of goodies. Its also the release that bumps us over a 1000 tests and to 94% test coverage! Also our install issues on the Raspberry Pi and Synology have been resolved.</p>
<p>This release brings support for two new ecosystems: <a href="https://home-assistant.io/components/envisalink/">Envisalink</a> and <a href="https://home-assistant.io/components/homematic/">Homematic</a>. We can now also control your TV via HDMI using <a href="https://home-assistant.io/components/hdmi_cec/">HDMI-CEC</a> (which works on the Pi!) and another cool feature is the <a href="https://home-assistant.io/components/persistent_notification/">persistent notifications</a> which allow you to add a notification to the frontend till dismissed.</p>
<p><a href="https://home-assistant.io/components/wink/">Wink</a> support has been dramatically improved by migrating to the PubNub API. This allows Wink to push changes from their system to Home Assistant. This change came just in time as somehow our Wink integration was causing a lot of requests to their servers. Thanks to Wink for letting us know so we could solve it instead of blocking us.</p>
<p>On the config side, you can now <a href="https://home-assistant.io/topics/secrets/">store your passwords</a> in your OS keyring or just in a standalone file. We also got a new service to reload the core config so no reboots needed anymore after changing customize settings!</p>
<p><img src="https://home-assistant.io/images/supported_brands/bravia.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="150" /><img src="https://home-assistant.io/images/supported_brands/eyezon.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="150" /><img src="https://home-assistant.io/images/supported_brands/homematic.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="150" /><img src="https://home-assistant.io/images/supported_brands/openexchangerates.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="150" /></p>
<ul>
<li>Support for <a href="https://home-assistant.io/components/envisalink/">Envisalink</a> added (<a href="https://home-assistant.io/components/alarm_control_panel.envisalink/">alarm control panel</a>, <a href="https://home-assistant.io/components/binary_sensor.envisalink/">binary sensor</a>, <a href="https://home-assistant.io/components/sensor.envisalink/">sensor</a>) (<a href="https://github.com/cinntax/">@cinntax</a>)</li>
<li>Support for <a href="https://home-assistant.io/components/homematic/">Homematic</a> added (<a href="https://home-assistant.io/components/binary_sensor.homematic/">binary sensor</a>, <a href="https://home-assistant.io/components/light.homematic/">light</a>, <a href="https://home-assistant.io/components/rollershutter.homematic/">rollershutter</a>, <a href="https://home-assistant.io/components/sensor.homematic/">sensor</a>, <a href="https://home-assistant.io/components/switch.homematic/">switch</a>) (<a href="https://github.com/pvizeli/">@pvizeli</a>, <a href="https://github.com/danielperna84/">@danielperna84</a>)</li>
<li>New <a href="https://home-assistant.io/components/hdmi_cec/">HDMI-CEC</a> component (<a href="https://github.com/happyleavesaoc/">@happyleavesaoc</a>, <a href="https://github.com/lukas-hetzenecker/">@lukas-hetzenecker</a>)</li>
<li>Major rewrite of <a href="https://home-assistant.io/components/wink/">Wink</a> which now pushes changes to Home Assistant (<a href="https://github.com/w1ll1am23/">@w1ll1am23</a>)</li>
<li>Core: new add <a href="https://home-assistant.io/getting-started/customizing-devices/#reloading-customize/">reload core config service</a> (<a href="https://github.com/balloob/">@balloob</a>)</li>
<li>Support for <a href="https://home-assistant.io/components/persistent_notification/">persistent notifications</a> added (<a href="https://github.com/fabaff/">@fabaff</a>, <a href="https://github.com/balloob/">@balloob</a>)</li>
<li>Garage door: <a href="https://home-assistant.io/components/garage_door.zwave/">Z-Wave</a> support added (<a href="https://github.com/turbokongen/">@turbokongen</a>)</li>
<li>Rollershutter: <a href="https://home-assistant.io/components/rollershutter.zwave/">Z-Wave</a> support added (<a href="https://github.com/turbokongen/">@turbokongen</a>)</li>
<li>Media Player: <a href="https://home-assistant.io/components/media_player.braviatv/">Sony Bravia TV</a> now supported (<a href="https://github.com/aparraga/">@aparraga</a>)</li>
<li>Sensor: <a href="https://home-assistant.io/components/sensor.fixer/">Fixer.io</a> now supported (<a href="https://github.com/fabaff/">@fabaff</a>)</li>
<li>Garage door: Control any garage door using <a href="https://home-assistant.io/components/garage_door.rpi_gpio/">Raspberry Pi GPIO pins</a> (<a href="https://github.com/kellerza/">@kellerza</a>)</li>
<li>Sensor: <a href="https://home-assistant.io/components/sensor.openexchangerates/">OpenExchangeRates</a> support added (<a href="https://github.com/arsaboo/">@arsaboo</a>)</li>
<li>Notify: <a href="https://home-assistant.io/components/notify.pushover/">Pushover</a> now supports target device, sound, url and priority (<a href="https://github.com/dale3h/">@dale3h</a>)</li>
<li>Sensor: <a href="https://home-assistant.io/components/sensor.netatmo/">Netatmo</a> now supports wind, battery and radio signals (<a href="https://github.com/Jypy/">@Jypy</a>)</li>
<li>Log successful and failed login attemps (<a href="https://github.com/fabaff/">@fabaff</a>)</li>
<li>Config: allow <a href="https://home-assistant.io/topics/secrets/">extracting account info</a> into OS keyring or separate YAML file (<a href="https://github.com/kellerza/">@kellerza</a>)</li>
<li>Core: add option to not filter out duplicate states per entity (<a href="https://github.com/philipbl/">@philipbl</a>)</li>
<li>HTTP: Follow Mozilla SSL recommendations (<a href="https://github.com/danieljkemp/">@danieljkemp</a>, <a href="https://github.com/AlucardZero/">@AlucardZero</a>)</li>
<li>Light: <a href="https://home-assistant.io/components/light.zwave/">Z-Wave colorbulb</a> support added (<a href="https://github.com/armills/">@armills</a>)</li>
<li>Core: new elevation config option added (<a href="https://github.com/balloob/">@balloob</a>)</li>
<li>Sensor: <a href="https://home-assistant.io/components/sensor.onewire/">OneWire</a> support extended with support for DS18S20, DS1822, DS1825 and DS28EA00 temperature sensors + support for bus masters which use fuse to mount device tree. (<a href="https://github.com/Ardetus/">@Ardetus</a>)</li>
<li>Lock: <a href="https://home-assistant.io/components/lock.vera/">Vera</a> now supported (<a href="https://github.com/rhooper/">@rhooper</a>)</li>
<li>HTTP: Migrate to CherryPy WSGI server to fix install and runtime problems (<a href="https://github.com/balloob/">@balloob</a>)</li>
</ul>
<h3><a class="title-link" name="breaking-changes" href="#breaking-changes"></a> Breaking changes</h3>
<ul>
<li>Homematic thermostat configuration has changed and now depends on the new <a href="https://home-assistant.io/components/homematic/">Homematic</a> component.</li>
</ul>
<h3><a class="title-link" name="hotfix-0231---july-2" href="#hotfix-0231---july-2"></a> Hotfix 0.23.1 - July 2</h3>
<ul>
<li>Bump PyVera to 0.2.13 to fix traceback and pyvera thread dying related to bug (<a href="https://github.com/rhooper/">@rhooper</a>)</li>
<li>HTTP - SSL: Check for OP_NO_COMPRESSION support before trying to use it (<a href="https://github.com/AlucardZero/">@AlucardZero</a>)</li>
<li>Wink: Downgraded pubnub to work around pycryptodome conflicts (<a href="https://github.com/w1ll1am23/">@w1ll1am23</a>)</li>
</ul>
<h3><a class="title-link" name="faq" href="#faq"></a> FAQ</h3>
<ul>
<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>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Using USB webcams with Home Assistant]]></title>
<link href="https://home-assistant.io/blog/2016/06/23/usb-webcams-and-home-assistant/"/>
<updated>2016-06-23T06:00:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/06/23/usb-webcams-and-home-assistant</id>
<content type="html"><![CDATA[<p><img src="https://home-assistant.io/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>
<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>
<!--more-->
<p>Check first if the your operating system lists your cameras.</p>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>lsusb
<span class="o">[</span>...]
Bus 002 Device 016: ID 046d:08cc Logitech, Inc. Mic <span class="o">(</span>PTZ<span class="o">)</span>
<span class="o">[</span>...]
</code></pre>
</div>
<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="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>ls -al /dev/video<span class="k">*</span>
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
</code></pre>
</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>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sudo dnf -y install motion
</code></pre>
</div>
<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="language-bash highlighter-rouge"><pre class="highlight"><code><span class="o">[</span>...]
<span class="c">###########################################################</span>
<span class="c"># Capture device options</span>
<span class="c">############################################################</span>
<span class="c"># Videodevice to be used for capturing (default /dev/video0)</span>
<span class="c"># for FreeBSD default is /dev/bktr0</span>
videodevice /dev/video1
<span class="o">[</span>..]
<span class="c">############################################################</span>
<span class="c"># Snapshots (Traditional Periodic Webcam File Output)</span>
<span class="c">############################################################</span>
<span class="c"># Make automated snapshot every N seconds (default: 0 = disabled)</span>
snapshot_interval 30
<span class="o">[</span>...]
<span class="c">############################################################</span>
<span class="c"># Target Directories and filenames For Images And Films</span>
<span class="c"># For the options snapshot_, picture_, movie_ and timelapse_filename</span>
<span class="c"># you can use conversion specifiers</span>
<span class="c"># %Y = year, %m = month, %d = date,</span>
<span class="c"># %H = hour, %M = minute, %S = second,</span>
<span class="c"># %v = event, %q = frame number, %t = thread (camera) number,</span>
<span class="c"># %D = changed pixels, %N = noise level,</span>
<span class="c"># %i and %J = width and height of motion area,</span>
<span class="c"># %K and %L = X and Y coordinates of motion center</span>
<span class="c"># %C = value defined by text_event</span>
<span class="c"># Quotation marks round string are allowed.</span>
<span class="c">############################################################</span>
<span class="c"># Target base directory for pictures and films</span>
<span class="c"># Recommended to use absolute path. (Default: current working directory)</span>
target_dir /tmp
<span class="o">[</span>...]
</code></pre>
</div>
<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="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>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
<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>
<span class="o">[</span>0] <span class="o">[</span>NTC] <span class="o">[</span>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>
</code></pre>
</div>
<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="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">camera</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">local_file</span>
<span class="s">name</span><span class="pi">:</span> <span class="s">Cranberry cam</span>
<span class="s">file_path</span><span class="pi">:</span> <span class="s">/tmp/lastsnap.jpg</span>
</code></pre>
</div>
<p class="img">
<img src="https://home-assistant.io/images/blog/2016-06-cranberry/cam.png" />
The “Cranberry cam” in action
</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 class="highlighter-rouge">configuration.yaml</code> file.</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">camera</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">mjpeg</span>
<span class="s">mjpeg_url</span><span class="pi">:</span> <span class="s">http://[IP of your webcam host]:8081</span>
<span class="s">name</span><span class="pi">:</span> <span class="s">Cranberry Live cam</span>
</code></pre>
</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 class="highlighter-rouge">motion</code> to unleash its potential.</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[0.22: Pandora, BT Home Hub 5 and local file camera.]]></title>
<link href="https://home-assistant.io/blog/2016/06/18/pandora-bt-home-hub-5-and-local-file-camera/"/>
<updated>2016-06-18T18:06:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/06/18/pandora-bt-home-hub-5-and-local-file-camera</id>
<content type="html"><![CDATA[<p>Its time for the 0.22 release. This was a pretty rough release cycle and we had to issue two hot fixes for our core improvements. But it seems now that all is good and a lot of people have reported that their installs are faster than ever and the occasional quirks no longer occur.</p>
<p>We are aware that our new web stack has caused issues installing Home Assistant on ARM-based platforms. This sadly includes the Raspberry Pi and Synology NAS systems. Were working on getting to a better solution. For Raspberry Pi, the <a href="https://home-assistant.io/getting-started/installation-raspberry-pi-all-in-one/">All-in-One installer</a> will take care of everything for you. Were working on updating our <a href="https://home-assistant.io/getting-started/installation-raspberry-pi/">standalone Raspberry Pi installation guide</a>.</p>
<p>There are two cool things that I want to highlight in this release. The first is Pandora support. This is based on the CLI player called pianobar. This means that your machine running Home Assistant can be connected to the speakers and provide your house with tunes.</p>
<p class="img">
<img src="https://home-assistant.io/images/screenshots/pandora_player.png" />
</p>
<p>Another cool addition is the local file camera. This seems very basic at first but will allow you to generate a graph with your favorite 3rd party graphing tool and display it on your Home Assistant dashboard. Were looking forward to see what you can do with this!</p>
<p><img src="https://home-assistant.io/images/supported_brands/pandora.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="150" /><img src="https://home-assistant.io/images/supported_brands/bt.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="150" /></p>
<ul>
<li>Media Player: <a href="https://home-assistant.io/components/media_player.pandora/">Pandora</a> media player now supported (<a href="https://github.com/partofthething/">@partofthething</a>)</li>
<li>Device Tracker: <a href="https://home-assistant.io/components/device_tracker.bt_home_hub_5/">BT Home Hub 5</a> now supported (<a href="https://github.com/lwis/">@lwis</a>)</li>
<li>Camera: New <a href="https://home-assistant.io/components/camera.local_file/">local file</a> platform shows any image as camera (<a href="https://github.com/Landrash/">@Landrash</a>)</li>
<li>Add <a href="https://home-assistant.io/components/media_player.sonos/">Sonos</a> snapshot and restore services (<a href="https://github.com/dansullivan86/">@dansullivan86</a>)</li>
<li>Device Tracker: <a href="https://home-assistant.io/components/device_tracker.asuswrt/">AsusWRT</a> in Access Point mode now supported (<a href="https://github.com/linjef/">@linjef</a>)</li>
<li>Device Tracker: <a href="https://home-assistant.io/components/device_tracker.asuswrt/">AsusWRT</a> login using public key now supported (<a href="https://github.com/mtreinish/">@mtreinish</a>)</li>
<li>Device Tracker: <a href="https://home-assistant.io/components/device_tracker.asuswrt/">AsusWRT</a> protocol to use is now auto detected (<a href="https://github.com/persandstrom/">@persandstrom</a>)</li>
<li>Camera: <a href="https://home-assistant.io/components/netatmo/">Netatmo</a> now supported (<a href="https://github.com/jabesq/">@jabesq</a>)</li>
<li>API documentation added in <a href="https://github.com/home-assistant/home-assistant/blob/dev/docs/swagger.yaml">Swagger.yaml format</a> (<a href="https://github.com/wind/">@wind-rider</a>)</li>
<li>Media Player: <a href="https://home-assistant.io/components/media_player.cast/">Cast</a> devices can now be stopped (<a href="https://github.com/michaelarnauts/">@michaelarnauts</a>)</li>
<li>MySensors: <a href="https://home-assistant.io/components/mysensors/">IR switch device</a> and service now supported (<a href="https://github.com/MartinHjelmare/">@MartinHjelmare</a>)</li>
<li>Bloomsky: <a href="https://home-assistant.io/components/sensor.bloomsky/">Voltage sensor</a> now supported (<a href="https://github.com/arsaboo/">@arsaboo</a>)</li>
<li>Sensor: New <a href="https://home-assistant.io/components/sensor.plex/">Plex sensor</a> monitors friends streaming from your Plex server (<a href="https://github.com/nkgilley/">@nkgilley</a>)</li>
<li>Component <a href="https://home-assistant.io/components/shell_command/">shell command</a> can now use templates to render arguments (<a href="https://github.com/partofthething/">@partofthething</a>)</li>
<li>Rollershutter: <a href="https://home-assistant.io/components/rollershutter.wink/">Wink</a> is now supported (<a href="https://github.com/philk/">@philk</a>)</li>
<li>Alexa: Updated <a href="https://home-assistant.io/components/alexa/#working-with-scenes/">documentation</a> to show how to call scripts and scenes (@acockburn)</li>
<li>Sensor: <a href="https://home-assistant.io/components/sensor.snmp/">SNMP</a> is now supported (<a href="https://github.com/fabaff/">@fabaff</a>)</li>
<li>Sensor: Support for Swiss hydrological data (<a href="https://github.com/fabaff/">@fabaff</a>)</li>
</ul>
<h3><a class="title-link" name="breaking-change" href="#breaking-change"></a> Breaking change</h3>
<ul>
<li>The new Netatmo support caused us to change how Netatmo are configured. Its now done via its own component.</li>
</ul>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">netatmo</span><span class="pi">:</span>
<span class="s">api_key</span><span class="pi">:</span> <span class="s">API_KEY</span>
<span class="s">secret_key</span><span class="pi">:</span> <span class="s">SECRET_KEY</span>
<span class="s">username</span><span class="pi">:</span> <span class="s">username</span>
<span class="s">password</span><span class="pi">:</span> <span class="s">password</span>
</code></pre>
</div>
<h3><a class="title-link" name="hotfix-0221---june-20" href="#hotfix-0221---june-20"></a> Hotfix 0.22.1 - June 20</h3>
<ul>
<li>Insteon Hub lights will load again</li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Home Assistant at PyCon 2016]]></title>
<link href="https://home-assistant.io/blog/2016/06/13/home-assistant-at-pycon-2016/"/>
<updated>2016-06-13T01:06:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/06/13/home-assistant-at-pycon-2016</id>
<content type="html"><![CDATA[<p>Its been already almost two weeks ago that a few of the Home Assistant developers headed towards Portland for <a href="https://us.pycon.org/2016/">PyCon 2016</a> - the conference about everything Python. We were there to learn all the nifty tricks to make our code better but most of all, to talk Home Automation.</p>
<p class="img">
<img src="https://home-assistant.io/images/blog/2016-06-pycon/crew.jpg" alt="Home Assistant developers" />
Couple of Home Assistant devs. Left to right: <a href="https://github.com/balloob/">Paulus (@balloob)</a>, <a href="https://github.com/infamy/">Alex (@infamy)</a>, <a href="https://github.com/rmkraus/">Ryan (@rmkraus)</a>.
</p>
<p>On Monday I (Paulus) gave a presentation about Home Assistant to an audience of over 400 people! It was a bit scary at first but after a couple of minutes it went all great including some great questions afterwards. Slides can be found <a href="https://docs.google.com/presentation/d/1F1pGOoSf0dD79Dl5dgys0ll7xiuIA4XiQeNeJ-xlqMg/edit">here</a> and the talk is embedded right below:</p>
<div class="videoWrapper">
<iframe width="560" height="315" src="https://www.youtube.com/embed/UhccJacWhdM" frameborder="0" allowfullscreen=""></iframe>
</div>
<p>One of the things that really impressed me was the amount of people that approached us to tell how they love Home Assistant, how it has replaced their previous solution, how they enjoyed contributing to Home Assistant and how helpful our community is. It makes me proud of Home Assistant and especially our community.</p>
<!--more-->
<p>PyCon has a few great concepts that I havent seen at other conferences: open spaces and sprints. Open spaces give anyone the opportunity to get a room and host a session for an hour to talk about any topic. Sprints happen after the conference part of PyCon is over. For four days there are rooms available for participants to get together and hack on their favorite open source projects.</p>
<p>My talk had limited time for Q&amp;A so open spaces offered a great opportunity to get all pending questions answered and connect with the commmunity. There was more interest after the first day so we ended up hosting another open space on the second day.</p>
<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr"><a href="https://twitter.com/anschoen">@anschoen</a> <a href="https://twitter.com/home_assistant">@home_assistant</a> I&#39;m located in Detroit. I could facilitate a workshop. What are we talking (group, potential dates, etc)?</p>&mdash; Jonathan Baginski (@jbags81) <a href="https://twitter.com/jbags81/status/739057625636167680">June 4, 2016</a></blockquote>
<p>Weve had such positive reception on our open spaces that <a href="https://github.com/jbags81/">Jonathan Baginski</a> decided to repeat it online. We will be hosting a free online webinar <a href="https://www.eventbrite.com/e/home-assistant-support-101-getting-around-in-home-assistant-tickets-25943868810">Home Assistant Support 101 - Getting around in Home Assistant</a> later this month. Make sure to RSVP.</p>
<p>After the conference part of PyCon was over we spent one extra day to host a Home Assistant sprint. This allowed us to help people get started with hacking on Home Assistant which lead to some great contributions.</p>
<p class="img">
<img src="https://home-assistant.io/images/blog/2016-06-pycon/sprint.jpg" alt="Home Assistant sprint group photo" />
Home Assistant sprint group photo.
</p>
<p>Ive had a really great time at PyCon. It was awesome to meet everyone in person and I hope to see many of you next year!</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[0.21: Improved Web and support for EnOcean, LIRC and Osram Lightify]]></title>
<link href="https://home-assistant.io/blog/2016/06/08/super-fast-web-enocean-lirc/"/>
<updated>2016-06-08T01:06:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/06/08/super-fast-web-enocean-lirc</id>
<content type="html"><![CDATA[<p>Its time for release 0.21 and it contains massive core improvements: replacement of our home grown HTTP stack with a standardized WSGI stack. This will improve performance, speed, security and make future development of advanced HTTP features a breeze.</p>
<p>This work was driven by the amazing Josh Wright. His knowledge, high standards and drive for security has helped improve Home Assistant a lot ever since he started helping out. Hip hip hurray for Josh!</p>
<p>Alright, time for the changes:</p>
<p><img src="https://home-assistant.io/images/supported_brands/enocean.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="150" /><img src="https://home-assistant.io/images/supported_brands/osramlightify.png" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="150" /><img src="https://home-assistant.io/images/supported_brands/lirc.gif" style="clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;" width="150" /></p>
<ul>
<li>New HTTP stack based on WSGI (<a href="https://github.com/JshWright">@JshWright</a>, <a href="https://github.com/balloob">@balloob</a>)</li>
<li>Frontend: lots of performance improvements (<a href="https://github.com/balloob">@balloob</a>)</li>
<li>Initial support for EnOcean <a href="https://home-assistant.io/components/light.enocean/">lights</a>, <a href="https://home-assistant.io/components/sensor.enocean/">sensors</a> and <a href="https://home-assistant.io/components/switch.enocean/">switches</a> added (<a href="https://github.com/rubund">@rubund</a>)</li>
<li>Light: <a href="https://home-assistant.io/components/light.osramlightify/">Osram Lightify</a> is now supported (<a href="https://github.com/olimpiurob">@olimpiurob</a>)</li>
<li>Light: <a href="https://home-assistant.io/components/insteon_hub/">Insteon Hub</a> now supports brightness (<a href="https://github.com/wkonkel">@wkonkel</a>)</li>
<li>Add support for adding HA as Windows 10 tile (<a href="https://github.com/fabaff">@fabaff</a>)</li>
<li>Condition: <a href="https://home-assistant.io/getting-started/scripts-conditions/#time-condition/">time condition</a> can now cross midnight (<a href="https://github.com/jaharkes">@jaharkes</a>)</li>
<li>Template based sensors should now throw less warnings (<a href="https://github.com/Bart274">@Bart274</a>)</li>
<li>New <a href="https://home-assistant.io/components/lirc/">LIRC component</a> allows receiving IR commands (<a href="https://github.com/partofthething">@partofthething</a>)</li>
<li>The <a href="https://home-assistant.io/components/feedreader/">Feedreader</a> component will now persist data to disk to prevent duplicate events (<a href="https://github.com/shaftoe">@shaftoe</a>)</li>
<li>Sun: azimuth attribute added (<a href="https://github.com/fabaff">@fabaff</a>)</li>
<li>New <a href="https://home-assistant.io/components/switch.flux/">Flux like switch platform</a> to change light intensity in the evening (<a href="https://github.com/nkgilley">@nkgilley</a>)</li>
<li>We no longer crash if you live in a part of the world where the sun never sets (<a href="https://github.com/balloob">@balloob</a>)</li>
<li>Rollershutter: <a href="https://home-assistant.io/components/rfxtrx/">RFXTRX</a> now supported (<a href="https://github.com/jacobtomlinson">@jacobtomlinson</a>)</li>
<li>Switch: <a href="https://home-assistant.io/components/switch.template/">Template switches</a> can now execute scripts (<a href="https://github.com/kellerza">@kellerza</a>)</li>
<li>Z-Wave: automatically heal the network at midnight (<a href="https://github.com/infamy">@infamy</a>)</li>
<li>Sensor: <a href="https://home-assistant.io/components/sensor.dte_energy_bridge/">DTE Energy Bridge</a> now supported (<a href="https://github.com/kylehendricks">@kylehendricks</a>)</li>
<li>Media Player: <a href="https://home-assistant.io/components/media_player.kodi/">Kodi</a> now supports different turn off commands (<a href="https://github.com/armills">@armills</a>)</li>
</ul>
<h3>Breaking Changes</h3>
<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>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="https://home-assistant.io/developers/rest_api/">been updated</a>.</li>
<li>Make sure your configuration.yaml file contains <code class="highlighter-rouge">frontend:</code> to serve the frontend</li>
</ul>
<h3>Hotfixes 0.21.1 and 0.21.2</h3>
<p>We released two hotfixes to address some issues that couldnt wait till the next release.</p>
<h5>0.21.1 - June 12</h5>
<ul>
<li>Add eventlet to base requirements to resolve some installation issues (<a href="https://github.com/balloob">@balloob</a>)</li>
<li>GTFS will filter out routes in the wrong direction (<a href="https://github.com/imrehg">@imrehg</a>)</li>
<li>Recover from rare error condition from LIRC (<a href="https://github.com/partofthething">@partofthething</a>)</li>
<li>Z-Wave autoheal will no longer raise exception (<a href="https://github.com/balloob">@balloob</a>)</li>
<li>Alexa will now execute the script before making reply (<a href="https://github.com/balloob">@balloob</a>)</li>
<li>Fix MJPEG camera streaming (<a href="https://github.com/stjohnjohnson">@stjohnjohnson</a>)</li>
<li>Fix frontend in older browsers (<a href="https://github.com/balloob">@balloob</a>)</li>
<li>Fix history in more info dialog being cut off (<a href="https://github.com/balloob">@balloob</a>)</li>
</ul>
<h5>0.21.2 - June 15</h5>
<ul>
<li>Fix input_select calling the set_option service again when changed (<a href="https://github.com/persandstrom">@persandstrom</a>)</li>
<li>Fix more info dialog not being able to open on Safari (<a href="https://github.com/balloob">@balloob</a>)</li>
<li>Add support for OPTIONS HTTP command to get CORS working (<a href="https://github.com/JshWright">@JshWright</a>)</li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Community Highlights]]></title>
<link href="https://home-assistant.io/blog/2016/06/01/community-highlights/"/>
<updated>2016-06-01T18:34:00+00:00</updated>
<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>
<h3><a class="title-link" name="scenegen---cli-for-making-scenes" href="#scenegen---cli-for-making-scenes"></a> SceneGen - cli for making scenes</h3>
<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>
<h3><a class="title-link" name="videos" href="#videos"></a> Videos</h3>
<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>
<div class="videoWrapper">
<iframe width="560" height="315" src="https://www.youtube.com/embed/6I_Lfpda0hc" frameborder="0" allowfullscreen=""></iframe>
</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>
<div class="videoWrapper">
<iframe width="560" height="315" src="https://www.youtube.com/embed/VaWdvVVYU3A" frameborder="0" allowfullscreen=""></iframe>
</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>
<div class="videoWrapper">
<iframe width="560" height="315" src="https://www.youtube.com/embed/UM15pRk56h8" frameborder="0" allowfullscreen=""></iframe>
</div>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[iBeacons: How to track things that cant track themselves (part II)]]></title>
<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>
<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>
<p>In <a href="https://home-assistant.io/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>
<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>
<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>
<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>
<p>So if you put an iBeacon on your keys or in your car - then you can track them.</p>
<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!
</p>
<!--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>
<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>
<p class="img">
<img width="200" src="https://home-assistant.io/images/blog/2016-04-ibeacons/owntracks_beacon_setup.png" />
</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>
<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>
<p class="img">
<img width="200" src="https://home-assistant.io/images/blog/2016-05-ibeacons/keys_device.png" />
</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>
<p>If you park your car and go shopping - <em>device_tracker.beacon_car</em> will stop moving.</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="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">automation</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s1">'</span><span class="s">Open</span><span class="nv"> </span><span class="s">gate'</span>
<span class="s">trigger</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">state</span>
<span class="s">entity_id</span><span class="pi">:</span> <span class="s">device_tracker.beacon_car</span>
<span class="s">from</span><span class="pi">:</span> <span class="s1">'</span><span class="s">not_home'</span>
<span class="s">to</span><span class="pi">:</span> <span class="s1">'</span><span class="s">home'</span>
<span class="s">condition</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">condition</span><span class="pi">:</span> <span class="s">state</span>
<span class="s">entity_id</span><span class="pi">:</span> <span class="s">switch.gate</span>
<span class="s">state</span><span class="pi">:</span> <span class="s1">'</span><span class="s">off'</span>
<span class="s">action</span><span class="pi">:</span>
<span class="s">service</span><span class="pi">:</span> <span class="s">switch.turn_on</span>
<span class="s">entity_id</span><span class="pi">:</span> <span class="s">switch.gate</span>
</code></pre>
</div>
<p>Or warn you if you leave your keys behind</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">automation</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s1">'</span><span class="s">Forgotten</span><span class="nv"> </span><span class="s">keys'</span>
<span class="s">trigger</span><span class="pi">:</span>
<span class="s">platform</span><span class="pi">:</span> <span class="s">template</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="s">condition</span><span class="pi">:</span>
<span class="s">condition</span><span class="pi">:</span> <span class="s">template</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="s">action</span><span class="pi">:</span>
<span class="s">service</span><span class="pi">:</span> <span class="s">script.turn_on</span>
<span class="s">entity_id</span><span class="pi">:</span> <span class="s">script.send_key_alert</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="s">trigger</span><span class="pi">:</span>
<span class="s">platform</span><span class="pi">:</span> <span class="s">template</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="s">condition</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">condition</span><span class="pi">:</span> <span class="s">state</span>
<span class="s">entity_id</span><span class="pi">:</span> <span class="s">script.send_key_alert</span>
<span class="s">state</span><span class="pi">:</span> <span class="s1">'</span><span class="s">on'</span>
<span class="s">action</span><span class="pi">:</span>
<span class="s">service</span><span class="pi">:</span> <span class="s">script.turn_off</span>
<span class="s">entity_id</span><span class="pi">:</span> <span class="s">script.send_key_alert</span>
</code></pre>
</div>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">script</span><span class="pi">:</span>
<span class="s">send_key_alert</span><span class="pi">:</span>
<span class="s">sequence</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">delay</span><span class="pi">:</span>
<span class="s">minutes</span><span class="pi">:</span> <span class="s">2</span>
<span class="pi">-</span> <span class="s">service</span><span class="pi">:</span> <span class="s">notify.notify</span>
<span class="s">data</span><span class="pi">:</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="s">target</span><span class="pi">:</span> <span class="s1">'</span><span class="s">device/gregs_iphone'</span>
</code></pre>
</div>
<p>(The delay is needed for two reasons: -</p>
<ol>
<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>
<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 class="img">
<img width="300" src="http://bluesensenetworks.com/wp-content/uploads/2015/02/BlueBar-Beacon-Long-Range.jpg" />
</p>
<p>Long range / High power beacon</p>
<p class="img">
<img width="400" src="http://bluesensenetworks.com/wp-content/uploads/2015/02/BlueBar-Beacon-Weatherproof.jpg" />
</p>
<p>Waterproof beacon</p>
<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>
<p>All the beacons seem fine - and the long range unit does work over a longer range than my other beacons.</p>
<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>
<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>
<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>
<h3><a class="title-link" name="conclusion" href="#conclusion"></a> Conclusion</h3>
<p>As I said in <a href="https://home-assistant.io/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>
<h3><a class="title-link" name="notes" href="#notes"></a> Notes</h3>
<p>Please see the <a href="https://home-assistant.io/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>
</entry>
<entry>
<title type="html"><![CDATA[Raspberry Pi all-in-one installer]]></title>
<link href="https://home-assistant.io/blog/2016/05/22/get-started-with-all-in-one-installer/"/>
<updated>2016-05-22T16:06:00+00:00</updated>
<id>https://home-assistant.io/blog/2016/05/22/get-started-with-all-in-one-installer</id>
<content type="html"><![CDATA[<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="https://home-assistant.io/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="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;
</code></pre>
</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>
<div class="videoWrapper">
<iframe width="560" height="315" src="https://www.youtube.com/embed/VGl3KTrYo6s" frameborder="0" allowfullscreen=""></iframe>
</div>
]]></content>
</entry>
</feed>