Site updated at 2016-02-17 08:15:16 UTC
This commit is contained in:
parent
7db9a73b72
commit
4c9d901ffb
15 changed files with 450 additions and 171 deletions
|
@ -119,9 +119,11 @@
|
|||
<input name="advanced-installs" type="radio" id="upstart-install" checked="" />
|
||||
<input name="advanced-installs" type="radio" id="systemd-install" />
|
||||
<input name="advanced-installs" type="radio" id="osx-install" />
|
||||
<input name="advanced-installs" type="radio" id="synology-install" />
|
||||
<label class="menu-selector upstart" for="upstart-install">Upstart Daemon</label>
|
||||
<label class="menu-selector systemd" for="systemd-install">Systemd Daemon</label>
|
||||
<label class="menu-selector osx" for="osx-install">OS X</label>
|
||||
<label class="menu-selector synology" for="synology-install">Synology NAS</label>
|
||||
|
||||
<div class="advanced-installs upstart">
|
||||
<p>Many linux distributions use the Upstart system (or similar) for managing daemons. Typically, systems based on Debian 7 or previous use Upstart. This includes Ubuntu releases before 15.04 and all current Raspian releases. If you are unsure if your system is using Upstart, you may check with the following command:</p>
|
||||
|
@ -247,6 +249,55 @@ Home Assistant has been uninstalled.
|
|||
</div>
|
||||
|
||||
</div> <!-- OSX -->
|
||||
|
||||
<div class="advanced-installs synology">
|
||||
<p>To get Home Assistant to automatically start when you boot your Synology NAS:</p>
|
||||
|
||||
<p>SSH onto your synology & login as admin or root</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ cd /volume1/homeassistant
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>Create “homeassistant.conf” file using the following code</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre># only start this service after the httpd user process has started
|
||||
start on started httpd-user
|
||||
|
||||
# stop the service gracefully if the runlevel changes to 'reboot'
|
||||
stop on runlevel [06]
|
||||
|
||||
# run the scripts as the 'http' user. Running as root (the default) is a bad ide
|
||||
#setuid admin
|
||||
|
||||
# exec the process. Use fully formed path names so that there is no reliance on
|
||||
# the 'www' file is a node.js script which starts the foobar application.
|
||||
exec /bin/sh /volume1/homeassistant/hass-daemon start
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>Register the autostart</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ ln -s homeassistant-conf /etc/init/homeassistant-conf
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>Make the relevant files executable:</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ chmod -r 777 /etc/init/homeassistant-conf
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>That’s it - reboot your NAS and Home Assistant should automatically start</p>
|
||||
</div> <!-- SYNOLOGY -->
|
||||
</div>
|
||||
|
||||
<h3><a href="/getting-started/">« Back to Getting Started</a></h3>
|
||||
|
|
|
@ -119,9 +119,11 @@
|
|||
<input name="install-instructions" type="radio" id="normal-install" checked="" />
|
||||
<input name="install-instructions" type="radio" id="raspberry-install" />
|
||||
<input name="install-instructions" type="radio" id="docker-install" />
|
||||
<label class="menu-selector normal" for="normal-install">Install on local machine</label>
|
||||
<label class="menu-selector raspberry" for="raspberry-install">Install on a Raspberry Pi</label>
|
||||
<label class="menu-selector docker" for="docker-install">Install using Docker</label>
|
||||
<input name="install-instructions" type="radio" id="synology-install" />
|
||||
<label class="menu-selector normal" for="normal-install">Local machine</label>
|
||||
<label class="menu-selector raspberry" for="raspberry-install">Raspberry Pi</label>
|
||||
<label class="menu-selector docker" for="docker-install">Docker</label>
|
||||
<label class="menu-selector synology" for="synology-install">Synology NAS</label>
|
||||
|
||||
<div class="install-instructions normal">
|
||||
<p>Installing and running Home Assistant on your local machine is easy. Make sure you have <a href="https://www.python.org/downloads/">Python 3.4 or higher</a> installed and execute the following code in a console:</p>
|
||||
|
@ -191,6 +193,233 @@ $ hass
|
|||
</ul>
|
||||
|
||||
</div> <!-- INSTALL-INSTRUCTIONS RASPBERRY -->
|
||||
|
||||
<div class="install-instructions synology">
|
||||
|
||||
<p>The following configuration has been tested on Synology 415+ running DSM 5.2-5644 Update 3.</p>
|
||||
|
||||
<p>Running these commands will:</p>
|
||||
|
||||
<ul>
|
||||
<li>Install Home Assistant</li>
|
||||
<li>Enable Home Assistant to be launched on <a href="http://localhost:8123">http://localhost:8123</a></li>
|
||||
</ul>
|
||||
|
||||
<p>Using the Synology webadmin:</p>
|
||||
|
||||
<ul>
|
||||
<li>Install python3 using the Synology package centre</li>
|
||||
<li>Create homeassistant user and add to the “users” group</li>
|
||||
</ul>
|
||||
|
||||
<p>SSH onto your synology & login as admin or root</p>
|
||||
|
||||
<p>Check the path to python3 (assumed to be /usr/local/python3/bin)</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ cd /usr/local/python3/bin
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>Use PIP to install Homeassistant package</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ pip3 install homeassistant
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>Create homeassistant config directory & switch to it</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ mkdir /volume1/homeassistant
|
||||
$ cd /volume1/homeassistant
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>Create hass-daemon file using the following code (edit the variables in uppercase if necessary)</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>#!/bin/sh
|
||||
|
||||
# Package
|
||||
PACKAGE="homeassistant"
|
||||
DNAME="Home Assistant"
|
||||
|
||||
# Others
|
||||
USER="homeassistant"
|
||||
PYTHON_DIR="/usr/local/python3/bin"
|
||||
PYTHON="$PYTHON_DIR/python3"
|
||||
HASS="$PYTHON_DIR/hass"
|
||||
INSTALL_DIR="/volume1/homeassistant"
|
||||
PID_FILE="$INSTALL_DIR/home-assistant.pid"
|
||||
FLAGS="-v --config $INSTALL_DIR --pid-file $PID_FILE --daemon"
|
||||
REDIRECT="> $INSTALL_DIR/home-assistant.log 2>&1"
|
||||
|
||||
start_daemon ()
|
||||
{
|
||||
su ${USER} -s /bin/sh -c "$PYTHON $HASS $FLAGS $REDIRECT;"
|
||||
}
|
||||
|
||||
stop_daemon ()
|
||||
{
|
||||
kill `cat ${PID_FILE}`
|
||||
wait_for_status 1 20 || kill -9 `cat ${PID_FILE}`
|
||||
rm -f ${PID_FILE}
|
||||
}
|
||||
|
||||
daemon_status ()
|
||||
{
|
||||
if [ -f ${PID_FILE} ] && kill -0 `cat ${PID_FILE}` > /dev/null 2>&1; then
|
||||
return
|
||||
fi
|
||||
rm -f ${PID_FILE}
|
||||
return 1
|
||||
}
|
||||
|
||||
wait_for_status ()
|
||||
{
|
||||
counter=$2
|
||||
while [ ${counter} -gt 0 ]; do
|
||||
daemon_status
|
||||
[ $? -eq $1 ] && return
|
||||
let counter=counter-1
|
||||
sleep 1
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
if daemon_status; then
|
||||
echo ${DNAME} is already running
|
||||
exit 0
|
||||
else
|
||||
echo Starting ${DNAME} ...
|
||||
start_daemon
|
||||
exit $?
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
if daemon_status; then
|
||||
echo Stopping ${DNAME} ...
|
||||
stop_daemon
|
||||
exit $?
|
||||
else
|
||||
echo ${DNAME} is not running
|
||||
exit 0
|
||||
fi
|
||||
;;
|
||||
restart)
|
||||
if daemon_status; then
|
||||
echo Stopping ${DNAME} ...
|
||||
stop_daemon
|
||||
echo Starting ${DNAME} ...
|
||||
start_daemon
|
||||
exit $?
|
||||
else
|
||||
echo ${DNAME} is not running
|
||||
echo Starting ${DNAME} ...
|
||||
start_daemon
|
||||
exit $?
|
||||
fi
|
||||
;;
|
||||
status)
|
||||
if daemon_status; then
|
||||
echo ${DNAME} is running
|
||||
exit 0
|
||||
else
|
||||
echo ${DNAME} is not running
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
log)
|
||||
echo ${LOG_FILE}
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>Create links to python folders to make things easier in the future:</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ ln -s /usr/local/python3/bin python3
|
||||
$ ln -s /usr/local/python3/lib/python3.4/site-packages/homeassistant
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>Set the owner and permissions on your config folder</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ chown -r homeassistant:users /volume1/homeassistant
|
||||
$ chmod -r 660 /volume1/homeassistant
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>Make the daemon file executable:</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ chmod -r 777 /volume1/homeassistant/hass-daemon
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>Copy your configuration.yaml file into the config folder
|
||||
That’s it… you’re all set to go</p>
|
||||
|
||||
<p>Here are some useful commands:</p>
|
||||
|
||||
<ul>
|
||||
<li>Start Home Assistant:</li>
|
||||
</ul>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ sh hass-daemon start
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li>Stop Home Assistant:</li>
|
||||
</ul>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ sh hass-daemon stop
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li>Restart Home Assistant:</li>
|
||||
</ul>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ sh hass-daemon restart
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li>Upgrade Home Assistant::</li>
|
||||
</ul>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ python3/pip3 install --upgrade homeassistant
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> <!-- INSTALL-INSTRUCTIONS SYNOLOGY -->
|
||||
</div>
|
||||
|
||||
<h3><a class="title-link" name="troubleshooting" href="#troubleshooting"></a> Troubleshooting</h3>
|
||||
|
@ -202,7 +431,6 @@ $ hass
|
|||
<ul>
|
||||
<li><a href="https://automic.us/forum/">Forum</a></li>
|
||||
<li><a href="https://gitter.im/balloob/home-assistant">Gitter Chatroom</a> for general Home Assistant discussions and questions.</li>
|
||||
<li><a href="https://groups.google.com/forum/#!forum/home-assistant-dev">Development Mailing List</a> for development related questions and discussing new features.</li>
|
||||
<li><a href="https://github.com/balloob/home-assistant/issues">GitHub Page</a> for issue reporting.</li>
|
||||
</ul>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue