Site updated at 2015-10-29 07:09:11 UTC

This commit is contained in:
Paulus Schoutsen 2015-10-29 00:09:11 -07:00
parent 7412a60701
commit b260f2881e
362 changed files with 42053 additions and 256343 deletions

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: frontend | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/frontend/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/>
<updated>2015-10-27T12:45:27-07:00</updated>
<updated>2015-10-29T00:08:34-07:00</updated>
<id>https://home-assistant.io/</id>
<author>
<name><![CDATA[Paulus Schoutsen]]></name>
@ -22,21 +22,17 @@
<p>A new toggle has been added ot the sidebar to turn streaming updates on and off. This preference will be saved on a per-browser basis using local storage. The toggle will also indicate when there is an error setting up a stream after which it will fall back to use polling.</p>
<p class='img'><img src='https://home-assistant.io/images/screenshots/streaming-updates.png' /></p>
<p class="img"><img src="https://home-assistant.io/images/screenshots/streaming-updates.png" /></p>
<!--more-->
<p>Streaming updates has been implemented using the HTML5 <code>EventSource</code> tag. Implementation is pretty straight forward as all the reconnection logic will be handled by the event source tag. The <a href="https://github.com/balloob/home-assistant/blob/master/homeassistant/components/api.py#L90">server-side code</a> is 50 lines and the <a href="https://github.com/balloob/home-assistant-js/blob/master/src/actions/stream.js">client-side code</a> is 80 lines of code.</p>
<p>All events that happen on the server will now also be sent to the browser. This turns any browser running the UI into a fully functioning <a href="https://home-assistant.io/developers/architecture.html#multiple-connected-instances">slave instance</a> of Home Assistant. This opens up new possibilities for Home Assistant components that live completely client-side.</p>
<p>All events that happen on the server will now also be sent to the browser. This turns any browser running the UI into a fully functioning <a href="https://home-assistant.io/developers/architecture/#multiple-connected-instances">slave instance</a> of Home Assistant. This opens up new possibilities for Home Assistant components that live completely client-side.</p>
<p>Implementing EventSource was not without challenges. Here are some of the issues that had to be solved:</p>
<p>A connection can go stale in Chrome without any event handler being called. This happens when a device goes into standby. For computers this is rare but for phones this occurs quite often. This has been solved by sending a regular ping from the server. The frontend will assume the connection has gone stale when it hasn&rsquo;t heard any communication for a while. Sending a ping will also help the server detect broken connections and clean them up.</p>
<p>A connection can go stale in Chrome without any event handler being called. This happens when a device goes into standby. For computers this is rare but for phones this occurs quite often. This has been solved by sending a regular ping from the server. The frontend will assume the connection has gone stale when it hasnt heard any communication for a while. Sending a ping will also help the server detect broken connections and clean them up.</p>
<p>Another issue that I encountered is that Safari and Firefox would not fire the <code>open</code> event when the connection has been opened but when the first message has been received. To work around this the server will now fire a ping when the connection gets opened.</p>
]]></content>
@ -50,44 +46,35 @@
<content type="html"><![CDATA[<p>Ever since the launch of Home Assistant you have been able to track the state of your house. But the view has always been limited to what the current state is. Not what it was. Today we are going to change that by introducing two brand new components:</p>
<ul>
<li>Recorder component that will record every event to a SQLite database</li>
<li>History component that will query and aggregate the recorded events</li>
<li>Recorder component that will record every event to a SQLite database</li>
<li>History component that will query and aggregate the recorded events</li>
</ul>
<p>By adding this view into the past, we are adding an extra dimension into the state of your house. This brings great new possibilities for future features. The focus of todays release is on getting the recording component to you to start recording and getting some data. To show what is being recorded a view has been added that shows the last 24 hours of your house. Expect more extensive tools to explore your history in the future.</p>
<p>Adding history to the UI was a challenge on itself because the old UI did not support easy navigation. So to add to the awesomeness of this release, Home Assistant also got a face lift.</p>
<p>The history component will be enabled for new users by default. For current users, run <code>scripts/update</code> to upgrade to the latest version and add <code>[history]</code> to your <code>home-assistant.conf</code> file.</p>
<p class='img'>
<a href='/images/screenshots/component_history_24h.png'>
<img src='/images/screenshots/component_history_24h.png' />
<p class="img">
<a href="/images/screenshots/component_history_24h.png">
<img src="/images/screenshots/component_history_24h.png" />
</a>
</p>
<p class='note'>
<p class="note">
Events are saved in a local database. Google Graphs is used to draw the graph. Drawing is happening 100% in your browser - no data is transfered to anyone at any time.
</p>
<!--more-->
<p>Tracking history is an exciting next step for Home Assistant and will power the next generation of features. Here a list of some of the cool things that can now be build:</p>
<ul>
<li>Time Machine: explore the state of your house at any point in the past</li>
<li>Smart Home: analyze behavior and use it to automate your house</li>
<li>Summarize usage of the different components of your house</li>
<li>Time Machine: explore the state of your house at any point in the past</li>
<li>Smart Home: analyze behavior and use it to automate your house</li>
<li>Summarize usage of the different components of your house</li>
</ul>
]]></content>
</entry>

