Home Assistant is an open source home automation software that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts.
Install the package. This is installing the core flavor of Home Assistant.
Home Assistant Supervised
Refer to Home Assistant Supervised.
Configuration files are stored at
/var/lib/hass/. If no configuration exists, a default configuration will be written at startup.
To start Home Assistant, start/enable
The first start may take up to 20 minutes because the required packages will be downloaded and installed. You can see the progress in the logs.
# journalctl -fu home-assistant
By default, the web interface is available at http://localhost:8123.
The Backup restore function is not available in the UI. The backup can be restored bay extraction of the tar.gz file in the Backup as user hass:
# tar --strip-components=1 -xzf homeassistant.tar.gz -C /var/lib/hass
By default, SQLite is used for the recorder/history integration within Home Assistant. A noticeable performance boost is achievable by using MariaDB (especially for larger setups). Home assistant uses SQLAlchemy which means that any backend is supported, like MySQL, MariaDB, PostgreSQL, or MS SQL Server. Here we only discuss MariaDb, for others please refer to the recorder integration documentation.
If not already installed, please refer to MariaDB for installation details.
Install the package dependency.
Create a new database, the example below shows a single username per service, with wildcard access to all databases having the username as a prefix e.g.:
$ mysql -u root -p
CREATE USER 'username'@'localhost' IDENTIFIED BY 'some_pass' ; CREATE DATABASE username; GRANT ALL PRIVILEGES ON username.* TO 'username'@'localhost'; FLUSH PRIVILEGES; quit;
Add to your configuration file:
recorder: db_url: !secret recorder_mariadb_url
Add to your secrets file (if not using a Unix socket, see the recorder integration documentation for alternative URLs):
No access to USB devices
In the default installation, the Home Assistant may not have the necessary access to work with some devices, such as a Zigbee USB dongle. This is because such devices are controlled by the
uucp system group.
home-assistant.service and add
SupplementaryGroups=uucp to the
[Service] section so that the default
hass user belongs to the right group.
Bluetooth integration not working
If you are experiencing issues with Bluetooth integration and the below error message appears in your log it is because that the Bluetooth integration connects over dbus and there is an old systemd bug.
Config entry 'Bluetooth' for bluetooth integration not ready yet: DBus connection broken: [Errno 32] Broken pipe; try restarting `bluetooth` and `dbus`; Retrying in background
A solution is to switch to .
Alternatively, add a system user and group
# useradd -U -r -s /usr/bin/nologin hass
Use a drop-in file for
ModuleNotFoundErrors in logs
If Home Assistant is broken after a system package upgrade, it could be caused by a bad interaction between the system packages and Home Assistant's managed Python libraries. To reset Home Assistant's Python libraries and reinstall them from scratch, delete the modules directory:
# rm -r /var/lib/hass/deps/lib
If the first restart produces more ModuleNotFoundErrors, it might be necessary to a second restart. Home Assistant will detect that its modules are missing and automatically reinstall them.