10 KiB
layout, title, description, date, sidebar, comments, sharing, footer
layout | title | description | date | sidebar | comments | sharing | footer |
---|---|---|---|---|---|---|---|
page | Getting Started | Step by step guide to get started with Home Assistant. | 2014-12-18 22:57 | false | false | true | true |
Preparation
The preparation of a Fedora 22 host will only take a couple of minutes. First install Python 3.4, git
and the other needed packages out of the Fedora Package Collection. This ensure that you receive updates in the future.
It's assumed that your user has an entry in the sudoers file. Otherwise, run the commands which needs more privileges as root.
sudo dnf -y install python3 python3-devel git gcc
CentOS is providing longtime support and often not shipping the latest release of a software component. To run, Python 3.x on CentOS Software Collections needs to be activated.
Step 1. Install the tools for the Software Collection
sudo yum -y install scl-utils
Step 2. Make the repository available.
sudo yum -y install https://www.softwarecollections.org/en/scls/rhscl/rh-python34/epel-7-x86_64/download/rhscl-rh-python34-epel-7-x86_64.noarch.rpm
Step 3. Install Python 3.x
sudo yum -y install rh-python34
Step 4. Start using software collections:
scl enable rh-python34 bash
Installation
```bash git clone --recursive https://github.com/balloob/home-assistant.git python3 -m venv home-assistant cd home-assistant source bin/activate python3 -m homeassistant --open-ui ```
Running these commands will:
- Download Home Assistant
- Setup an isolated environment
- Navigate to downloaded files
- Activate the isolated environment (on Windows, run
Scripts/activate.bat
) - Launch Home Assistant and serve web interface on http://localhost:8123
Post-Installation
There is nothing else to do. If you run into any issues, please see the troubleshooting page.
You can run Home Assistant in demo mode by appending --demo-mode
to line 5.
If you want to update to the latest version in the future, run: scripts/update
.
By default, the access to port 8123 is not allowed. If you want to allow other hosts in your local network access, open port 8123.
sudo firewall-cmd --permanent --add-port=8123/tcp
sudo firewall-cmd --reload
Home Assistant will serve its web interface on http://[IP address of the host]:8123.
If you want that Home Assistant is lauched automatically, an extra step is needed to setup systemd
. You need a service file to control Home Assistant with systemd
. The WorkingDirectory
and the PYTHONPATH
must point to your clone git repository.
su -c 'cat <<EOF >> /lib/systemd/system/home-assistant.service
[Unit]
Description=Home Assistant
After=network.target
[Service]
Type=simple
WorkingDirectory=/home/fab/home-assistant/
Environment="PYTHONPATH=/home/fab/home-assistant/"
ExecStart=/usr/bin/python3.4 -m homeassistant
[Install]
WantedBy=multi-user.target
EOF'
You need to reload systemd
to make the daemon aware of the new configuration. Enable and launch Home Assistant after that.
sudo systemctl --system daemon-reload
sudo systemctl enable home-assistant
sudo systemctl start home-assistant
If everything went well, sudo systemctl start home-assistant
should give you a positive feedback.
$ sudo systemctl status home-assistant -l
● home-assistant.service - Home Assistant
Loaded: loaded (/usr/lib/systemd/system/home-assistant.service; disabled; vendor preset: disabled)
Active: active (running) since Thu 2015-06-25 23:38:37 CEST; 3min 13s ago
Main PID: 8557 (python3.4)
CGroup: /system.slice/home-assistant.service
└─8557 /usr/bin/python3.4 -m homeassistant
[...]
To get Home Assistant's logging output, simple use journalctl
.
sudo journalctl -f -u home-assistant
If you want to update to the latest version in the future, run: scripts/update
and restart Home Assistant.
Those instructions were written for Fedora 22 Server and Workstation. They may work for Cloud flavor as well but this was not tested.
Coming soon...
Installation with Docker is straightforward. Adjust the following command so that /path/to/your/config/
points at the folder where you want to store your config and run it:
docker run -d --name="home-assistant" -v /path/to/your/config:/config -v /etc/localtime:/etc/localtime:ro --net=host balloob/home-assistant
This will launch Home Assistant and serve its web interface from port 8123 on your Docker host.
When using boot2docker on OS X you are unable to map the local time to your Docker container. Replace -v /etc/localtime:/etc/localtime:ro
with -e "TZ=America/Los_Angeles"
(replacing America/Los_Angeles with your timezone)
Home Assistant uses Python 3.4. This makes installation on a Raspberry Pi a bit more difficult as it is not available in the package repository. Please follow the following instructions to get it up and running.
Step 1. Install pyenv
curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
After the installation is done, run:
nano ~/.bashrc
Then add these lines to the end of the file and save:
``` export PATH="$HOME/.pyenv/bin:$PATH" eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)" ```Step 2. Install requirements
sudo apt-get install python3-dev
sudo apt-get install libsqlite3-dev libreadline-dev libbz2-dev
Log out and then back in so your bashrc is reloaded.
NOTE: the rest of the commands are not being run as sudo and will install python etc under you user's home directory.
Step 3. Install python 3.4.2 (this will take a few hours)
pyenv install 3.4.2
Step 4. Create Python Virtual Environment
```bash pyenv virtualenv 3.4.2 homeassistant ```Step 5. Clone the source
```bash git clone --recursive https://github.com/balloob/home-assistant.git ```Step 6. Set the virtual environment
```bash cd home-assistant pyenv local homeassistant ```Step 7. Start it up
```bash python3 -m homeassistant ```It will be up and running on port 8123
If you want to update to the latest version in the future, run: scripts/update
.