View file

@ -5,8 +5,6 @@
<!--[if gt IE 8]><!--> <html> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
@ -32,7 +30,6 @@
<link rel='icon' type='image/png' href='/images/favicon-192x192.png' sizes='192x192' />
</head>
<body >
<header>
@ -54,10 +51,10 @@
<a href="/getting-started/">Getting started</a>
<ul>
<li><a href='/getting-started/'>Installing Home Assistant</a></li>
<li><a href='/getting-started/configuration.html'>Configuration basics</a></li>
<li><a href='/getting-started/devices.html'>Adding devices</a></li>
<li><a href='/getting-started/presence-detection.html'>Presence detection</a></li>
<li><a href='/getting-started/automation.html'>Automation</a></li>
<li><a href='/getting-started/configuration/'>Configuration basics</a></li>
<li><a href='/getting-started/devices/'>Adding devices</a></li>
<li><a href='/getting-started/presence-detection/'>Presence detection</a></li>
<li><a href='/getting-started/automation/'>Automation</a></li>
<li><a href='/cookbook'>Configuration cookbook</a></li>
</ul>
</li>
@ -65,26 +62,24 @@
<li>
<a href="/developers/">Developers</a>
<ul>
<li><a href="/developers/architecture.html">Architecture</a></li>
<li><a href="/developers/frontend.html">Frontend development</a></li>
<li><a href="/developers/creating_components.html">
<li><a href="/developers/architecture/">Architecture</a></li>
<li><a href="/developers/frontend/">Frontend development</a></li>
<li><a href="/developers/creating_components/">
Creating components
</a></li>
<li><a href="/developers/add_new_platform.html">
<li><a href="/developers/add_new_platform/">
Adding platform support
</a></li>
<li><a href="/developers/api.html">API</a></li>
<li><a href="/developers/credits.html">Credits</a></li>
<li><a href="/developers/api/">API</a></li>
<li><a href="/developers/credits/">Credits</a></li>
</ul>
</li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</ul>
</nav>
</div>
</div>
</div>
</header>
@ -116,9 +111,7 @@
<h2>2015</h2>
<article>
<div class="grid">
<div class="grid">
<div class="grid__item one-fifth palm-one-whole">
<time datetime="2015-02-24T22:41:27-08:00" pubdate>
@ -129,9 +122,7 @@
<h1 class="gamma"><a href="/blog/2015/02/24/streaming-updates/">Streaming updates</a></h1>
<footer class="meta">
<span>
<span>
<i class="icon-tags"></i>
<ul class="tags unstyled">
@ -141,7 +132,6 @@
</ul>
</span>
</footer>
<hr class="divider">
@ -153,9 +143,7 @@
<article>
<div class="grid">
<div class="grid">
<div class="grid__item one-fifth palm-one-whole">
<time datetime="2015-02-08T09:01:23-08:00" pubdate>
@ -166,9 +154,7 @@
<h1 class="gamma"><a href="/blog/2015/02/08/looking-at-the-past/">Looking at the past</a></h1>
<footer class="meta">
<span>
<span>
<i class="icon-tags"></i>
<ul class="tags unstyled">
@ -180,7 +166,6 @@
</ul>
</span>
</footer>
<hr class="divider">
@ -203,21 +188,20 @@
<section class="sharing aside-module grid__item one-whole lap-one-half">
<h1 class="title delta">Share this post</h1>
<a href="//twitter.com/share"
class="twitter-share-button"
data-url="https://home-assistant.io/blog/categories/frontend/index.html"
data-counturl="https://home-assistant.io/blog/categories/frontend/index.html" >Tweet</a>
data-url="https://home-assistant.io/blog/categories/frontend/"
data-counturl="https://home-assistant.io/blog/categories/frontend/" >Tweet</a>
<div class="g-plusone" data-size="standard"></div>
<div class="fb-share-button" style='top: -6px;'
data-href="https://home-assistant.io/blog/categories/frontend/index.html"
data-href="https://home-assistant.io/blog/categories/frontend/"
data-layout="button_count">
</div>
@ -285,7 +269,6 @@
</div>
</aside>
</div>
@ -296,30 +279,23 @@
<div class="grid">
<div class="grid__item">
<p class="copyright">
<span class="credit">Powered by <a href="http://octopress.org">Octopress</a>, <a href='http://jekyllrb.com/'>Jekyll</a> and the <a href='https://github.com/coogie/oscailte'>Oscalite theme</a>. Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.</span>
<span class="credit">Powered by <a href='http://jekyllrb.com/'>Jekyll</a> and the <a href='https://github.com/coogie/oscailte'>Oscalite theme</a>. Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.</span>
</p>
</div>
</div>
</div>
</footer>
<!--[if lt IE 7]>
<p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
<![endif]-->
<script>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
<script>
var disqus_shortname = 'home-assistant';
@ -333,13 +309,5 @@
}());
</script>
</body>
</html>