Home Assistant

提供: ArchWiki
2021年7月21日 (水) 12:05時点におけるKusanaginoturugi (トーク | 投稿記録)による版 (→‎使用方法: 順序の変更)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
ナビゲーションに移動 検索に移動

Home Assistant はオープンソースのホームオートメーションソフトウェアです。ローカル制御とプライバシー優先を志しています。ハッカーや DIY マニアの世界的なコミュニティによって運営されています。

インストール

home-assistant パッケージをインストールしてください。

設定

設定ファイルは /var/lib/hass/ に保存されます。設定ファイルが存在しない場合、デフォルトの設定が起動時に書き込まれます。

使用方法

Home Assistant を起動するには home-assistant.service起動有効化してください。

なお、初回起動には20分程度かかる場合があります。[1]依存ソフトウエアがダウンロード・インストールされるためです。なお、journalctl を使うと起動処理の状況を確認できます:

$ journalctl -fu home-assistant

デフォルトでは、http://localhost:8123 からウェブインタフェースを開けます。

Using MariaDB

​ 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 python-mysqlclient 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 database.* TO 'username'@'localhost';
FLUSH PRIVILEGES;
quit;

​ Add to your configuration file:

/var/lib/hass/configuration.yaml
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):

/var/lib/hass/secrets.yaml
recorder_mariadb_url: "mysql://USER:PASSWORD@localhost/DATABASE?unix_socket=/var/run/mysqld/mysqld.sock&charset=utf8mb4"

​ Finally, restart the home-assistant.service. The database should now start to populate. For more information refer to the recorder integration documentation.

参照