Site updated at 2017-03-18 17:12:07 UTC
This commit is contained in:
parent
7573fcba68
commit
67179bf8fe
994 changed files with 1768 additions and 68252 deletions
|
@ -3,17 +3,14 @@
|
|||
<!--[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>HAPush - Home Assistant</title>
|
||||
<meta name="author" content="Home Assistant">
|
||||
<meta name="description" content="HAPush">
|
||||
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<link rel="canonical" href="https://home-assistant.io/docs/ecosystem/hadashboard/hapush/">
|
||||
|
||||
<meta property="fb:app_id" content="338291289691179">
|
||||
<meta property="og:title" content="HAPush">
|
||||
<meta property="og:site_name" content="Home Assistant">
|
||||
|
@ -21,39 +18,31 @@
|
|||
<meta property="og:type" content="article">
|
||||
<meta property="og:description" content="HAPush">
|
||||
<meta property="og:image" content="https://home-assistant.io/images/default-social.png">
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:site" content="@home_assistant">
|
||||
|
||||
<meta name="twitter:title" content="HAPush">
|
||||
<meta name="twitter:description" content="HAPush">
|
||||
<meta name="twitter:image" content="https://home-assistant.io/images/default-social.png">
|
||||
|
||||
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet">
|
||||
<link href="/atom.xml" rel="alternate" title="Home Assistant" type="application/atom+xml">
|
||||
<link rel='shortcut icon' href='/images/favicon.ico' />
|
||||
<link rel='icon' type='image/png' href='/images/favicon-192x192.png' sizes='192x192' />
|
||||
</head>
|
||||
|
||||
<body >
|
||||
|
||||
<header>
|
||||
<div class="grid-wrapper">
|
||||
<div class="grid">
|
||||
|
||||
<div class="grid__item three-tenths lap-two-sixths palm-one-whole ha-title">
|
||||
<a href="/" class="site-title">
|
||||
<img width='40' src='/demo/favicon-192x192.png'>
|
||||
<span>Home Assistant</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="grid__item seven-tenths lap-four-sixths palm-one-whole">
|
||||
<nav>
|
||||
<input type="checkbox" id="toggle">
|
||||
<label for="toggle" class="toggle" data-open="Main Menu" data-close="Close Menu"></label>
|
||||
<ul class="menu pull-right">
|
||||
|
||||
<li><a href="/getting-started/">Getting started</a></li>
|
||||
<li><a href="/components/">Components</a></li>
|
||||
<li><a href="/docs/">Docs</a></li>
|
||||
|
@ -64,69 +53,43 @@
|
|||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
<div class="grid-wrapper">
|
||||
<div class="grid grid-center">
|
||||
|
||||
<div class="grid__item two-thirds lap-one-whole palm-one-whole">
|
||||
|
||||
|
||||
<article class="page">
|
||||
|
||||
|
||||
<div class='edit-github'><a href='https://github.com/home-assistant/home-assistant.github.io/tree/current/source/_docs/ecosystem/hadashboard/hapush.markdown'>Edit this page on GitHub</a></div>
|
||||
|
||||
|
||||
|
||||
<header>
|
||||
<h1 class="title indent">
|
||||
HAPush
|
||||
</h1>
|
||||
</header>
|
||||
<hr class="divider">
|
||||
|
||||
|
||||
<h1>Installing hapush (Manual install only)</h1>
|
||||
|
||||
<p>This is not necessary if you are using Docker as it is already installed.</p>
|
||||
|
||||
<p>When you have the dashboard correctly displaying and interacting with Home Assistant you are ready to install the final component - <code class="highlighter-rouge">hapush</code>. Without <code class="highlighter-rouge">hapush</code> the dashboard would not respond to events that happen outside of the hadashboard system. For instance, if someone uses the Home Assistant interface to turn on a light, or even another App or physical switch, there is no way for the Dashboard to reflect this change. This is where <code class="highlighter-rouge">hapush</code> comes in.</p>
|
||||
|
||||
<p><code class="highlighter-rouge">hapush</code> is a python daemon that listens to Home Assistant’s Event Stream and pushes changes back to the dashboard to update it in real time. You may want to create a <a href="https://docs.python.org/3/library/venv.html">Virtual Environment</a> for hapush - at the time of writing there is a conflict in the Event Source versions in use between HA and hapush.</p>
|
||||
|
||||
<p>Before running <code class="highlighter-rouge">hapush</code> you will need to add some python prerequisites:</p>
|
||||
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sudo pip3 install daemonize
|
||||
<span class="gp">$ </span>sudo pip3 install sseclient
|
||||
<span class="gp">$ </span>sudo pip3 install configobj
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<p>Some users are reporting errors with <code class="highlighter-rouge">InsecureRequestWarning</code>:</p>
|
||||
|
||||
<div class="highlighter-rouge"><pre class="highlight"><code>Traceback (most recent call last):
|
||||
File "./hapush.py", line 21, in <module>
|
||||
from requests.packages.urllib3.exceptions import InsecureRequestWarning
|
||||
ImportError: cannot import name 'InsecureRequestWarning'
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<p>This can be fixed with:</p>
|
||||
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sudo pip3 install --upgrade requests
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<h2><a class="title-link" name="configuring-hapush-all-installation-methods" href="#configuring-hapush-all-installation-methods"></a> Configuring hapush (all installation methods)</h2>
|
||||
|
||||
<p>When you have all the prereqs in place, copy the hapush.cfg.example file to hapush.cfg then edit it to reflect your environment:</p>
|
||||
|
||||
<div class="highlighter-rouge"><pre class="highlight"><code>ha_url = "http://192.168.1.10:8123"
|
||||
ha_key = api_key
|
||||
dash_host = "192.168.1.10:3030"
|
||||
|
@ -134,7 +97,6 @@ dash_dir = "/srv/hass/src/hadashboard/dashboards"
|
|||
logfile = "/etc/hapush/hapush.log"
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><code class="highlighter-rouge">ha_url</code> is a reference to your home assistant installation and must include the correct port number and scheme (<code class="highlighter-rouge">http://</code> or <code class="highlighter-rouge">https://</code> as appropriate)</li>
|
||||
<li><code class="highlighter-rouge">ha_key</code> should be set to your key if you have one, otherwise it can be removed.</li>
|
||||
|
@ -142,19 +104,13 @@ logfile = "/etc/hapush/hapush.log"
|
|||
<li><code class="highlighter-rouge">dash_dir</code> is the path on the machine that stores your dashboards. This will be the subdirectory <code class="highlighter-rouge">dashboards</code> relative to the path you cloned <code class="highlighter-rouge">hadashboard</code> to. For Docker installs this should be set to <code class="highlighter-rouge">/app/dashboards</code></li>
|
||||
<li><code class="highlighter-rouge">logfile</code> is the path to where you want <code class="highlighter-rouge">hapush</code> to keep its logs. When run from the command line this is not used - log messages come out on the terminal. When running as a daemon this is where the log information will go. In the example above I created a directory specifically for hapush to run from, although there is no reason you can’t keep it in the <code class="highlighter-rouge">hapush</code> subdirectory of the cloned repository. For Docker installs this should be set to <code class="highlighter-rouge">/app/hapush/hapush.log</code></li>
|
||||
</ul>
|
||||
|
||||
<h2><a class="title-link" name="running-hapush" href="#running-hapush"></a> Running hapush</h2>
|
||||
|
||||
<p>For a manual installation you can then run hapush from the command line as follows:</p>
|
||||
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>./hapush.py hapush.cfg
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<p>For docker installs, hapush will be started automatically when you run the startup command.</p>
|
||||
|
||||
<p>If all is well, you should start to see <code class="highlighter-rouge">hapush</code> responding to events as they occur. For a docker installation you should see these messages in <code class="highlighter-rouge">hapush/hapush.log</code>.</p>
|
||||
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code>2016-06-19 10:05:59,693 INFO Reading dashboard: /srv/hass/src/hadashboard/dashboards/main.erb
|
||||
2016-06-19 10:06:12,362 INFO switch.wendy_bedside -> state <span class="o">=</span> on, brightness <span class="o">=</span> 50
|
||||
2016-06-19 10:06:13,334 INFO switch.andrew_bedside -> state <span class="o">=</span> on, brightness <span class="o">=</span> 50
|
||||
|
@ -177,18 +133,10 @@ logfile = "/etc/hapush/hapush.log"
|
|||
2016-06-19 10:07:51,478 INFO sensor.side_multisensor_relative_humidity_25 -> 52.0
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">
|
||||
<div class="grid">
|
||||
|
||||
|
||||
<section class="aside-module grid__item one-whole lap-one-half">
|
||||
<div class='section'>
|
||||
<h1 class="title delta">Topics</h1>
|
||||
|
@ -375,13 +323,10 @@ logfile = "/etc/hapush/hapush.log"
|
|||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="grid-wrapper">
|
||||
<div class="grid">
|
||||
|
@ -391,7 +336,6 @@ logfile = "/etc/hapush/hapush.log"
|
|||
<a rel="me" href='https://facebook.com/homeassistantio'><i class="icon-facebook"></i></a>
|
||||
<a rel="me" href='https://plus.google.com/110560654828510104551'><i class="icon-google-plus"></i></a>
|
||||
<a rel="me" href='https://github.com/home-assistant/home-assistant'><i class="icon-github"></i></a>
|
||||
|
||||
<div class="credit">
|
||||
Contact us at <a href='mailto:hello@home-assistant.io'>hello@home-assistant.io</a>.<br>
|
||||
Website powered by <a href='http://jekyllrb.com/'>Jekyll</a> and the <a href='https://github.com/coogie/oscailte'>Oscalite theme</a>.<br />
|
||||
|
@ -403,7 +347,6 @@ logfile = "/etc/hapush/hapush.log"
|
|||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
|
||||
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
|
||||
|
@ -411,4 +354,4 @@ logfile = "/etc/hapush/hapush.log"
|
|||
s.parentNode.insertBefore(g,s)}(document,'script'));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue