Skip to content
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.

Documentation #88

Merged
merged 28 commits into from
Feb 6, 2018
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
239 changes: 21 additions & 218 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,227 +1,30 @@
## Hassbian-scripts

These are the scripts used in the [HASSbian](https://github.com/home-assistant/pi-gen) image.
The scripts in this repository where made to be used with the HASSbian image and the included Home Assistant instance.


## The included scripts
The following scripts are currently included. You can view the documentation below for usage and instructions.

### hassbian-config (hassbian-config)
This command is a package handler for the Hassbian scripts. All interactions for installing software should be handled through this command. Running the individual scripts to install software will no longer work as expected.

#### Usage
The hassbian-config command is invoked with:
```bash
hassbian-config *command* *suite*
```
where command is one of:
- `install`
- `upgrade`
- `show`
- `log`
- `share-log`

##### install
The install command takes one argument and will attempt to install the indicated suite of software.
Generally, this means that the invocation of `hassbian-config` should be run as root, with:
`sudo hassbian-config install *suite*`
##### upgrade
The install command takes one argument and will attempt to install the indicated suite of software.
Generally, this means that the invocation of `hassbian-config` should be run as root, with:
`sudo hassbian-config upgrade *suite*`
##### show
The show command can be run without arguments, and lists all available suites which can be installed or with a *suite* name as argument and shows information about the suite .
##### log
This command shows the log from the last `hassbian-config` operation.
##### share-log
This command creates an easy to share hastebin link of your last `hassbian-config` operation.

## Installer script components
All scripts listed below are helper scripts for the `hassbian-config` command, and shouldn't be run directly. The documentation has been kept for explanatory purposes only.

### Install Hue *(install_hue.sh)*
Configures the Python executable to allow usage of low numbered port numbers for use with Amazon Echo, Google Home and Mycroft.ai.

This script was originally contributed by [@Landrash](https://github.com/landrash).


### Install Home Assistant *(install_homeassistant.sh)*
This is a copy of the installation script run during first boot of your Raspberry Pi.
Usually this script is not run after installation but could be used with some modifications to reinstall Home Assistant.

This script was originally contributed by [@Landrash](https://github.com/landrash).


### Install Homebridge with Home Assistant addon *(install_homebridge.sh)*
This script will install and configure Homebridge to be used with Home Assistant.
This will allow you to controll your home with Apple's HomeKit (Siri on iOS, OSX and AppleTV).
By default all devices are hidden, and you will need to add som entries in your `customize.yaml` configuration.
You can learn more about this in the [Home Assistant for Homebridge repo.](https://github.com/home-assistant/homebridge-homeassistant#customization)
_NB!: This install script will fail resulting in your Pi to reboot, if you do not use an recomended level powersupply._
```
sudo hassbian-config install homebridge
```
This script was originally contributed by [@Ludeeus](https://github.com/ludeeus).

### Install Home Assistant Development Branch *(install_homeassistant-dev.sh)*
This will install the current development branch of Home Assistant.
This is not recommended for daily use and should only be used if you know what your doing.

This script was originally contributed by [@Landrash](https://github.com/landrash).

### Install databases
The following scripts are meant for use with the [recorder](https://home-assistant.io/components/recorder/) component in Home Assistant and install databases and/or tools required for using them.

#### Install MariaDB *(install_mariadb.sh)*
This script installs MariaDB and it's dependencies for use with the [recorder](https://home-assistant.io/components/recorder/) component in Home Assistant.
No database or database user is created during this setup and will need to be created manually.

##### Example for creating database
```$ sudo mysql -u root -p```
```$ CREATE DATABASE homeassistant;```
```$ CREATE USER 'homeassistantuser' IDENTIFIED BY 'password';```
```$ GRANT ALL PRIVILEGES ON homeassistant.* TO 'homeassistantuser';```
```$ FLUSH PRIVILEGES;```
```$ exit ```

This script was originally contributed by [@Landrash](https://github.com/landrash).

#### Install PostgreSQL *(install_postgresql.sh)*
This script installs PostgreSQL and it's dependencies for use with the [recorder](https://home-assistant.io/components/recorder/) component in Home Assistant.
No database or database user is created during this setup and will need to be created manually.

This script was originally contributed by [@Landrash](https://github.com/landrash).

#### Install MS SQL *(install_mssql.sh)*
This script installs the tools needed to connect to a MS SQL databse and it's dependencies for use with the [recorder](https://home-assistant.io/components/recorder/) component in Home Assistant.
No database or database user is created during this setup and will need to be created manually.

This script was originally contributed by [@Landrash](https://github.com/landrash).

### Share configuration with Samba *(install_samba.sh)*
This script installs samba and it dependencies. It also set up a share for Home Assistant's configuration. **This is potentially unsafe and generally not recommended.**

Script is run as the `pi` user with the following command. Normal runtime for this script is about 5 minutes.
```
sudo hassbian-config install samba
```
After this script has been run, the configuration directory used by Home Assistant is available over Samba and can be accessed from example Windows to edit with your favorite editor.

This script was originally contributed by [@Landrash](https://github.com/Landrash).

### Install Trådfri Gateway Support *(install_tradfri.sh)*
This script installs the dependencies for discovering and using a IKEA Trådfri Gateway with Home Assistant. It's recommended to restart your Trådfri Gateway after this install has been done.

Script is run as the `pi` user with the following command. Normal runtime for this script is about 5 minutes.
```
sudo hassbian-config install tradfri
```
This script was originally contributed by [@Landrash](https://github.com/Landrash).

### Install Mosquitto *(install_mosquitto.sh)*
This script installs the MQTT Mosquitto server. Repository from the Mosquitto project is added to package system and the official packages for Debian are installed.
Additionally, this script helps you create your first MQTT user that can be used with Home Assistant.


Script is run as the `pi` user with the following command. Normal runtime for this script is about 10 minutes.
```
sudo hassbian-config install mosquitto
```

This script was originally contributed by [@dale3h](https://github.com/dale3h) and has been modified by [@Landrash](https://github.com/Landrash).

### Install CEC support *(install_libcec.sh)*
**This scipt is currently brooken upstream since it currently doesn't build properly for Python >3.4** This script installs libcec and it dependencies. Further more this script symlinks the system wide packages to the Home Assistant venv so they can be used with Home Assistant.

Script is run as the `pi` user with the following command. Normal runtime for this script is about 10 minutes.
```
sudo hassbian-config install libcec
```
After this script has been run, add CEC to your `configuration.yaml` file as usual.

This script was originally contributed by [@Landrash](https://github.com/Landrash).

### Install Duck DNS auto renewal *(install_duckdns.sh)*
This script adds an cron job to auto update you the WAN IP address for the defined domain.
Before running this script you should already have an Duck DNS account, during the installation you will be asked to supply your domain name and the token for your account.
```
sudo hassbian-config install duckdns
```

If you choose to aslo generate SSL certificates with this you would need to add this under `http:` to your `configuration.yaml`
```
ssl_certificate: /home/homeassistant/dehydrated/certs/YOURDOMAIN.duckdns.org/fullchain.pem
ssl_key: /home/homeassistant/dehydrated/certs/YOURDOMAIN.duckdns.org/privkey.pem
base_url: YOURDOMAIN.duckdns.org:PORTNUMBER
```
This script was originally contributed by [@Ludeeus](https://github.com/Ludeeus).

### Install an web terminal for easy access to ssh in an web browser *(install_webterminal.sh)*
This script installs an web terminal called 'shellinabox' to you system that give you SSH access in you web browser.

Script is run as the `pi` user with the following command:
```
sudo hassbian-config install webterminal
```
Example config for Home-Assistant:
```yaml
panel_iframe:
terminal:
title: 'Terminal'
icon: mdi:console
url: 'http://192.168.1.2:4200'
```
This script was originally contributed by [@Ludeeus](https://github.com/Ludeeus).

### Install RaZberry *(install_razberry.sh)*
This script disables Bluetooth for the use of a RaZberry with Hassbian.
Code is adapted from the Razberry install script found at http://razberry.z-wave.me/install.
This will disable the use of Bluetooth and Bluetooth Low Energy devices.
```
sudo hassbian-config install razberry
```
This script was originally contributed by [@Landrash](https://github.com/Landrash).


## Upgrade script components

### Upgrade your Home Assistant installation *(uppgrade_home-assistant.sh)*
This script will automate the process of upgrading your Home Assistant to the newest version.
```
sudo hassbian-config upgrade home-assistant
```
This script was originally contributed by [@Ludeeus](https://github.com/Ludeeus).

### Upgrade your AppDaemon *(uppgrade_appdaemon.sh)*
This script will upgrade AppDaemon to the newest version.
```
sudo hassbian-config upgrade appdaemon
```

This script was originally contributed by [@Ludeeus](https://github.com/Ludeeus).

### Upgrade your HASSbian installation *(uppgrade_hassbian.sh)*
This script will update the base OS on the system.
```
sudo hassbian-config upgrade hassbian
```
This script was originally contributed by [@Landrash](https://github.com/Landrash).

### Upgrade HASSbian-scripts *(uppgrade_hassbian-script.sh)*
This will download and install the newest published version of HASSBian-scripts.
```
sudo hassbian-config upgrade hassbian-script
```
This script was originally contributed by [@Ludeeus](https://github.com/Ludeeus).

### Upgrade HASSbian-scripts from dev branch *(uppgrade_hassbian-script-dev.sh)*
This will download and install the newest additions to the dev branch of HASSbian-Scripts.
_Note that this is intended on people who like living on the 'bleeding edge', it is not recommended using this in a production setup._
```
sudo hassbian-config upgrade hassbian-script
```
This script was originally contributed by [@Ludeeus](https://github.com/Ludeeus).

<!--- When adding stuff here, please keep it alphabetical --->
* [hassbian-config](/docs/hassbian_config.md)
* [AppDaemon](/docs/appdaemon.md)
* [Duck DNS](/docs/duckdns.md)
* [HASSbian](/docs/hassbian.md)
* [Home Assistant](/docs/homeassistant.md)
* [Homebridge](/docs/homebridge.md)
* [HUE](/docs/hue.md)
* [LibCEC](/docs/libcec.md)
* [MariaDB](/docs/mariadb.md)
* [Mosquitto](/docs/mosquitto.md)
* [PostgreSQL](/docs/postgresql.md)
* [MS SQL](/docs/mssql.md)
* [RaZberry ](/docs/razberry.md)
* [Samba](/docs/samba.md)
* [Trådfri](/docs/tradfri.md)
* [Webterminal](/docs/webterminal.md)
* [Changelog](https://github.com/home-assistant/hassbian-scripts/releases)

***
## Raspbian Jessie
If this package is used with a Debian Jessie based distrbution then you need to uncomment the source repositores in `/etc/apt/sources.list`

Expand Down
31 changes: 31 additions & 0 deletions docs/appdaemon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## Description
This Installs AppDaemon in a separate Venv onto this system.
For more information about AppDaemon see the [documentation.](http://appdaemon.readthedocs.io/en/latest/)

## Installation
```
$ sudo hassbian-config install appdaemon
```

## Upgrade
```
$ sudo hassbian-config upgrade appdaemon
```

## Additional info
Running as: `homeassistant`
Configuration dir: `/home/homeassistant/appdaemon/`
Start service: `sudo systemctl start appdaemon@homeassistant.service`
Stop service: `sudo systemctl stop appdaemon@homeassistant.service`
Restart service: `sudo systemctl restart appdaemon@homeassistant.service`
Service status: `sudo systemctl status appdaemon@homeassistant.service`
Enter the virtual environment where AppDaemon is installed as `homeassistant`:
```
sudo su -s /bin/bash homeassistant
source /srv/homeassistant/bin/activate
```
When you are done, type `exit` to return to the `pi` user.

***
The installation script was originally contributed by [@Landrash](https://github.com/landrash).
The upgrade script was originally contributed by [@Ludeeus](https://github.com/ludeeus).
21 changes: 21 additions & 0 deletions docs/duckdns.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Description
This script adds an cron job to auto update you the WAN IP address for the defined domain.
Before running this script you should already have an Duck DNS account, during the installation you will be asked to supply your domain name and the token for your account.

## Installation
```
$ sudo hassbian-config install duckdns
```

## Additional info
Running as: `homeassistant`

If you choose to aslo generate SSL certificates with this you would need to add this under `http:` to your `configuration.yaml`
```
ssl_certificate: /home/homeassistant/dehydrated/certs/YOURDOMAIN.duckdns.org/fullchain.pem
ssl_key: /home/homeassistant/dehydrated/certs/YOURDOMAIN.duckdns.org/privkey.pem
base_url: YOURDOMAIN.duckdns.org:PORTNUMBER
```

***
This script was originally contributed by [@Ludeeus](https://github.com/ludeeus).
16 changes: 16 additions & 0 deletions docs/hassbian.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Description
This script will update the base OS on the system.

## Upgrade
```
$ sudo hassbian-config upgrade hassbian
```

## Additional info
Default username: `pi`
Default password: `raspberry`
Hostname: `hassbian`
SSH enabled: `true`

***
This script was originally contributed by [@Landrash](https://github.com/Landrash).
31 changes: 31 additions & 0 deletions docs/hassbian_config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## Description
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be extended a bit.
Documentation about the flags like -y & -t are missing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When this PR was created, those flags did not exist :)
They are added now :)

This command is a package handler for the Hassbian scripts. All interactions for installing software should be handled through this command. Running the individual scripts to install software will no longer work as expected.

#### Usage
The hassbian-config command is invoked with:
```bash
hassbian-config *command* *suite*
```
where command is one of:
- `install`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation about each command could be extended.

- `upgrade`
- `show`
- `log`
- `share-log`

## Installation
```
$ curl https://api.github.com/repos/home-assistant/hassbian-scripts/releases/latest | grep "browser_download_url.*deb" | cut -d : -f 2,3 | tr -d \" | wget -qi -
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be rewritten to recommend installing the image instead to reflect that it exists. The command line option could be left as an alternative but have a warning that if it's used with anything else than Raspbian or Hassbian it might not function as intended.

$ sudo apt install -y ./hassbian*
```


## Upgrade
```
$ sudo hassbian-config upgrade hassbian-script
```

## Upgrade to dev branch
```
$ sudo hassbian-config upgrade hassbian-script-dev
```
32 changes: 32 additions & 0 deletions docs/homeassistant.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## Description
This is a copy of the installation script run during first boot of your Raspberry Pi with the [Hassbian image](https://github.com/home-assistant/pi-gen/releases/latest)
And an easy way to upgrade Home Assistant to the newest version.

## Installation
_**NB!: This is installed by Hassbian, and should not be run additionally**_
```
$ sudo hassbian-config install homeassistant
```

## Upgrade
```
$ sudo hassbian-config upgrade home-assistant
```

## Additional info
Running as: `homeassistant`
Configuration dir: `/home/homeassistant/.homeassistant/`
Start service: `sudo systemctl start home-assistant@homeassistant.service`
Stop service: `sudo systemctl stop home-assistant@homeassistant.service`
Restart service: `sudo systemctl restart home-assistant@homeassistant.service`
Service status: `sudo systemctl status home-assistant@homeassistant.service`
Enter the virtual environment where Home Assistant is installed as `homeassistant`:
```
sudo su -s /bin/bash homeassistant
source /srv/homeassistant/bin/activate
```
When you are done, type `exit` to return to the `pi` user.

***
The installation script was originally contributed by [@Landrash](https://github.com/landrash).
The upgrade scripts was originally contributed by [@Ludeeus](https://github.com/ludeeus).
Loading