Skip to content

Commit

Permalink
Update getting started
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob committed Apr 17, 2016
1 parent 0202291 commit 432ee1a
Show file tree
Hide file tree
Showing 25 changed files with 691 additions and 540 deletions.
6 changes: 3 additions & 3 deletions plugins/active_link.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require 'pry'

module Jekyll
class ActiveLinkTag < Liquid::Tag
def initialize(tag_name, text, token)
Expand All @@ -10,8 +8,10 @@ def initialize(tag_name, text, token)
end

def render(context)
href = Liquid::Template.parse(@href).render context
title = Liquid::Template.parse(@title).render context
cls = @href == context.registers[:page]["url"] ? "class='active'" : ''
"<a #{cls} href='#{@href}'>#{@title}</a>"
"<a #{cls} href='#{href}'>#{title}</a>"
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion plugins/linkable_title.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def initialize(tag_name, text, token)
end

def render(context)
title = Liquid::Template.parse(@markup).render context
title = Liquid::Template.parse(@title).render context
slug = title.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')
"<a class='title-link' name='#{slug}' href='\##{slug}'></a> #{title}"
end
Expand Down
79 changes: 0 additions & 79 deletions sass/custom/_paulus.scss
Original file line number Diff line number Diff line change
Expand Up @@ -204,85 +204,6 @@ p.note {
}
}

.install-instructions-container {
#normal-install, #raspberry-install, #docker-install, #synology-install, .install-instructions {
display: none;
}

label.menu-selector {
display: inline-block;
text-align: center;
padding: 20px;
white-space: nowrap;
border-bottom: 5px solid $grayLight;
transition: border-bottom-color .5s;
}

label.menu-selector + label.menu-selector {
margin-left: 10px;
}

#normal-install:checked ~ .menu-selector.normal,
#raspberry-install:checked ~ .menu-selector.raspberry,
#docker-install:checked ~ .menu-selector.docker,
#synology-install:checked ~ .menu-selector.synology
{
border-bottom-color: $blue;
}

#normal-install:checked ~ .install-instructions.normal,
#raspberry-install:checked ~ .install-instructions.raspberry,
#docker-install:checked ~ .install-instructions.docker,
#synology-install:checked ~ .install-instructions.synology
{
display: block;
}

.install-instructions {
margin-top: 30px;
}
}

.advanced-installs-container {

#upstart-install, #systemd-install, #osx-install, #synology-install, .advanced-installs {
display: none;
}

label.menu-selector {
display: inline-block;
text-align: center;
padding: 20px;
white-space: nowrap;
border-bottom: 5px solid $grayLight;
transition: border-bottom-color .5s;
}

label.menu-selector + label.menu-selector {
margin-left: 10px;
}

#upstart-install:checked ~ .menu-selector.upstart,
#systemd-install:checked ~ .menu-selector.systemd,
#osx-install:checked ~ .menu-selector.osx,
#synology-install:checked ~ .menu-selector.synology
{
border-bottom-color: $blue;
}

#upstart-install:checked ~ .advanced-installs.upstart,
#systemd-install:checked ~ .advanced-installs.systemd,
#osx-install:checked ~ .advanced-installs.osx,
#synology-install:checked ~ .advanced-installs.synology
{
display: block;
}

.advanced-installs {
margin-top: 30px;
}
}

#components-page {
.isotope-item {
z-index: 2;
Expand Down
40 changes: 40 additions & 0 deletions source/_includes/asides/getting_started_navigation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<section class="aside-module grid__item one-whole lap-one-half">
{% include edit_github.html %}

<div class='section'>
<h1 class="title delta">Getting Started Guide</h1>
<ul class='divided sidebar-menu'>
<li>
{% active_link /getting-started/ Installation %}
<ul>
<li>{% active_link /getting-started/installation-raspberry-pi/ Raspberry Pi %}</li>
<li>{% active_link /getting-started/installation-docker/ Docker %}</li>
<li>{% active_link /getting-started/installation-synology/ Synology NAS %}</li>
<li>{% active_link /getting-started/installation-virtualenv/ Virtual Environment %}</li>
<li>{% active_link /getting-started/troubleshooting/ Troubleshooting %}</li>
</ul>
</li>
<li>
Configuration
<ul>
<li>{% active_link /getting-started/configuration/ Configuration.yaml %}</li>
<li>{% active_link /getting-started/devices/ Setting up devices %}</li>
<li>{% active_link /getting-started/presence-detection/ Presence Detection %}</li>
<li>{% active_link /getting-started/automation/ Automation %}</li>
<li>{% active_link /getting-started/troubleshooting-configuration/ Troubleshooting configuration.yaml %}</li>
</ul>
</li>
<li>
Auto-start Home Assistant
<ul>
<li>{% active_link /getting-started/autostart-systemd/ Linux - SystemD %}</li>
<li>{% active_link /getting-started/autostart-upstart/ Linux - Upstart %}</li>
<li>{% active_link /getting-started/autostart-macos/ macOS %}</li>
<li>{% active_link /getting-started/autostart-synology/ Synology NAS %}</li>
</ul>
</li>
<li><a href='/topics/'>Advanced Topics</a></li>
<li>{% active_link /getting-started/android/ Add to Android Homescreen %}</li>
</ul>
</div>
</section>
22 changes: 11 additions & 11 deletions source/_includes/custom/navigation.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<ul class="menu pull-right">
<li>
<a>Getting started <i class="icon icon-caret-down"></i></a>
<ul>
<li><a href='/getting-started/'>Installing Home Assistant</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='/topics/'>Advanced Topics</a></li>
</ul>
</li>
{% comment %}
Example dropdown menu
<li>
<a>Getting started <i class="icon icon-caret-down"></i></a>
<ul>
<li><a href='/getting-started/'>Installing Home Assistant</a></li>
<li><a href='/getting-started/configuration/'>Configuration Basics</a></li>
</ul>
</li>
{% endcomment %}
<li><a href='/getting-started/'>Getting started</a></li>
<li><a href='/components/'>Components</a></li>
<li><a href='/cookbook/'>Examples</a></li>
<li><a href="/developers/">Developers</a></li>
Expand Down
5 changes: 1 addition & 4 deletions source/_includes/edit_github.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{% assign url_parts = page.url | split: '/' %}
{% if page.hide_github_edit != true and
url_parts[1] != 'components' and
url_parts[1] != 'cookbook' and
url_parts[1] != 'developers' %}
{% if page.hide_github_edit != true %}
<div class='edit-github'><a href='https://github.com/home-assistant/home-assistant.io/tree/master/source/{{ page.path }}'>Edit this page on GitHub</a></div>
{% endif %}
2 changes: 2 additions & 0 deletions source/_includes/site/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
{% include asides/cookbook_navigation.html | compact_newlines %}
{% elsif url_parts[1] == 'developers' %}
{% include asides/developers_navigation.html | compact_newlines %}
{% elsif url_parts[1] == 'getting-started' %}
{% include asides/getting_started_navigation.html | compact_newlines %}
{% else %}
{% include asides/about.html %}

Expand Down
8 changes: 7 additions & 1 deletion source/_layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
---

<article class="page">
{% include edit_github.html %}
{% assign url_parts = page.url | split: '/' %}
{% if url_parts[1] != 'components' and
url_parts[1] != 'cookbook' and
url_parts[1] != 'developers' and
url_parts[1] != 'getting-started' %}
{% include edit_github.html %}
{% endif %}

{% if page.title and page.show_title != false %}
<header>
Expand Down
2 changes: 1 addition & 1 deletion source/getting-started/android.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: page
title: "Getting started on Android"
description: "Android instructions to add Home Assistant to your homescreen."
date: 2015-03-08 21:36
sidebar: false
sidebar: true
comments: false
sharing: true
footer: true
Expand Down
2 changes: 1 addition & 1 deletion source/getting-started/automation.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: page
title: "Automating Home Assistant"
description: "Steps to help you get automation setup in Home Assistant."
date: 2015-09-19 09:40
sidebar: false
sidebar: true
comments: false
sharing: true
footer: true
Expand Down
31 changes: 31 additions & 0 deletions source/getting-started/autostart-macos.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
layout: page
title: "Autostart on macOS boot"
description: "Instructions how to setup Home Assistant to launch on macOS boot."
date: 2015-9-1 22:57
sidebar: true
comments: false
sharing: true
footer: true
---

Setting up Home Assistant to run as a background service is simple. OS X will start it on boot and make sure it's always running.

To get Home Assistant installed as a background service, run:


```bash
$ hass --install-osx

Home Assistant has been installed. Open it here: http://localhost:8123
```

Home Assistant will log to `~/Library/Logs/homeassistant.log`

To uninstall the service, run:

```bash
$ hass --uninstall-osx

Home Assistant has been uninstalled.
```
49 changes: 49 additions & 0 deletions source/getting-started/autostart-synology.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
layout: page
title: "Autostart on Synology NAS boot"
description: "Instructions how to setup Home Assistant to launch on boot on Synology NAS."
date: 2015-9-1 22:57
sidebar: true
comments: false
sharing: true
footer: true
---

To get Home Assistant to automatically start when you boot your Synology NAS:

SSH onto your synology & login as admin or root

```bash
$ cd /volume1/homeassistant
```

Create "homeassistant.conf" file using the following code

```bash
# 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
```

Register the autostart

```bash
$ ln -s homeassistant-conf /etc/init/homeassistant-conf
```

Make the relevant files executable:

```bash
$ chmod -r 777 /etc/init/homeassistant-conf
```

That's it - reboot your NAS and Home Assistant should automatically start
70 changes: 70 additions & 0 deletions source/getting-started/autostart-systemd.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
layout: page
title: "Autostart using SystemD"
description: "Instructions how to setup Home Assistant to launch on boot using SystemD."
date: 2015-9-1 22:57
sidebar: true
comments: false
sharing: true
footer: true
---

Newer linux distributions are trending towards using systemd for managing daemons. Typically, systems based on Fedora or Debian 8 or later use systemd. This includes Ubuntu releases including and after 15.04, CentOS, and Red Hat. If you are unsure if your system is using `systemd`, you may check with the following command:

```bash
$ ps -p 1 -o comm=
```

If the preceding command returns the string `systemd`, you are likely using `systemd`.

If you want Home Assistant to be launched automatically, an extra step is needed to setup `systemd`. You need a service file to control Home Assistant with `systemd`. If you are using a Raspberry Pi with Raspbian then replace the `[your user]` with `pi` otherwise use your user you want to run Home Assistant. `ExecStart` contains the path to `hass` and this may vary. Check with `whereis hass` for the location.

```bash
$ su -c 'cat <<EOF >> /lib/systemd/system/home-assistant@[your user].service
[Unit]
Description=Home Assistant
After=network.target
[Service]
Type=simple
User=%i
ExecStart=/usr/bin/hass
[Install]
WantedBy=multi-user.target
EOF'
```

There is also another [sample service file](https://raw.githubusercontent.com/balloob/home-assistant/master/script/home-assistant%40.service) available. To use this one, just download it.

```bash
$ sudo wget https://raw.githubusercontent.com/balloob/home-assistant/master/script/home-assistant%40.service -O /lib/systemd/system/home-assistant@[your user].service
```

You need to reload `systemd` to make the daemon aware of the new configuration. Enable and launch Home Assistant after that.

```bash
$ sudo systemctl --system daemon-reload
$ sudo systemctl enable home-assistant@[your user]
$ sudo systemctl start home-assistant@[your user]
```

If everything went well, `sudo systemctl start home-assistant` should give you a positive feedback.

```bash
$ sudo systemctl status home-assistant@[your user] -l
[email protected] - Home Assistant for [your user]
Loaded: loaded (/usr/lib/systemd/system/home-assistant@[your user].service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2016-03-26 12:26:06 CET; 13min ago
Main PID: 30422 (hass)
CGroup: /system.slice/system-home\x2dassistant.slice/home-assistant@[your user].service
├─30422 /usr/bin/python3 /usr/bin/hass
└─30426 /usr/bin/python3 /usr/bin/hass
[...]
```

To get Home Assistant's logging output, simple use `journalctl`.

```bash
$ sudo journalctl -f -u home-assistant@[your user]
```
Loading

0 comments on commit 432ee1a

Please sign in to comment.