.. author:: Dirk <https://github.com/universalappfactory/>
.. tag:: lang-python
.. tag:: iot
.. tag:: mqtt
.. tag:: web
.. tag_list::
Open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server. [1]
Note
For this guide you should be familiar with the basic concepts of
Home Assistant is written in Python and licensed under the Apache License 2.0. All relevant legal information can be found here:
Your domain needs to be setup:
Install Home Assistant in a virtual environment. Python 3.8 or later is recommended, so we'll stick to 3.8.
[isabell@stardust ~]$ mkdir ~/homeassistant
[isabell@stardust ~]$ cd ~/homeassistant
[isabell@stardust homeassistant]$ python3.8 -m venv .
[isabell@stardust homeassistant]$ source ./bin/activate
[isabell@stardust homeassistant]$ python3.8 -m pip install wheel
[isabell@stardust homeassistant]$ python3.8 -m pip install homeassistant
[isabell@stardust homeassistant]$
Now we can start Home Assistant for the first time in order to create all needed configuration files. Just run the following command in the created homeassistant directory with active venv.
[isabell@stardust homeassistant]$ hass
[isabell@stardust homeassistant]$
A directory containing config files is created at /home/isabell/.homeassistant. So you can terminate the homeassistant using STRG-C.
Now it's time to make a basic configuration. Home Assistant documentation to find out more about Home Assistant configuration.
Use an editor such as nano
to edit Home Assistant's configuration file:
[isabell@stardust ~]$ nano ~/.homeassistant/configuration.yaml
Modify external_url
and internal_url
.
homeassistant:
name: Home
latitude: 32.87336
longitude: 117.22743
elevation: 430
unit_system: metric
time_zone: Europe/Berlin
external_url: "isabell.uber.space"
internal_url: "0.0.0.0:8123"
allowlist_external_dirs:
allowlist_external_urls:
media_dirs:
legacy_templates: false
Note
Home Assistant is running on port 8123.
Create ~/etc/services.d/homeassistant.ini
with the following content:
[program:homeassistant]
command=python -m homeassistant
autostart=yes
autorestart=yes
environment=PATH="%(ENV_HOME)s/homeassistant/bin"
If it's not in state RUNNING, check your configuration.
Now Home Assistant should be running and you can point your webbrowser to the configured domain in order to make the initial homeserver setup.
Change all default passwords. Look at folder permissions. Don't get hacked!
And last but not least, don't forget to check out the security checklist:
Note
Check out the packageindex regularly to stay informed about the newest version.
Tested with homeassistant 2020.12.2, Uberspace 7.8.1.0
.. author_list::
[1] | https://www.home-assistant.io/, 30.12.2020 |