Site updated at 2015-01-04 22:21:16 UTC
This commit is contained in:
parent
9a8a71a9fd
commit
549663dbc7
14 changed files with 1289 additions and 15 deletions
330
blog/2015/01/04/hey-pushbullet-nice-talking-to-you/index.html
Normal file
330
blog/2015/01/04/hey-pushbullet-nice-talking-to-you/index.html
Normal file
|
@ -0,0 +1,330 @@
|
|||
<!doctype html>
|
||||
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
|
||||
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
|
||||
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
|
||||
<!--[if gt IE 8]><!--> <html> <!--<![endif]-->
|
||||
|
||||
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>Hello PushBullet, nice talking to you - Home Assistant</title>
|
||||
<meta name="author" content="Paulus Schoutsen">
|
||||
|
||||
<meta name="description" content="Introducing the new notify component and PushBullet platform">
|
||||
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<link rel="canonical" href="https://home-assistant.io">
|
||||
|
||||
<meta property="fb:app_id" content="338291289691179">
|
||||
<meta property="og:title" content="Hello PushBullet, nice talking to you">
|
||||
<meta property="og:site_name" content="Home Assistant">
|
||||
<meta property="og:url" content="https://home-assistant.io/blog/2015/01/04/hey-pushbullet-nice-talking-to-you/">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:description" content="Introducing the new notify component and PushBullet platform">
|
||||
|
||||
|
||||
|
||||
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet">
|
||||
<link href="/atom.xml" rel="alternate" title="Home Assistant" type="application/atom+xml">
|
||||
<link rel='shortcut icon' href='/images/favicon.ico' />
|
||||
<link rel='icon' type='image/png' href='/images/favicon-192x192.png' sizes='192x192' />
|
||||
</head>
|
||||
|
||||
|
||||
<body >
|
||||
|
||||
<header>
|
||||
<div class="grid-wrapper">
|
||||
<div class="grid">
|
||||
|
||||
<div class="grid__item three-tenths lap-two-sixths palm-one-whole ha-title">
|
||||
<a href="/" class="site-title">
|
||||
<img width='40' src='/images/favicon-192x192.png'> Home Assistant
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="grid__item seven-tenths lap-four-sixths palm-one-whole">
|
||||
<nav>
|
||||
<input type="checkbox" id="toggle">
|
||||
<label for="toggle" class="toggle" data-open="Main Menu" data-close="Close Menu"></label>
|
||||
<ul class="menu pull-right">
|
||||
<li><a href="/getting-started/">Getting started</a></li>
|
||||
<li>
|
||||
<a href="/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">
|
||||
Creating components
|
||||
</a></li>
|
||||
<li><a href="/developers/add_new_platform.html">
|
||||
Adding platform support
|
||||
</a></li>
|
||||
<li><a href="/developers/api.html">Rest API</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="/blog/">Blog</a></li>
|
||||
<li><a href="https://groups.google.com/forum/#!forum/home-assistant-dev">Need help?</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
<div class="grid-wrapper">
|
||||
<div class="grid grid-center">
|
||||
|
||||
<div class="grid__item two-thirds lap-one-whole palm-one-whole">
|
||||
|
||||
|
||||
<article class="post">
|
||||
<header>
|
||||
|
||||
<h1 class="title indent">Hello PushBullet, nice talking to you</h1>
|
||||
|
||||
|
||||
|
||||
<div class="meta clearfix">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<time datetime="2015-01-04T13:29:07-08:00" pubdate data-updated="true"><i class="icon-calendar"></i> January 4, 2015</time>
|
||||
|
||||
|
||||
|
||||
<span class="byline author vcard"><i class='icon-user'></i> Paulus Schoutsen</span>
|
||||
|
||||
<span><i class='icon-time'></i> 1 minute reading time</span>
|
||||
|
||||
|
||||
<span>
|
||||
<i class="icon-tags"></i>
|
||||
<ul class="tags unstyled">
|
||||
|
||||
|
||||
<li><a class='category' href='/blog/categories/component/'>component</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
</span>
|
||||
|
||||
|
||||
<a class='comments'
|
||||
href="#disqus_thread"
|
||||
>Comments</a>
|
||||
|
||||
</div>
|
||||
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<p>One of the things that was missing in Home Assistant for a while was a way to communicate with users. Wouldn’t it be nice to get a message when important events happen like the lights being turned on while no one is home? Since the Home Assistant frontend runs as a web application on the phone, we have no way to bring ourselves to the front. This is where the new notify component comes in, powered by PushBullet.</p>
|
||||
|
||||
<p>The new notify component will take in messages and tells them to the user. For now this will be powered by the very awesome <a href="https://www.pushbullet.com/">PushBullet</a> but any other messaging platform can be easily added.</p>
|
||||
|
||||
<p class='img'>
|
||||
<img src='/images/screenshots/pushbullet_moto360.png' />
|
||||
A message triggered by the simple_alarm component is shown by PushBullet on the Moto360.
|
||||
</p>
|
||||
|
||||
|
||||
<p>Read on to learn how to enable the notify component and integrate it with other components.</p>
|
||||
|
||||
<a name="read-more"></a>
|
||||
|
||||
|
||||
<h3>Enabling the notify component</h3>
|
||||
|
||||
<p>To enable the new notify component, add the following to your <code>home-assistant.conf</code>:</p>
|
||||
|
||||
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
|
||||
<span class='line-number'>2</span>
|
||||
<span class='line-number'>3</span>
|
||||
</pre></td><td class='code'><pre><code class=''><span class='line'>[notify]
|
||||
</span><span class='line'>platform=pushbullet
|
||||
</span><span class='line'>api_key=ABCDEFGHJKLMNOPQRSTUVXYZ</span></code></pre></td></tr></table></div></figure>
|
||||
|
||||
|
||||
<p>You can get your api key from <a href="https://www.pushbullet.com/account">your account page on PushBullet.com</a>.</p>
|
||||
|
||||
<h3>Sending messages from your component</h3>
|
||||
|
||||
<p>To be able to send messages, the notify component has to be loaded and initialized successfully.</p>
|
||||
|
||||
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
|
||||
<span class='line-number'>2</span>
|
||||
<span class='line-number'>3</span>
|
||||
<span class='line-number'>4</span>
|
||||
<span class='line-number'>5</span>
|
||||
</pre></td><td class='code'><pre><code class='python'><span class='line'><span class="kn">import</span> <span class="nn">homeassistant.loader</span> <span class="kn">as</span> <span class="nn">loader</span>
|
||||
</span><span class='line'>
|
||||
</span><span class='line'><span class="k">def</span> <span class="nf">setup</span><span class="p">(</span><span class="n">hass</span><span class="p">,</span> <span class="n">config</span><span class="p">):</span>
|
||||
</span><span class='line'> <span class="n">notify</span> <span class="o">=</span> <span class="n">loader</span><span class="o">.</span><span class="n">get_component</span><span class="p">(</span><span class="s">'notify'</span><span class="p">)</span>
|
||||
</span><span class='line'> <span class="n">notify</span><span class="o">.</span><span class="n">send_message</span><span class="p">(</span><span class="n">hass</span><span class="p">,</span> <span class="s">"Hello from my component!"</span><span class="p">)</span>
|
||||
</span></code></pre></td></tr></table></div></figure>
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
|
||||
<section id="disqus">
|
||||
<h3 class="indent title">Comments</h3>
|
||||
<div id="disqus_thread" aria-live="polite"><noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">
|
||||
<div class="grid">
|
||||
|
||||
|
||||
|
||||
|
||||
<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/2015/01/04/hey-pushbullet-nice-talking-to-you/"
|
||||
data-counturl="https://home-assistant.io/blog/2015/01/04/hey-pushbullet-nice-talking-to-you/" >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/2015/01/04/hey-pushbullet-nice-talking-to-you/"
|
||||
data-layout="button_count">
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
|
||||
|
||||
<script src="https://apis.google.com/js/platform.js" async defer></script>
|
||||
|
||||
<script>
|
||||
window.fbAsyncInit = function() {
|
||||
FB.init({
|
||||
appId : '338291289691179',
|
||||
xfbml : true,
|
||||
version : 'v2.2'
|
||||
});
|
||||
};
|
||||
|
||||
(function(d, s, id){
|
||||
var js, fjs = d.getElementsByTagName(s)[0];
|
||||
if (d.getElementById(id)) {return;}
|
||||
js = d.createElement(s); js.id = id;
|
||||
js.src = "//connect.facebook.net/en_US/sdk.js";
|
||||
fjs.parentNode.insertBefore(js, fjs);
|
||||
}(document, 'script', 'facebook-jssdk'));
|
||||
</script>
|
||||
<section id="recent-posts" class="aside-module grid__item one-whole lap-one-half">
|
||||
<h1 class="title delta">Other Posts</h1>
|
||||
<ul class="divided">
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="post">
|
||||
<a href="/blog/2014/12/26/home-control-home-automation-and-the-smart-home/">Home Control, Automation & the Smart Home</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="post">
|
||||
<a href="/blog/2014/12/18/website-launched/">Website launched!</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</aside>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="grid-wrapper">
|
||||
<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>
|
||||
</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>
|
||||
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';
|
||||
|
||||
|
||||
// var disqus_developer = 1;
|
||||
var disqus_identifier = 'https://home-assistant.io/blog/2015/01/04/hey-pushbullet-nice-talking-to-you/';
|
||||
var disqus_url = 'https://home-assistant.io/blog/2015/01/04/hey-pushbullet-nice-talking-to-you/';
|
||||
var disqus_script = 'embed.js';
|
||||
|
||||
(function () {
|
||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||
dsq.src = '//' + disqus_shortname + '.disqus.com/' + disqus_script;
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
}());
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue